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

Nuxt cloudflare-pages deployment fails #1346

Closed
issue-up bot opened this issue Jun 25, 2023 · 1 comment · Fixed by #1360
Closed

Nuxt cloudflare-pages deployment fails #1346

issue-up bot opened this issue Jun 25, 2023 · 1 comment · Fixed by #1360

Comments

@issue-up
Copy link

issue-up bot commented Jun 25, 2023

   Forwarded from downstream issue:


Environment

  • Operating System: Darwin
  • Node Version: v18.16.1
  • Nuxt Version: 3.6.0
  • Nitro Version: 2.5.1
  • Package Manager: npm@9.5.1
  • Builder: vite
  • User Config: devtools, modules, apollo
  • Runtime Modules: @nuxtjs/apollo@5.0.0-alpha.6
  • Build Modules: -

Reproduction

https://github.com/floatingpixels/nuxt-apollo.git

Describe the bug

I'm trying to deploy a Nuxt app to cloudflare pages. The app builds and runs fine locally, but the deployment to cloudflare pages fails. I'm using the Nuxt Apollo module, but I think the error might not be specific to the module, but has something to do with how Nuxt deploys on Cloudflare Pages. When deploying to Cloudflare pages I get the following error:

20:41:08.091 | [success] Server built in 1589ms
-- | --
20:41:08.108 | [success] [nitro] Generated public dist
20:41:08.168 | [info] [nitro] Building Nitro Server (preset: `cloudflare-pages`)
20:41:12.418 | (inject plugin) rollup-plugin-inject: failed to parse /opt/buildhome/repo/node_modules/graphql/jsutils/instanceOf.mjs. Consider restricting the plugin to particular files via options.include
20:41:12.421 | [error] [nitro] RollupError: Unexpected token (Note that you need plugins to import files that are not JavaScript)
20:41:12.422 |  
20:41:12.422 |  
20:41:12.422 | 10:   /* c8 ignore next 6 */
20:41:12.422 | 11:   // FIXME: https://github.com/graphql/graphql-js/issues/2317
20:41:12.423 | 12:   globalThis.process && globalThis.process.env.NODE_ENV === 'production'
20:41:12.423 | ^
20:41:12.423 | 13:     ? function instanceOf(value, constructor) {
20:41:12.423 | 14:         return value instanceof constructor;
20:41:12.424 | [error] Unexpected token (Note that you need plugins to import files that are not JavaScript)
20:41:12.425 | at error (node_modules/rollup/dist/es/shared/node-entry.js:2245:30)
20:41:12.425 | at Module.error (node_modules/rollup/dist/es/shared/node-entry.js:13572:16)
20:41:12.425 | at Module.tryParse (node_modules/rollup/dist/es/shared/node-entry.js:14298:25)
20:41:12.425 | at Module.setSource (node_modules/rollup/dist/es/shared/node-entry.js:13899:39)
20:41:12.425 | at ModuleLoader.addModuleSource (node_modules/rollup/dist/es/shared/node-entry.js:24422:20)
20:41:12.472 | Failed: Error while executing user command. Exited with error code: 1
20:41:12.482 | Failed: build command exited with code: 1
20:41:13.591 | Failed: error occurred while running build command

This implies the build works fine, but rollup-plugin-inject fails to parse the graphql module. I'm not sure how to solve this, I searched through issues here in nuxt, and also over at nuxt apollo, but I don't know how to go about fixing this. Any help would be appreciated!

Additional context

No response

Logs

No response

@Aietes
Copy link

Aietes commented Jun 29, 2023

There are multiple issues in graphql/graphql-js related to this graphql/graphql-js#3928, but it seems there is a fix lined up in this PR graphql/graphql-js#3927. I guess the next release of graphql-js will fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant