Skip to content

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

Closed

Description

@nirajshelke

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.

Activity

  1. ravnarayananpaypal commented on Jul 28, 2022

    @ravnarayananpaypal

    Are you using webpack ?

  2. jaigupta10 commented on Aug 17, 2022

    @jaigupta10

    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.

  3. cristiand391 commented on Nov 7, 2023

    @cristiand391
    Contributor

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions