graphql-framework-experiment icon indicating copy to clipboard operation
graphql-framework-experiment copied to clipboard

nexus:dev reflection failed

Open brielov opened this issue 5 years ago • 8 comments

I'm trying to integrate nexus with next.js using the guide and the example repo but when I try to run reflection on a separate terminal window, it throws the following error:

● nexus:dev running reflection
■ nexus:dev reflection failed
  | error  Error: 
  |                Runner failed with exit code "1".
  |              
  |            at ChildProcess.<anonymous> (/Users/brielov/Code/logistics/www/node_modules/nexus/src/lib/reflection/reflect.ts:128:18)
  |            at ChildProcess.emit (events.js:314:20)
  |            at ChildProcess.EventEmitter.emit (domain.js:486:12)
  |            at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)

brielov avatar Aug 25 '20 15:08 brielov

I've the same error and investigate deeper. There is a link with graphql.

[email protected]

image

but with graphql@14 we have this initial exit code 1 error

yovanoc avatar Sep 04 '20 08:09 yovanoc

It indicates something wrong with the TS building step. You have to go to your IDE and check for the error, I think I read somewhere, where you can have a LOG_LEVEL=trace when nexus dev to make it yield the actual error.

Albert-Gao avatar Sep 06 '20 22:09 Albert-Gao

There is not more infos than my previous screen

yovanoc avatar Sep 07 '20 06:09 yovanoc

Hey @yovanoc, Run npm list graphql or yarn list graphql too see if you have different versions of graphql installed. Also if you have graphql defined in your package.json, remove it and rerun npm i nexus.

williamluke4 avatar Sep 07 '20 12:09 williamluke4

image

What should I do? There is no graphql in my direct dependencies

yovanoc avatar Sep 07 '20 13:09 yovanoc

image

Here's my output. It seems that now nexus bundles apollo-server-express that has [email protected] and conflict with the version of the direct child of nexus.

seed-of-apricot avatar Sep 13 '20 05:09 seed-of-apricot

I've got the same error

Yarn list with args is deprecated so I used yarn why and npm list below

 ✗ yarn why graphql
yarn why v1.22.4
[1/4] 🤔  Why do we have the module "graphql"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
   - "nexus" depends on it
   - Hoisted from "nexus#graphql"
   - Hoisted from "nexus#apollo-server-express#apollo-server-core#@types#graphql-upload#graphql"
info Disk size without dependencies: "3.11MB"
info Disk size with unique dependencies: "3.21MB"
info Disk size with transitive dependencies: "3.21MB"
info Number of shared dependencies: 1
✨  Done in 0.69s.
npm list graphql
[email protected] /Users/pieter/Invisible/yggdrasil/services/vor
└─┬ [email protected]
  ├─┬ [email protected]
  │ └─┬ [email protected]
  │   └─┬ @types/[email protected]
  │     └── [email protected]  deduped
  └── [email protected] 

cyrus-za avatar Sep 16 '20 10:09 cyrus-za

Turns out that adding DEBUG=* in front will show you the underlying error. nexus reflection is hiding these. In my case it was some graphql object types that werent explicitly imported (I need to do this as I am using a workaround to get it running in a serverless funcion on vercel)

cyrus-za avatar Sep 16 '20 13:09 cyrus-za