react-easy-sort icon indicating copy to clipboard operation
react-easy-sort copied to clipboard

add type: module to your package.json

Open rob-bar opened this issue 1 year ago • 2 comments

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

rob-bar avatar Aug 07 '24 15:08 rob-bar

So I'm sure there is something I can do on my end to fix this but I do not yet know what.

rob-bar avatar Aug 07 '24 15:08 rob-bar

This also relates to this https://github.com/remix-run/remix/issues/9070

rob-bar avatar Aug 07 '24 15:08 rob-bar

Is there a way we can fix this I'm getting an error when using Vite also

Danieljs-codes avatar Mar 27 '25 11:03 Danieljs-codes

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.

rob-bar avatar Mar 29 '25 07:03 rob-bar