Skip to content

Nuxt - Postgraphile GraphQL Route Removed During Build Process #2310

Open
@aramis-matos

Description

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      🌳 Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions