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

extended-validation: Published bundle includes code bundled from graphql #241

Closed
n1ru4l opened this issue Jun 2, 2021 · 1 comment
Closed
Labels
kind/bug Something isn't working

Comments

@n1ru4l
Copy link
Owner

n1ru4l commented Jun 2, 2021

See https://unpkg.com/browse/@envelop/[email protected]/index.cjs.js

This took me a while to realize and debug, it seems like bob/rollup embeds the code from graphql within the bundle. It could be because of the deep import here: https://github.com/dotansimha/envelop/blob/fd76b26671254784e81e647fc4889326647d786f/packages/plugins/extended-validation/src/rules/one-of.ts#L2

stevenbenisek/rollup-plugin-auto-external#16 - so this is an issue with bob.

This causes the classic realm issue

GraphQL Server listening on port 4000.
Error: Cannot use GraphQLScalarType "Boolean" 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 instanceOf (C:\Users\lauri\Projects\graphql-bleeding-edge-playground\node_modules\@envelop\extended-validation\index.cjs.js:1552:13)
    at isScalarType (C:\Users\lauri\Projects\graphql-bleeding-edge-playground\node_modules\@envelop\extended-validation\index.cjs.js:1867:10)
    at isLeafType (C:\Users\lauri\Projects\graphql-bleeding-edge-playground\node_modules\@envelop\extended-validation\index.cjs.js:1902:10)
    at valueFromAST (C:\Users\lauri\Projects\graphql-bleeding-edge-playground\node_modules\@envelop\extended-validation\index.cjs.js:2906:7)
    at getArgumentValues (C:\Users\lauri\Projects\graphql-bleeding-edge-playground\node_modules\@envelop\extended-validation\index.cjs.js:2995:24)
    at Object.Field (C:\Users\lauri\Projects\graphql-bleeding-edge-playground\node_modules\@envelop\extended-validation\index.cjs.js:3026:32)
    at Object.enter (C:\Users\lauri\Projects\graphql-bleeding-edge-playground\node_modules\graphql\language\visitor.js:323:29)
    at Object.enter (C:\Users\lauri\Projects\graphql-bleeding-edge-playground\node_modules\graphql\utilities\TypeInfo.js:370:25)
    at Object.visit (C:\Users\lauri\Projects\graphql-bleeding-edge-playground\node_modules\graphql\language\visitor.js:243:26)
    at onExecute (C:\Users\lauri\Projects\graphql-bleeding-edge-playground\node_modules\@envelop\extended-validation\index.cjs.js:20:21)
(node:6200) UnhandledPromiseRejectionWarning: RangeError: The message must not be 
greater than 123 bytes
    at Sender.close (C:\Users\lauri\Projects\graphql-bleeding-edge-playground\node_modules\ws\lib\sender.js:120:15)
    at WebSocket.close (C:\Users\lauri\Projects\graphql-bleeding-edge-playground\node_modules\ws\lib\websocket.js:233:18)
    at WebSocket.<anonymous> (C:\Users\lauri\Projects\graphql-bleeding-edge-playground\node_modules\graphql-ws\lib\use\ws.js:72:28)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:6200) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). 
(rejection id: 2)
(node:6200) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
@n1ru4l n1ru4l added the kind/bug Something isn't working label Jun 2, 2021
@n1ru4l
Copy link
Owner Author

n1ru4l commented Jun 3, 2021

Closed via #244

@n1ru4l n1ru4l closed this as completed Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant