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

Importing Jsforce Library causing an error. Uncaught ReferenceError: process is not defined at Object../node_modules/readable-stream/lib/_stream_writable.js #1222

Closed
nirajshelke opened this issue Mar 1, 2022 · 3 comments

Comments

@nirajshelke
Copy link

Hello,

I am facing an issue Uncaught ReferenceError: process is not defined at Object../node_modules/readable-stream/lib/_stream_writable.js when I am importing jsforce in component. I have attached the Screenshot below

Screenshot from 2022-02-28 22-38-46

without import jsforce from 'jsforce' in code the web page was loading but when I added import jsforce from 'jsforce' jsforce library it started throwing this error in browser console and Web page was not loading the content. Kindly help me resolve this issue if anybody is aware of it's reason.

@ravnarayananpaypal
Copy link

Are you using webpack ?

@jaigupta10
Copy link

I think this issue started occurring with webpack 5. I was able to use JSForce successfully in my previous project but now its not working with the same issue.

This is the part of error I am getting:
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default.
This is no longer the case. Verify if you need this module and configure a polyfill for it.

and suggestion mentioned in below stackoverflow post was not helpful.

https://stackoverflow.com/questions/65894521/webpack-5-node-polyfill-instructions-dont-work

Any help would be appreciated.

@FeiPengDev FeiPengDev mentioned this issue Oct 16, 2023
9 tasks
@cristiand391
Copy link
Member

@FeiPengDev can you try setting these polyfills in your webpack config?:

resolve: {
fallback: {
"querystring": require.resolve("querystring-es3"),
"crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"),
"timers": require.resolve("timers-browserify"),
"util": require.resolve("util/"),

NOTE: those packages should be devDeps in your project.

that webpack config is from the 2.0 branch where we bumped webpack to v5.

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

4 participants