supabase-community / nuxt-supabase

A supa simple wrapper around Supabase.js to enable usage within Nuxt.
https://supabase.io
MIT License
167 stars 17 forks source link

Cannot use import statement outside a module #1

Closed imlautaro closed 3 years ago

imlautaro commented 3 years ago

Bug report

After setup the module using npm I have an error that says "Cannot use import statement outside a module.

To Reproduce

Clone this project and follow the instructions provided in the README of the repo.

Expected behavior

That the module works 😆

Screenshots

image

System information

scottrobertson commented 3 years ago

So it looks like it's when ssr: true (the default) this fails. Having never used SSR, I will need to do some digging into how this works, and why it's erroring like this.

imlautaro commented 3 years ago

If you don't know much about NuxtJS let me take care of the module to me. I made a module that works very well and has TypeScript integration. If you want, take a look at the repository.

charlie17 commented 3 years ago

Faced the same problem, after adding ssr: false to nuxt.config.js, works as expected. Not sure if this might cause problems in other parts of my Nuxt app though

scottrobertson commented 3 years ago

Faced the same problem, after adding ssr: false to nuxt.config.js, works as expected. Not sure if this might cause problems in other parts of my Nuxt app though

Yeah, 100% not a fix we can ask people to do. Will look into it as soon as I get some time.

phiberber commented 3 years ago

Seems that someone already found a fix to this issue, is that valid? Didn't test yet and probably won't as I have zero experience with Nuxt Modules.

https://github.com/asyncapi/asyncapi-react/issues/177#issuecomment-831905940

scottrobertson commented 3 years ago

This should be resolved now. Let me know if you have any issues. Shall publish a new version soon.