Skip to content

ESM release in 4.0.25 is cirrupted #734

@paztis

Description

@paztis

Describe the bug
4.0.24 was in CommonJS
4.0.25 is is ESM but internal imports are invalid

import { visit, BREAK } from 'graphql/language';
import { visitWithTypeInfo } from 'graphql/utilities';
import { validate } from 'graphql/validation';

produce webpack errors at packaging time

ERROR in ../../node_modules/graphql-to-openapi/dist/lib/GraphQLToOpenAPIConverter.js 2:0-48
Module not found: Error: Can't resolve 'graphql/language' in '/Users/jeromeh/Workspaces/core-lcep/digitalexp-lcep/node_modules/graphql-to-openapi/dist/lib'
Did you mean 'index.mjs'?
BREAKING CHANGE: The request 'graphql/language' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ../../node_modules/graphql-to-openapi/dist/index.js 1:0-80 3:18-43


ERROR in ../../node_modules/graphql-to-openapi/dist/lib/GraphQLToOpenAPIConverter.js 3:0-54
Module not found: Error: Can't resolve 'graphql/utilities' in '/Users/jeromeh/Workspaces/core-lcep/digitalexp-lcep/node_modules/graphql-to-openapi/dist/lib'
Did you mean 'index.mjs'?
BREAKING CHANGE: The request 'graphql/utilities' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ../../node_modules/graphql-to-openapi/dist/index.js 1:0-80 3:18-43


ERROR in ../../node_modules/graphql-to-openapi/dist/lib/GraphQLToOpenAPIConverter.js 4:0-46
Module not found: Error: Can't resolve 'graphql/validation' in '/Users/jeromeh/Workspaces/core-lcep/digitalexp-lcep/node_modules/graphql-to-openapi/dist/lib'
Did you mean 'index.mjs'?
BREAKING CHANGE: The request 'graphql/validation' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
 @ ../../node_modules/graphql-to-openapi/dist/index.js 1:0-80 3:18-43

This may be because of tsconfig.json file that is not specifying the target

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions