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 - Postgraphile GraphQL Route Removed During Build Process #2310

Open
aramis-matos opened this issue Jan 13, 2025 · 0 comments
Open

Nuxt - Postgraphile GraphQL Route Removed During Build Process #2310

aramis-matos opened this issue Jan 13, 2025 · 0 comments

Comments

@aramis-matos
Copy link

Summary

I'm building an application with Nuxt.js (with compatibilityVersion: 4) running "postgraphile": "^5.0.0-beta.37" which is installed as a regular, non-dev dependency. The application runs as expected in development mode but when building with nuxt build on the node-server preset, the server routes for the graphql server and ruru become inaccessible.

Steps to reproduce

  1. Create a postgraphile instance as described in grafserv documentation
  2. In graphile.config.ts, set the grafserv.graphqlPath key to /api/graphql

Expected results

Graphql and Ruru routes are accessible after building

Actual results

  • They are not
  • Server errors out with the following message [nuxt] [request error] [unhandled] [500] ENOENT: no such file or directory, '.output/server/node_modules/ruru/bundle/ruru.min.js'

Additional context

  • Other api routes are preserved during the build step
  • Ruru is present is the node_modules of the .output folders but not the specified bundle.min.js file
  • When navigating to /api/graphql, the console outputs
    The GRAPHILE_ENV environmental variable is not set; Grafast will run in production mode. In your development environments, it's recommended that you set `GRAPHILE_ENV=development` to opt in to additional checks that will provide guidance and help you to catch issues in your code earlier, and other changes such as formatting to improve your development experience.

Possible Solution

Include the missing ruru.min,js file during production mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🌳 Triage
Development

No branches or pull requests

2 participants