ES6 module Import giving “Uncaught SyntaxError: Unexpected identifier”

非 Y 不嫁゛ 提交于 2019-11-27 13:51:12

As @Bergi mentioned in the comment, adding type="module" to the main.js import line solved the issue. All is working now.

Thanks to all of you who responded and tried to help.

From what I can see you are trying to load the file menu.module.js while it's actually named menu.js.

PS: From what I recall you could also drop the .js from the import statement.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!