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

since facing "ENOENT: no such file or directory, open 'node:stream'" issue #1260

Open
nehaAgarwalext opened this issue Sep 12, 2024 · 5 comments

Comments

@nehaAgarwalext
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/parse5-parser-stream/dist/cjs/index.js b/node_modules/parse5-parser-stream/dist/cjs/index.js
index a5002be..4e9a5fd 100644
--- a/node_modules/parse5-parser-stream/dist/cjs/index.js
+++ b/node_modules/parse5-parser-stream/dist/cjs/index.js
@@ -1,7 +1,7 @@
 "use strict";
 Object.defineProperty(exports, "__esModule", { value: true });
 exports.ParserStream = void 0;
-const node_stream_1 = require("node:stream");
+const { Readable } = require('stream');
 const parse5_1 = require("parse5");
 /* eslint-disable unicorn/consistent-function-scoping -- The rule seems to be broken here. */
 /**

This issue body was partially generated by patch-package.

@chinna2580
Copy link

chinna2580 commented Sep 26, 2024

I am also facing the same issue with my next app, how can i resolve this issue? @nehaAgarwalext @inikulin

Unable to patch the package

@soswow
Copy link

soswow commented Sep 27, 2024

Same here. Seems like cheerio got released from RC to final version 1.0.0 which is a dependency of enzyme (at least as of version 3.11.0 (which many of us has) and after some yarn.lock updating now I get the same thing. So random.

@soswow
Copy link

soswow commented Sep 27, 2024

My solution was to define forced resolution:

"resolutions": {
    "cheerio@npm:^1.0.0-rc.3": "1.0.0-rc.12"
  },

which fixed the problem for now

@43081j
Copy link
Collaborator

43081j commented Sep 27, 2024

can someone please provide a reproduction?

the suggested patch isn't going to fly and doesn't tell us much. some way of recreating the error would be incredibly helpful

@wooorm
Copy link
Collaborator

wooorm commented Sep 27, 2024

My guess is that people are on old webpack. I don’t know from the top of my head but I think it’s webpack 4 or such that doesn’t support node: prefixes.

@soswow What are you using? Enzyme hasn’t been published in 5 years apparently. Are you on very old things?

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

5 participants