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

readable-stream upgrade breaks build #310

Closed
rybesh opened this issue Nov 14, 2022 · 7 comments
Closed

readable-stream upgrade breaks build #310

rybesh opened this issue Nov 14, 2022 · 7 comments
Assignees

Comments

@rybesh
Copy link

rybesh commented Nov 14, 2022

The latest patch update to N3.js upgraded the readable-stream dependency to 4.0.0. Unfortunately that update to readable-stream seems to include breaking changes, so it probably shouldn't be done in a patch update. In my specific case, browserify no longer builds my project because readable-stream can't find the process object:

nodejs/readable-stream#496

@RubenVerborgh
Copy link
Member

@bergos Please advise. Version range?

@eltonfss
Copy link

eltonfss commented Nov 15, 2022

I'm getting the following error when building with n3 version 1.16.3

Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/<private_path>/process'
[0]     required by /<private_path>/node_modules/n3/node_modules/readable-stream/lib/internal/streams/pipeline.js
[0] Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/<private_path>/process'
[0]     required by /<private_path>/node_modules/n3/node_modules/readable-stream/lib/internal/streams/destroy.js
[0] Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/<private_path>/process'
[0]     required by /<private_path>/node_modules/n3/node_modules/readable-stream/lib/internal/streams/writable.js
[0] Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/<private_path>/process'
[0]     required by /<private_path>/node_modules/n3/node_modules/readable-stream/lib/internal/streams/end-of-stream.js
[0] Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/<private_path>/process'
[0]     required by /<private_path>/node_modules/n3/node_modules/readable-stream/lib/internal/streams/readable.js
[0] Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/<private_path>/process'
[0]     required by /<private_path>/node_modules/n3/node_modules/readable-stream/lib/internal/streams/duplexify.js
[0] Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat '/<private_path>/process'
[0]     required by /<private_path>/node_modules/n3/node_modules/readable-stream/lib/internal/streams/from.js

<private_path> is a placeholder to my local filesystem directory where the application is located
I'm using running the build on MacOS Ventura 13.0.1

Here is the snipped from my package-lock.json that contains the "n3" dependencies versions installed

 "n3": {
      "version": "1.16.3",
      "resolved": "https://registry.npmjs.org/n3/-/n3-1.16.3.tgz",
      "integrity": "sha512-9caLSZuMW1kdlPxEN4ka6E4E8a5QKoZ2emxpW+zHMofI+Bo92nJhN//wNub15S5T9I4c6saEqdGEu+YXJqMZVA==",
      "requires": {
        "queue-microtask": "^1.1.2",
        "readable-stream": "^4.0.0"
      },
      "dependencies": {
        "process": {
          "version": "0.11.10",
          "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
          "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A=="
        },
        "readable-stream": {
          "version": "4.2.0",
          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.2.0.tgz",
          "integrity": "sha512-gJrBHsaI3lgBoGMW/jHZsQ/o/TIWiu5ENCJG1BB7fuCKzpFM8GaS2UoBVt9NO+oI+3FcrBNbUkl3ilDe09aY4A==",
          "requires": {
            "abort-controller": "^3.0.0",
            "buffer": "^6.0.3",
            "events": "^3.3.0",
            "process": "^0.11.10"
          }
        }
      }
    },

@bergos
Copy link
Member

bergos commented Nov 15, 2022

This error is caused by a bug in browserify, as mentioned in the readable-stream PR. Create a process file in the root of your project with the same content as in the PR as a workaround.

Even better would be a fix in browserify. The issue is already open for two years. That's why I didn't spend time trying to fix it. But maybe it's worth bringing some attention to it. I just upvoted on the issue.

@rybesh
Copy link
Author

rybesh commented Nov 15, 2022

Looking at that thread, there does not seem to be consensus that this is a browserify bug. I'm not sure why readable-stream is not using the suggested fix.

At any rate, since the upgrade of readable-stream is a breaking change for N3.js + browserify users, perhaps it should be rolled back and instead included in a major version bump.

@rubensworks
Copy link
Member

I don't think the introduction of a (breaking) bug necessitates a major update.
A fix should be provided in either readable-stream or browserify.

@bergos
Copy link
Member

bergos commented Nov 15, 2022

I left a comment in the readable-stream issue. I will wait for feedback and create a PR if it's ok for the maintainers of the readable-stream package.

@bergos
Copy link
Member

bergos commented Jan 2, 2023

A new feature version of readable-stream was released, which includes the browserify fix. Reinstall the dependencies, and the problem should be solved.

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