Skip to content

Compile error with webpack 4 #1272

Closed
Closed
@moimael

Description

@moimael

Hi,

After updating to webpack 4, compiling graphiql doesn't work because of the graphql-js dependency.

I get a bunch of those errors:

ERROR in ./node_modules/graphql/index.mjs
2:0-49 Can't reexport the named export 'graphql' from non EcmaScript module (only default export is available)
 @ ./node_modules/graphql/index.mjs
 @ ./node_modules/graphiql/dist/components/GraphiQL.js
 @ ./node_modules/graphiql/dist/index.js
 @ ./src/client/apps/graphiql/graph-viewer/index.js
 @ ./src/client/apps/graphiql/app.js
 @ ./src/client/apps/graphiql/index.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server webpack-dev-server/client?http://localhost:8080 webpack/hot/only-dev-server ./src/client/apps/graphiql

ERROR in ./node_modules/graphql/index.mjs
2:0-49 Can't reexport the named export 'graphqlSync' from non EcmaScript module (only default export is available)
 @ ./node_modules/graphql/index.mjs
 @ ./node_modules/graphiql/dist/components/GraphiQL.js
 @ ./node_modules/graphiql/dist/index.js
 @ ./src/client/apps/graphiql/graph-viewer/index.js
 @ ./src/client/apps/graphiql/app.js
 @ ./src/client/apps/graphiql/index.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server webpack-dev-server/client?http://localhost:8080 webpack/hot/only-dev-server ./src/client/apps/graphiql

ERROR in ./node_modules/graphql/index.mjs
39:0-61:50 Can't reexport the named export 'DEFAULT_DEPRECATION_REASON' from non EcmaScript module (only default export is available)
 @ ./node_modules/graphql/index.mjs
 @ ./node_modules/graphiql/dist/components/GraphiQL.js
 @ ./node_modules/graphiql/dist/index.js
 @ ./src/client/apps/graphiql/graph-viewer/index.js
 @ ./src/client/apps/graphiql/app.js
 @ ./src/client/apps/graphiql/index.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server webpack-dev-server/client?http://localhost:8080 webpack/hot/only-dev-server ./src/client/apps/graphiql

ERROR in ./node_modules/graphql/index.mjs
39:0-61:50 Can't reexport the named export 'GraphQLBoolean' from non EcmaScript module (only default export is available)
 @ ./node_modules/graphql/index.mjs
 @ ./node_modules/graphiql/dist/components/GraphiQL.js
 @ ./node_modules/graphiql/dist/index.js
 @ ./src/client/apps/graphiql/graph-viewer/index.js
 @ ./src/client/apps/graphiql/app.js
 @ ./src/client/apps/graphiql/index.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server webpack-dev-server/client?http://localhost:8080 webpack/hot/only-dev-server ./src/client/apps/graphiql

ERROR in ./node_modules/graphql/index.mjs
39:0-61:50 Can't reexport the named export 'GraphQLDeprecatedDirective' from non EcmaScript module (only default export is available)
 @ ./node_modules/graphql/index.mjs
 @ ./node_modules/graphiql/dist/components/GraphiQL.js
 @ ./node_modules/graphiql/dist/index.js
 @ ./src/client/apps/graphiql/graph-viewer/index.js
 @ ./src/client/apps/graphiql/app.js
 @ ./src/client/apps/graphiql/index.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server webpack-dev-server/client?http://localhost:8080 webpack/hot/only-dev-server ./src/client/apps/graphiql

(and a million more)

Seems like forcing the downgrade to a graphql-js version that doesn't have .mjs files fixes the issue.

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