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

minifying aws-appsync breaks graphql #715

Open
jamesmillerburgess opened this issue Apr 8, 2022 · 0 comments
Open

minifying aws-appsync breaks graphql #715

jamesmillerburgess opened this issue Apr 8, 2022 · 0 comments
Labels

Comments

@jamesmillerburgess
Copy link

Note: If your issue/feature-request/question is regarding the AWS AppSync service, please log it in the
official AWS AppSync forum

Do you want to request a feature or report a bug?

Report a bug.

What is the current behavior?

Running any package that imports from aws-appsync through esbuild with the --minify flag puts it in an unrunnable state due to an error with the graphql package:

Error: Cannot use e "__Schema" from another module or realm.

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 cbe (C:\Users\James\Documents\GitHub\aws-appsync-minify\build\index.js:55:23803)
    at Io (C:\Users\James\Documents\GitHub\aws-appsync-minify\build\index.js:66:3518)
    at pA (C:\Users\James\Documents\GitHub\aws-appsync-minify\build\index.js:66:3314)
    at lF (C:\Users\James\Documents\GitHub\aws-appsync-minify\build\index.js:66:6209)
    at dF (C:\Users\James\Documents\GitHub\aws-appsync-minify\build\index.js:66:6242)
    at new Ro (C:\Users\James\Documents\GitHub\aws-appsync-minify\build\index.js:66:5897)
    at Ro (C:\Users\James\Documents\GitHub\aws-appsync-minify\build\index.js:66:5915)
    at C:\Users\James\Documents\GitHub\aws-appsync-minify\build\index.js:68:8959
    at C:\Users\James\Documents\GitHub\aws-appsync-minify\build\index.js:1:741
    at C:\Users\James\Documents\GitHub\aws-appsync-minify\build\index.js:68:14268

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Simplest reproduction is here: https://github.com/jamesmillerburgess/aws-appsync-minify

What is the expected behavior?

Since other libraries, like graphql-tag can be minimized without breaking graphql, my expectation is that aws-appsync will also work with minification.

Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?

NodeJs. I tried with much older versions of aws-appsync and they all had the same issue.

@iartemiev iartemiev added the p3 label Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants