Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The keyword 'interface' is reserved (Note that you need plugins to import files that are not JavaScript) #11

Closed
ulyssesdotcodes opened this issue Jun 10, 2021 · 7 comments

Comments

@ulyssesdotcodes
Copy link

Getting this error. It seems to crop up on some other repos, but I'm not sure what's causing it yet. Reporting and will investigate myself a little later today.

Steps to reproduce:

  1. Fork repo using template
  2. Clone repo into .obsidian/plugins directory
  3. Run npm i
  4. Run npm run dev

Expected
5. It compiles into a dev environment

Actual
5. It errors (copied below)

Thanks for the amazing product, looking forward to developing some plugins for it!

rollup v2.51.1
bundles main.ts → ...
[!] Error: The keyword 'interface' is reserved (Note that you need plugins to import files that are not JavaScript)
\\jouly\home\Obsidian\home\.obsidian\plugins\node-red-obsidian\main.ts (3:0)
1: import { App, Modal, Notice, Plugin, PluginSettingTab, Setting } from 'obsidian';
2:
3: interface NodeREDPluginSettings {
   ^
4:   nodeRedUrl: string;
5: }
Error: The keyword 'interface' is reserved (Note that you need plugins to import files that are not JavaScript)
    at error (U:\Obsidian\home\.obsidian\plugins\node-red-obsidian\node_modules\rollup\dist\shared\rollup.js:7917:30)
    at Module.error (U:\Obsidian\home\.obsidian\plugins\node-red-obsidian\node_modules\rollup\dist\shared\rollup.js:9859:16)
    at Module.tryParse (U:\Obsidian\home\.obsidian\plugins\node-red-obsidian\node_modules\rollup\dist\shared\rollup.js:10258:25)
    at Module.setSource (U:\Obsidian\home\.obsidian\plugins\node-red-obsidian\node_modules\rollup\dist\shared\rollup.js:10161:24)
    at ModuleLoader.addModuleSource (U:\Obsidian\home\.obsidian\plugins\node-red-obsidian\node_modules\rollup\dist\shared\rollup.js:19466:20)
    at async ModuleLoader.fetchModule (U:\Obsidian\home\.obsidian\plugins\node-red-obsidian\node_modules\rollup\dist\shared\rollup.js:19522:9)
    at async Promise.all (index 0)


[2021-06-10 09:37:59] waiting for changes...
@ulyssesdotcodes
Copy link
Author

Related to rollup/plugins#892

@ulyssesdotcodes
Copy link
Author

Removing nodeResolve({browser: true}) seems to fix the issue. As does making it point in such a way that it doesn't resolve node_modules.

@jimboc1
Copy link

jimboc1 commented Sep 13, 2021

Thanks for posting a solution as it worked for me too. Not sure of the consequences but I'll handle that when I come to it.

@ryanpcmcquen
Copy link

ryanpcmcquen commented Oct 5, 2021

Can we remove nodeResolve from the default? The current state is broken, which really hurts the usability of this template.

@lishid
Copy link
Collaborator

lishid commented Oct 6, 2021

I will review the sample template soon!

@lishid
Copy link
Collaborator

lishid commented Oct 19, 2021

I have updated this template to use ESBuild instead of Rollup. Anyone interested in giving it a spin?

@lishid
Copy link
Collaborator

lishid commented Oct 28, 2021

I've seen a few plugins using the new sample so I'm assuming everything is good to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants