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

Typo in importing process in multiple files in lib/internal/streams #526

Open
ankitzm opened this issue Sep 21, 2023 · 3 comments
Open

Typo in importing process in multiple files in lib/internal/streams #526

ankitzm opened this issue Sep 21, 2023 · 3 comments

Comments

@ankitzm
Copy link

ankitzm commented Sep 21, 2023

I was building an app where I imported @toruslabs/base-controllers. The @toruslabs/base-controllers have readable-stream as a dev-dependency as listed in the package.json file.
image

My node version: v18.14.1

Problem

When I ran my code, it threw the below error. Clearly, the error was because it couldn't find any process/ module as there is no such thing.
image

The error was fixed when I changed all the process/ to process. As I was checking through the readable-stream repository, I found multiple typos in the process module in the repo. This might be breaking a lot of apps and I think this can be easily fixed with a single PR.

Solution

The typo needs to be fixed in these files 👇
image

I would love to work on the issue, let me know if I missed something.
Thank You

@rluvaton
Copy link
Member

looking at the history it looks like this was intended:

@vweevers
Copy link
Contributor

It's an old trick to tell Node.js (and bundlers that follow the same require() algorithm) to load an npm package instead of a core module.

Might be an issue with Vite specifically. We don't directly test Vite (in dev mode) but we do test Rollup here (which is what Vite uses in production mode):

case 'rollup':
await run('rollup -c test/browser/fixtures/rollup.browser.config.mjs')
await run('rollup -c test/browser/fixtures/rollup.node.config.mjs')
break

@ankitzm
Copy link
Author

ankitzm commented Sep 22, 2023

Ohh, thanks for reviewing @rluvaton and @vweevers.
Will try it using vite in production mode and update here. Thanks.

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

3 participants