Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

1.1.0 not working on Node ESM #100

Copy link
Copy link
Closed
@dburles

Description

@dburles
Issue body actions

The problem is that graphqljs doesn't publish "real" ESM, (they're using the "module" field). So a Node ESM project will resolve to the CJS version of the files when importing exports via "graphql", eg import { GraphQLObjectType } from "graphql". This package however deep imports ESM from graphqljs. Instead it should not deep import so shared dependencies resolve correctly.

The error is:

Error: Cannot use GraphQLObjectType "__Type" 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.