question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi @remorses , I tried using genql with nuxt3 (I have it working Ok on a vue3 project already), but get the error below

 ERROR  Rollup error: Unexpected token (Note that you need plugins to import files that are not JavaScript)   nitro 00:06:13


 ERROR  Unexpected token (Note that you need plugins to import files that are not JavaScript)                       00:06:13

  at error (node_modules/rollup/dist/es/shared/rollup.js:1858:30)
  at Module.error (node_modules/rollup/dist/es/shared/rollup.js:12424:16)
  at Module.tryParse (node_modules/rollup/dist/es/shared/rollup.js:12801:25)
  at Module.setSource (node_modules/rollup/dist/es/shared/rollup.js:12706:24)
  at ModuleLoader.addModuleSource (node_modules/rollup/dist/es/shared/rollup.js:22180:20)

Nitro Server (used in Nuxt3) uses rollup under the hood but i don’t know what configuration is needed in nuxtconfig or anywhere else to make this error go away. when i take out all references to the genQL client this error goes away

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
shiftlabs1commented, Jul 10, 2022

@meabed I was able to fix this by creating a different client instance on the server / api. Even though i explicitly imported createClient from ‘./generated/index.js’ on both instances, the error only clears out when i have a different client instance defined within the server folder in nuxt3. I will use genql for now, until gqlts has the chain module back in .

1reaction
meabedcommented, Jul 9, 2022

I have use this and big thanks to remorse great work! I used it in nextjs But i had a multiple errors in server side also with graphql subscription being deprecated and some typing difficulties to reuse.

So I have maintained a fork here and it has all the fixes. Added axios by default and exposed all options each operation. Add ws for server side and client side Returned consistent data structure from graphql like data, extensions, errors. And few types improvements to support reusing the graphql in typescript files like parameter and head and return type.

https://github.com/meabed/gqlts

Please feel free to check it out. I would like to open a PR to merge those here if @remorses is open for it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error handling · Get Started with Nuxt
Learn how to catch errors in different lifecycle. Handling Errors. Nuxt 3 is a full-stack framework, which means there are several sources of...
Read more >
Nuxt 3 Client-Side Error Handling
When an error happens in your Vue app, it bubbles up until something catches it. If nothing catches it, your whole app crashes....
Read more >
Nuxt 3: When useFetch returns an error, how can I get the ...
Suppose I have a route for viewing a blog post. In that route's .vue file, I call useFetch to fetch the blog post....
Read more >
NUXT 3 - Custom 404 Error Message - StackBlitz
error statusCode is number when the error. originates on client-side while the page is. navigated using NuxtLink. - Please see line 17 and...
Read more >
How to create Nuxt 3 404 error page?! - Reddit
How to create Nuxt 3 404 error page?! I spend hours searching and finally found this article from Vue School. To make a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found