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

vite run dev error #51

Open
MikuBlog opened this issue Jan 11, 2022 · 2 comments
Open

vite run dev error #51

MikuBlog opened this issue Jan 11, 2022 · 2 comments

Comments

@MikuBlog
Copy link

The browser throws

vue-json-editor.vue:17

   Uncaught (in promise) SyntaxError: The requested module '/node_modules/vue-json-editor/assets/jsoneditor.js' does not provide an export named 'default'
@MikuBlog
Copy link
Author

version is @1.4.3

@MikuBlog
Copy link
Author

I guess is not support the vue3. My project is vue 3+.Thank you for support the vue3 by the npm package version 1.5.0 ~

beatrizsmerino added a commit to beatrizsmerino/vue-editor that referenced this issue Mar 20, 2024
Error:
- vue-router.js?v=9325602b:1692 SyntaxError: The requested module '/node_modules/vue-json-editor/assets/jsoneditor.js?v=9325602b' does not provide an export named 'default' (at vue-json-editor.vue:3:8)
- EditorJSON.vue:89 [Vue warn]: Failed to resolve async component: () => import("/node_modules/vue-json-editor/vue-json-editor.vue")
Reason: SyntaxError: The requested module '/node_modules/vue-json-editor/assets/jsoneditor.js?v=9325602b' does not provide an export named 'default'

Solution:
- Dynamically imports the `VueJsonEditor` component.

Reason:
- With this change we can now navigate to the `editors` page although the problem about the `VueJsonEditor` component persists.
It seems that the `vue-json-editor` package is not compatible with `vite` because it is not prepared for use with `ESModules`.
This is a temporary solution to be able to access the page, but you will have to replace the `vue-json-editor` package with another one that has the same functionality and is compatible.

References:
- https://www.npmjs.com/package/vue-json-editor
- dirkliu/vue-json-editor#42
- dirkliu/vue-json-editor#51
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

1 participant