Skip to content

Conversation

@rschristian
Copy link
Member

@rschristian rschristian commented Feb 12, 2025

We've had this noisy warning since we landed pipeable streams in RTS:

Error: R] Could not resolve "node:stream"

    node_modules/preact-render-to-string/dist/stream-node.module.js:1:28:
      1 │ import { PassThrough } from 'node:stream';
        ╵                             ~~~~~~~~~~~~~

  The package "node:stream" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.

Our tests don't actually use the package.json for module resolution, so preact/compat/server is assumed to be preact/compat/server.js, rather resolving to preact/compat/server.browser.js which removes the Node-only pipeable stream stuff. Explicitly referencing it here seems fine for the moment, it's the only place we test it and we're very explicitly in a browser test.

@rschristian rschristian merged commit 8a65010 into main Feb 12, 2025
6 checks passed
@rschristian rschristian deleted the test/node-stream-warning branch February 12, 2025 11:35
@coveralls
Copy link

Coverage Status

coverage: 99.618%. first build
when pulling 17fd092 on test/node-stream-warning
into 2e85690 on main.

@JoviDeCroock JoviDeCroock mentioned this pull request Feb 16, 2025
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

Successfully merging this pull request may close these issues.

4 participants