-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Cannot use import statement outside a module | when using @uiw/react-markdown-editor #9554
Comments
I'm also using Vite here, but I suspect the issue is with Remix. The Markdown editor works fine in a standalone Vite app without Remix. Also getting this error message in StackBlitz 13:31:23 [vite] Internal server error: Cannot use import statement outside a module |
Place the editor in Editor.client.tsx or any .client.tsx file. Example: https://github.com/arvigeus/format-code Now there’s another issue: in that project it works, but today I tried it on a brand new project and it threw an error. It’s not the react-codemirror, it’s Remix - it was crashing on any .client.tsx file today. Latest version from the template. Does this affect you too? |
No @arvigeus , after placing the editor in Editor.client.tsx its working work me.
Thanks for the solution. |
Do you use |
no @arvigeus I am not using |
Reproduction
StackBlitz - https://stackblitz.com/~/github.com/Vishal17199/remix-test?file=app/routes/_index.tsx
git repo - https://github.com/Vishal17199/remix-test
System Info
Used Package Manager
npm
Expected Behavior
Markdown editor should work fine
Actual Behavior
Getting below error
Cannot use import statement outside a module
at new AsyncFunction ()
at instantiateModule (file:///Users/vishal/Documents/test/node_modules/vite/dist/node/chunks/dep-BKbDVx1T.js:56228:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5
Click outside, press Esc key, or fix the code to dismiss.
You can also disable this overlay by setting server.hmr.overlay to false in vite.config.ts.
The text was updated successfully, but these errors were encountered: