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

module initialization error with uglify mangle=true #1227

Closed
BerndWessels opened this issue Feb 7, 2018 · 3 comments
Closed

module initialization error with uglify mangle=true #1227

BerndWessels opened this issue Feb 7, 2018 · 3 comments

Comments

@BerndWessels
Copy link

Using name mangling results in much smaller output which is highly desirable especially when running the graphql server in AWS Lambda to reduce cold start time.

But using uglify with mangle=true results in this error:

module initialization error: Error

Ensure that there is only one instance of "graphql" in the node_modules
directory. If different versions of "graphql" are the dependencies of other
relied on modules, use "resolutions" to ensure only one version is installed.

https://yarnpkg.com/en/docs/selective-version-resolutions

Duplicate "graphql" modules cannot be used at the same time since different
versions may have different capabilities and behavior. The data from one
version used in the function from another could produce confusing and
spurious results.
at n.a (/var/task/index.js:1:156141)
at f (/var/task/index.js:1:3835)
at d (/var/task/index.js:1:3756)
at _ (/var/task/index.js:1:4392)
at n.q (/var/task/index.js:1:2738)
at new o (/var/task/index.js:1:25040)
at o (/var/task/index.js:1:25008)
at Object.n.a.r (/var/task/index.js:1:36681)
at t (/var/task/index.js:1:447)
at Object.<anonymous> (/var/task/index.js:1:83640)
@leebyron
Copy link
Contributor

leebyron commented Feb 8, 2018

@BerndWessels can you share more information about what version of the library you're using? This issue was presumed fixed in the last release, but it would be great to get your confirmation of this.

@leebyron
Copy link
Contributor

Closing this issue, but feel free to reopen if you encounter the same issue in the most recent release

@psirenny
Copy link

I just want to point out to others who run into this error that the fix only applies when NODE_ENV=production. If you are mangling your code in other environments (such as staging) then it will still fail.

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