Bug: Mangling of Constants Causing Runtime Errors in GraphQL-based Packages with Turbopack #73383
Labels
bug
Issue was opened via the bug report template.
linear: turbopack
Confirmed issue that is tracked by the Turbopack team.
Turbopack
Related to Turbopack with Next.js.
Link to the code that reproduces this issue
0no-co/graphql.web#43
To Reproduce
gql.tada
).Kind
) are incorrectly referenced (e.g., ase
instead ofe1
).Current vs. Expected behavior
Current behavior: Some exported constants in
graphql.web
, such asKind
ase
, are incorrectly referenced during the bundling process in Turbopack, leading to references likee
instead of the intendede1
. This causes runtime errors because the application expects the correct constant name (e.g.,e1
forKind
), but Turbopack provides an incorrect reference.Expected behavior: The exported constants should be preserved with their correct names during bundling. For example,
Kind
should not be mangled toe
or any other incorrect name, and it should maintain its correct reference throughout the build and runtime.Example Code:
0no-co/graphql.web#43
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:02:45 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T8112 Available memory (MB): 16384 Available CPU cores: 8 Binaries: Node: 20.5.0 npm: 9.8.0 Yarn: N/A pnpm: 9.7.1 Relevant Packages: next: 15.0.3 // Latest available version is detected (15.0.3). react: 19.0.0-rc-66855b96-20241106 react-dom: 19.0.0-rc-66855b96-20241106 gql.tada: 1.8.10 graphql: 16.9.0 urql: 4.2.1 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Turbopack
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: