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

Webpack 5 - TypeError: Super expression must either be null or a function #1270

Open
swisscat opened this issue Sep 24, 2022 · 1 comment
Open

Comments

@swisscat
Copy link

The issue can be reproduced with the following repository: https://github.com/swisscat/webpack-jsforce-test

  • npm install
  • npx webpack
  • Open dist/index.html in a browser to reproduce the issue

Notes:

  • Solved issues about querystring/buffer/process
  • Tried to use terser plugins without success
  • This is not related to React (See the repo's dependencies, and the src/index.js)

Webpack config:

const webpack = require('webpack');

module.exports = {
    mode: 'development',
    resolve: {
        fallback: {
            buffer: false,
            stream: false,
            util: false,
            querystring: false,
            timers: false,
        }
    },
    plugins: [
        new webpack.ProvidePlugin({
            Buffer: ['buffer', 'Buffer'],
            process: 'process/browser',
        }),
    ]
}

Regards,

@sashavmorozov
Copy link

I am creating an Excel plugin and trying to use jsforce (bundling with webpack), getting the same error. Was anyone successful resolving it?

index.js:43
Uncaught TypeError: Super expression must either be null or a function
at _inherits (index.js:43:107)
at index.js:92:1
at ./node_modules/csv-parse/lib/es5/index.js (index.js:1386:2)
at webpack_require (bootstrap:22:1)
at fn (hot module replacement:61:1)
at ./node_modules/jsforce/lib/csv.js (csv.js:4:16)
at webpack_require (bootstrap:22:1)
at fn (hot module replacement:61:1)
at ./node_modules/jsforce/lib/record-stream.js (record-stream.js:15:14)
at webpack_require (bootstrap:22:1)

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

2 participants