Skip to content

UnhandledSchemeError when bundling with Next.js / Webpack because of node:* imports #392

@kang8

Description

@kang8

When I import jira.js in a Next.js project, the production build fails with the following error:

Module build failed: UnhandledSchemeError: Reading from "node:stream" is not handled by plugins (Unhandled scheme)

The import trace shows the source is inside jira.js:

node:stream
…/node_modules/jira.js/dist/esm/version2/issueAttachments.mjs
…/node_modules/jira.js/dist/esm/version2/index.mjs
…/node_modules/jira.js/dist/esm/index.mjs

This happens because the package’s ESM build uses the Node.js node: URL scheme (e.g. import { Readable } from 'node:stream').

Webpack (used by Next.js) does not yet resolve this scheme by default, so any build that runs through Webpack / SWC errors out.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions