Skip to content

test: Silence Karma warning over node:stream from RTS #4660

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

Merged
merged 1 commit into from
Feb 12, 2025

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.

3 participants