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

Cannot use import statement outside a module #1

Closed
imlautaro opened this issue Apr 9, 2021 · 6 comments
Closed

Cannot use import statement outside a module #1

imlautaro opened this issue Apr 9, 2021 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@imlautaro
Copy link

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

  • OS: Windows (I test it using PowerShell & Debian WSL)
  • Version of supabase-js: 1.9.0
  • Version of Node.js: 15.13.0
  • Version of NPM: 7.8.0
@imlautaro imlautaro added the bug Something isn't working label Apr 9, 2021
@scottrobertson
Copy link
Contributor

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
Copy link
Author

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
Copy link

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
Copy link
Contributor

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.

@scottrobertson scottrobertson added help wanted Extra attention is needed bug Something isn't working and removed bug Something isn't working labels Apr 14, 2021
@phiberber
Copy link

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.

asyncapi/asyncapi-react#177 (comment)

@scottrobertson
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants