Skip to content

Clear errors/warnings when noEmit is enabled #702

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

Closed
chrisdrackett opened this issue Apr 23, 2020 · 5 comments · Fixed by #798
Closed

Clear errors/warnings when noEmit is enabled #702

chrisdrackett opened this issue Apr 23, 2020 · 5 comments · Fixed by #798
Labels
effort/easy scope/tsconfig Related to interop with tsconfig settings/files type/improve Something existing is made better, does not affect the interface (example: better error message)

Comments

@chrisdrackett
Copy link
Contributor

when I run build I get the following output:

$ nexus build
1872 ● nexus:plugin:nexus-plugin-prisma Running Prisma generators ...
2916 ● nexus:build Running typegen & extracting types from addToContext calls
 405 ✕ app uncaughtException
       | error  Error: Cannot find module './api/graphql/Admin'
       |        Require stack:
       |        - /Users/cwd/src/server/node_modules/.build/index.js
       |            at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
       |            at Function.Module._load (internal/modules/cjs/loader.js:690:27)
       |            at Module.require (internal/modules/cjs/loader.js:852:19)
       |            at require (internal/modules/cjs/helpers.js:74:18)
       |            at Object.<anonymous> (/Users/cwd/src/server/node_modules/.build/index.js:23:1)
       |            at Module._compile (internal/modules/cjs/loader.js:959:30)
       |            at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
       |            at Module.load (internal/modules/cjs/loader.js:815:32)
       |            at Function.Module._load (internal/modules/cjs/loader.js:727:14)
       |            at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
       |          code: 'MODULE_NOT_FOUND',
       |          requireStack: [ '/Users/cwd/src/server/node_modules/.build/index.js' ]
       |        }
 855 ✕ nexus:build failed to generate artifacts
       | error  Error: 
       |              Nexus artifact generation failed with exit code "1". The following stderr was captured:
       |        
       |                  null
       |            
       |            at Object.generateArtifacts (/Users/cwd/src/server/node_modules/nexus/src/lib/build/artifact-generation.ts:30:11)
       |            at Object.buildNexusApp (/Users/cwd/src/server/node_modules/nexus/src/lib/build/build.ts:85:5)
       |            at Build.parse (/Users/cwd/src/server/node_modules/nexus/src/cli/commands/build.ts:32:5)
error Command failed with exit code 1.

I'm in the process of figuring out how my project is different from the generated project. My current thoughts are something about my tsconfig or maybe this is a red herring or some other issue in my code. Regardless the dev server works without issues.

@chrisdrackett chrisdrackett added the type/bug Something is not working the way it should label Apr 23, 2020
@jasonkuhrt
Copy link
Member

Can you please re-run with LOG_LEVEL=trace and share your output?

@chrisdrackett
Copy link
Contributor Author

I figured this out, our tsconfig had a left over noEmit: true from before this was a nexus project. Taking that our fixes things right up!

@jasonkuhrt jasonkuhrt changed the title unable to build project Clear errors/warnings when noEmit is enabled Apr 23, 2020
@jasonkuhrt jasonkuhrt added scope/dev-mode type/improve Something existing is made better, does not affect the interface (example: better error message) scope/tsconfig Related to interop with tsconfig settings/files and removed type/bug Something is not working the way it should scope/builder scope/dev-mode labels Apr 23, 2020
@jasonkuhrt
Copy link
Member

@chrisdrackett But Nexus is acting very poorly here, changing this issue to be about giving better feedback to the user.

@jasonkuhrt
Copy link
Member

Either 1) Nexus should not support this field or 2) it should honour it gracefully.

  1. No support

    In this case Nexus should warn in dev and build with clear feedback that this setting should be removed because Nexus ignores it anyways.

  2. Support

    In dev mode there would be nothing to do.

    In build Nexus should halt if this setting is present, with a clear message about why it is halting. It might as well type check the app, though.

CC @Weakky thoughts?

@jasonkuhrt jasonkuhrt mentioned this issue Apr 27, 2020
14 tasks
@jasonkuhrt
Copy link
Member

It seems that noEmit being present will now block nexus build from running: graphql-nexus/nexus#648 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/easy scope/tsconfig Related to interop with tsconfig settings/files type/improve Something existing is made better, does not affect the interface (example: better error message)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants