add type: module to your package.json
Describe the bug I'm bumping against this error:
Internal server error: Cannot use import statement outside a module
This stackoverflow url describes the same problem: https://stackoverflow.com/questions/75785671/error-cannot-use-import-statement-outside-a-module-while-testing-in-vite
My guess is that either type: module should be added in your published packages or you need to investigate this further. It's funny because when I include your library inside a normal vite react project it works fine, when I do that in a remix app it complains about above error.
Any ideas?
Thanks for your help
So I'm sure there is something I can do on my end to fix this but I do not yet know what.
This also relates to this https://github.com/remix-run/remix/issues/9070
Is there a way we can fix this I'm getting an error when using Vite also
Well, I have fixed it by just running this plugin only on the client with https://remix.run/docs/en/main/discussion/server-vs-client#client-modules . I guess the problem is node and it's configuration.