Skip to content

Export clean ESM modules #1819

Closed
Closed
@sebdeckers

Description

@sebdeckers

Using [email protected]

/node_modules/graphql/jsutils/instanceOf.mjs line 16

// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production
// See: https://webpack.js.org/guides/production/
export default process.env.NODE_ENV === 'production' ? // eslint-disable-next-line no-shadow
Uncaught ReferenceError: process is not defined
    at instanceOf.mjs:16

The check process.env.NODE_ENV === 'production' breaks in the browser when using ESM version of graphql package. Is it possible to remove before publishing to NPM? Without it the ESM files work perfectly.

I am not using Webpack/RollUp/Babel. Simply copying the ESM files from node_modules to my frontend folder using unbundle.

Related but different:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions