Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RollupError: "Writable" is not exported by "node:stream", imported by "src/foo.ts". #1095

Open
moltar opened this issue Mar 11, 2024 · 0 comments

Comments

@moltar
Copy link

moltar commented Mar 11, 2024

A really strange error...

src/foo.ts imports from Node internal:

import type { Writable } from 'node:stream'

tsup config:

{
  "clean": true,
  "sourcemap": true,
  "watch": false,
  "silent": true,
  "entry": [
    "src/index.ts"
  ],
  "dts": {
    "resolve": true
  },
  "tsconfig": "tsconfig.build.json",
  "outDir": "lib",
  "format": [
    "cjs",
    "esm"
  ],
  "shims": true,
  "target": "node18.19.1"
}

Marking the node:stream package as external fixes the problem.

  "external": [
    "node:stream"
  ],

Am I doing something wrong?

I have never had to add externals to the list in any other packages before.

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant