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

SourceLocation exported incorrect and breaks rollup in npm package #1210

Closed
gaberudy opened this issue Jan 26, 2018 · 3 comments
Closed

SourceLocation exported incorrect and breaks rollup in npm package #1210

gaberudy opened this issue Jan 26, 2018 · 3 comments

Comments

@gaberudy
Copy link

I use rollup with the commonjs plugin to pull in node_modules with tree-shaking.

I get the following error with graphql 0.12.3 (but do not with 0.11.3)
image

Error here for search indexing:

[!] Error: 'SourceLocation' is not exported by node_modules\graphql\module\language\index.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
node_modules\graphql\module\index.js (64:17)
62:
63: // Parse and operate on GraphQL language source files.
64: export { Source, SourceLocation, getLocation,
                     ^
65: // Parse
66: parse, parseValue, parseType,

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

SourceLocation is a TypeScript type and is not defined (nor should be) in this JS module and thus can not be exported.

If I manually edit node_modules\graphql\module\index.js:64 to remove the SourceLocation from the export list, my rollup bundle completes.

I believe this is a recently introduced bug, and doesn't affect users who are not using this type of tree-shaking rollup usage since SourceLocation will be undefined and not used by anybody, but it would be nice to be able to update my config to 0.12.x

@leebyron
Copy link
Contributor

Thanks for the report

@ZauberNerd
Copy link

@leebyron would it be possible to cherry-pick this fix on the 0.12 branch?

@scamden
Copy link

scamden commented May 12, 2021

@leebyron pleeeeaz cherry pick

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

4 participants