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

[Bug] Graphile export results in "Container is Falsy" error #16

Closed

Conversation

nckswt
Copy link

@nckswt nckswt commented Sep 5, 2024

Originally had tried to reproduce the error when exporting with modules, but we don't even need modules to show the error.

nick@thunderhead:~/code/prototyping/ouch-my-finger$ yarn run export
yarn run v1.22.22
$ ts-node tools/export-schema.ts
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.
Exporting a GraphQL schema from the database at main...
/home/nick/code/prototyping/ouch-my-finger/node_modules/@babel/traverse/src/path/replacement.ts:210
    throw new ReferenceError("Container is falsy");
          ^
ReferenceError: Container is falsy
    at NodePath.call (/home/nick/code/prototyping/ouch-my-finger/node_modules/@babel/traverse/src/path/replacement.ts:210:11)
    at NodePath.call [as _remove] (/home/nick/code/prototyping/ouch-my-finger/node_modules/@babel/traverse/src/path/removal.ts:49:18)
    at NodePath.remove (/home/nick/code/prototyping/ouch-my-finger/node_modules/@babel/traverse/src/path/removal.ts:27:11)
    at call (/home/nick/code/prototyping/ouch-my-finger/node_modules/graphile-export/src/optimize/index.ts:238:24)
    at NodePath.call [as _call] (/home/nick/code/prototyping/ouch-my-finger/node_modules/@babel/traverse/src/path/context.ts:36:20)
    at NodePath.call (/home/nick/code/prototyping/ouch-my-finger/node_modules/@babel/traverse/src/path/context.ts:21:18)
    at NodePath.visit (/home/nick/code/prototyping/ouch-my-finger/node_modules/@babel/traverse/src/path/context.ts:115:8)
    at TraversalContext.visitQueue (/home/nick/code/prototyping/ouch-my-finger/node_modules/@babel/traverse/src/context.ts:148:16)
    at TraversalContext.visitSingle (/home/nick/code/prototyping/ouch-my-finger/node_modules/@babel/traverse/src/context.ts:109:19)
    at TraversalContext.visit (/home/nick/code/prototyping/ouch-my-finger/node_modules/@babel/traverse/src/context.ts:180:19)
    at traverseNode (/home/nick/code/prototyping/ouch-my-finger/node_modules/@babel/traverse/src/traverse-node.ts:40:17)
    at traverse (/home/nick/code/prototyping/ouch-my-finger/node_modules/@babel/traverse/src/index.ts:83:15)
    at optimize (/home/nick/code/prototyping/ouch-my-finger/node_modules/graphile-export/src/optimize/index.ts:45:11)
    at exportFile (/home/nick/code/prototyping/ouch-my-finger/node_modules/graphile-export/src/exportSchema.ts:1957:32)
    at exportSchemaAsString (/home/nick/code/prototyping/ouch-my-finger/node_modules/graphile-export/src/exportSchema.ts:1951:10)
    at exportSchema (/home/nick/code/prototyping/ouch-my-finger/node_modules/graphile-export/src/exportSchema.ts:2075:26)
    at main (/home/nick/code/prototyping/ouch-my-finger/tools/export-schema.ts:17:21)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /home/nick/code/prototyping/ouch-my-finger/tools/export-schema.ts:30:3
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@nckswt
Copy link
Author

nckswt commented Sep 9, 2024

Noting that adding

  "resolutions": {
    "@babel/traverse": "7.25.2"
}

from this thread doesn't resolve the issue.

@nckswt
Copy link
Author

nckswt commented Sep 17, 2024

Just noting that I was able to solve the "Container is falsy" issue on export using

  "resolutions": {
    "@babel/traverse": "7.24.7"
}

and can reproduce this issue using

  "resolutions": {
    "@babel/traverse": "7.24.8"
}

though I have zero idea what changed between these two versions of babel to cause the issue

@nckswt
Copy link
Author

nckswt commented Sep 18, 2024

@benjie I'm closing this, though not sure if you want to include the resolution upstream for others to not have to add this to their own code?

@benjie
Copy link
Owner

benjie commented Sep 18, 2024

Fixed in graphile/crystal#2175

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

Successfully merging this pull request may close these issues.

2 participants