Vite polyfills issue: Could not read from file: .../polyfills/process-es6

Please provide the following details too when asking for help in this category:

  • SDK Version: latest
  • Platform: MacOS

Please provide the Web3Auth initialization and login code snippet below:

I’ve installed a vite app and then added polyfills from here.
My app is publicly available: [github]/TrelisPay/micropayments-wallet.

The error is:

[ERROR] Could not read from file: /Users/ronanmcgovern/trelis/micropayments-wallet/rollup-plugin-node-polyfills/polyfills/process-es6

    node_modules/readable-stream/lib/internal/streams/end-of-stream.js:3:24:
      3 │ const process = require('process/')

I’ve separately cloned this test project and faced the following error during install:

The error I’m getting in this second case (which I believe is the same error):

[ERROR] Could not read from file: /Users/ronanmcgovern/trelis/react-vite-evm-modal-example/rollup-plugin-node-polyfills/polyfills/process-es6

    node_modules/@toruslabs/base-controllers/node_modules/readable-stream/lib/internal/streams/end-of-stream.js:3:24:
      3 │ const process = require('process/')
        ╵                         ~~~~~~~~~~

/Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/vite/node_modules/esbuild/lib/main.js:1604
  let error = new Error(`${text}${summary}`);
              ^

Error: Build failed with 1 error:
node_modules/@toruslabs/base-controllers/node_modules/readable-stream/lib/internal/streams/end-of-stream.js:3:24: ERROR: Could not read from file: /Users/ronanmcgovern/trelis/react-vite-evm-modal-example/rollup-plugin-node-polyfills/polyfills/process-es6
    at failureErrorWithLog (/Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/vite/node_modules/esbuild/lib/main.js:1604:15)
    at /Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/vite/node_modules/esbuild/lib/main.js:1056:28
    at runOnEndCallbacks (/Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/vite/node_modules/esbuild/lib/main.js:1476:61)
    at buildResponseToResult (/Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/vite/node_modules/esbuild/lib/main.js:1054:7)
    at /Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/vite/node_modules/esbuild/lib/main.js:1166:14
    at responseCallbacks.<computed> (/Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/vite/node_modules/esbuild/lib/main.js:701:9)
    at handleIncomingPacket (/Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/vite/node_modules/esbuild/lib/main.js:756:9)
    at Socket.readFromStdout (/Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/vite/node_modules/esbuild/lib/main.js:677:7)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:315:12) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: {
        column: 24,
        file: 'node_modules/@toruslabs/base-controllers/node_modules/readable-stream/lib/internal/streams/end-of-stream.js',
        length: 10,
        line: 3,
        lineText: "const process = require('process/')",
        namespace: '',
        suggestion: ''
      },
      notes: [],
      pluginName: '',
      text: 'Could not read from file: /Users/ronanmcgovern/trelis/react-vite-evm-modal-example/rollup-plugin-node-polyfills/polyfills/process-es6'
    }
  ],
  warnings: []
}

and also, listed as Problems in Visual Studio:

Type 'import("/Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/esbuild/lib/main").Plugin' is not assignable to type 'import("/Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/vite/node_modules/esbuild/lib/main").Plugin'.
  Types of property 'setup' are incompatible.
    Type '(build: import("/Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/esbuild/lib/main").PluginBuild) => void | Promise<void>' is not assignable to type '(build: import("/Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/vite/node_modules/esbuild/lib/main").PluginBuild) => void | Promise<void>'.
      Types of parameters 'build' and 'build' are incompatible.
        Property 'onDispose' is missing in type 'import("/Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/vite/node_modules/esbuild/lib/main").PluginBuild' but required in type 'import("/Users/ronanmcgovern/trelis/react-vite-evm-modal-example/node_modules/esbuild/lib/main").PluginBuild'.
1 Like

Hey @RonanMcGovern, sorry for the delay but if you get a chance, look at our Vite polyfill issue troubleshooting guide here.