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

Nexus build silently fails in CI environment with empty error #1350

Open
drewdecarme opened this issue Aug 13, 2020 · 4 comments
Open

Nexus build silently fails in CI environment with empty error #1350

drewdecarme opened this issue Aug 13, 2020 · 4 comments
Labels
type/bug Something is not working the way it should

Comments

@drewdecarme
Copy link

Screenshot

Aug 13 12:04:38 AM  $ nexus build
Aug 13 12:04:39 AM  {"event":"get used plugins","level":3,"path":["nexus","build"]}
Aug 13 12:04:40 AM  {"event":"Running generators","level":3,"path":["nexus","plugin","nexusPluginPrisma"]}
Aug 13 12:04:42 AM  {"event":"starting reflection","level":3,"path":["nexus","build"]}
Aug 13 12:04:43 AM  {"event":"reflection failed","level":6,"path":["nexus"],"context":{"error":{}}}

Description

I'm having some issues building Nexus in a CI environment. Everything works really well locally and I'm not having any problems. I am however using a mono-repo structure and am not having any issues with it. I've added another entry to my typeRoots in my tsconfig.json which just navigates up 2 directories into the hoisted node_modules folder.

Here's the tsconfig:

{
"compilerOptions": {
    "target": "es2016",
    "module": "commonjs",
    "lib": ["esnext"],
    "rootDir": ".",
    "strict": true,
    "noEmit": true,
    "plugins": [{ "name": "nexus/typescript-language-service" }],
    "typeRoots": [
      "node_modules/@types",
      "types",
      "types.d.ts",
      "../../node_modules/@types"
    ]
  }
}

I've reverted to building it locally and unfortunately checked in my files, but I'd like to get it to build dynamically if at all possible in CI.

I'm going to go ahead and assume that it's something to do with the Lerna symlinking, but it's puzzling that it would work locally and not on CI... especially the reflection process.

Wondering if you could shed any light onto what the problem might be. Thanks!

Love the framework, it's a blast to use!

@drewdecarme drewdecarme added the type/bug Something is not working the way it should label Aug 13, 2020
@bkiac
Copy link

bkiac commented Aug 15, 2020

I don't use a monorepo but I have a similar problem in GitLab CI. Local build works fine.

$ yarn nexus report
{"event":"Failed to scan app for used plugins because there is a runtime error in the app","level":6,"path":["nexus"],"context":{"error":{}}}

$ yarn nexus build
{"event":"get used plugins","level":3,"path":["nexus","build"]}
{"event":"failed to get used plugins","level":6,"path":["nexus"],"context":{"error":{}}}

@bkiac
Copy link

bkiac commented Aug 15, 2020

Nevermind, I had a config validation error because of a missing environment variable. The error log was missing in the CI environment that's why it took me so long to figure it out. Build works as expected now.

@ff6347
Copy link

ff6347 commented Sep 17, 2020

I'm also running into this problem when building on github actions.

> nexus report

{"event":"Failed to scan app for used plugins because there is a runtime error in the app","level":6,"path":["nexus"],"context":{"error":{}}}

@bkiac How did you solve this?

@bkiac
Copy link

bkiac commented Sep 17, 2020

@fabianmoronzirfas
For me, the error was in my own application code. I forgot to include a required environment variable so my config validator threw an error.
You could try to pass LOG_LEVEL=trace LOG_PRETTY=true (or only LOG_LEVEL=trace if you don't care about the formatting) environment variables to your process/command so you have more detailed error logs of the crash.

$ LOG_LEVEL=trace LOG_PRETTY=true nexus report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something is not working the way it should
Projects
None yet
Development

No branches or pull requests

3 participants