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

Petra: broken CLI build #5164

Open
kdembler opened this issue Jun 5, 2024 · 3 comments
Open

Petra: broken CLI build #5164

kdembler opened this issue Jun 5, 2024 · 3 comments
Assignees

Comments

@kdembler
Copy link
Member

kdembler commented Jun 5, 2024

$ graphql-codegen
/Users/kdembler/dev/joystream/monorepo/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/template/lib/index.js:53
      throw new Error("You must pass a scope and parentPath unless traversing a Program/File. " + `Instead of that you tried to traverse a ${parent.type} node without ` + "passing scope and parentPath.");
      ^

Error: You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a undefined node without passing scope and parentPath.
    at traverse (/Users/kdembler/dev/joystream/monorepo/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/template/lib/index.js:53:13)
    at Object.<anonymous> (/Users/kdembler/dev/joystream/monorepo/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/helper-function-name/lib/index.js:20:68)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/Users/kdembler/dev/joystream/monorepo/node_modules/@graphql-tools/graphql-tag-pluck/node_modules/@babel/traverse/lib/path/conversion.js:14:50)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)

After this PR: #5157

@ignazio-bovo
Copy link
Contributor

This is probably due to some babel dependency errors inside the graphql tools I have opened an issue on their repo: ardatan/graphql-tools#6252
The error is fixed on the babel release.
It now start to appear on the master branch which is very strange

@ignazio-bovo
Copy link
Contributor

One solution to this is to apparently run the following sequence:

rm -fr node_modules/
rm -fr query-node/node_modules/
rm -fr query-node/codegen/node_modules/
yarn build:packages

@mnaamani
Copy link
Member

That is the solution I always use when this issue pops up. Generally it happens when I'm switching branches often where there might be different graphql dependencies.

If you look at the query-node build script:
https://github.com/Joystream/joystream/blob/master/query-node/build.sh
You will observe codegen dependencies are treated a bit differently and we do some weird build steps to keep the main workspace dependencies different than codegen dependencies. This was necessary in the past, maybe not so much now that we have both using relatively the same versions..

Perhaps we can look into it in more detail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants