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 support #15

Closed
MichaelKheel opened this issue Oct 20, 2020 · 7 comments
Closed

webpack 5 support #15

MichaelKheel opened this issue Oct 20, 2020 · 7 comments

Comments

@MichaelKheel
Copy link

Uncaught TypeError: Cannot read property 'from' of undefined
    at Object../node_modules/safe-buffer/index.js (vendors-node_modules_material-ui_core_esm_AccordionActions_AccordionActions_js-node_modules_m-7f4be2.bundle.c32bd5c11202ab09130f.js:6636)
    at __webpack_require__ (main.bundle.4c76a7a41632c92b7450.js:5640)
    at Object../node_modules/string_decoder/lib/string_decoder.js (vendors-node_modules_material-ui_core_esm_AccordionActions_AccordionActions_js-node_modules_m-7f4be2.bundle.c32bd5c11202ab09130f.js:6728)
    at __webpack_require__ (main.bundle.4c76a7a41632c92b7450.js:5640)
    at Module../node_modules/react-xml-viewer/dist/index.es.js (vendors-node_modules_material-ui_core_esm_AccordionActions_AccordionActions_js-node_modules_m-7f4be2.bundle.c32bd5c11202ab09130f.js:3936)
    at __webpack_require__ (main.bundle.4c76a7a41632c92b7450.js:5640)
    at Module../src/pages/city/bankiru.jsx (src_pages_city_index_jsx.bundle.53f25c372706c22991e4.js:243)
    at __webpack_require__ (main.bundle.4c76a7a41632c92b7450.js:5640)
    at Module../src/pages/city/index.jsx (src_pages_city_index_jsx.bundle.53f25c372706c22991e4.js:1046)
    at Function.__webpack_require__ (main.bundle.4c76a7a41632c92b7450.js:5640)
@jas-per
Copy link

jas-per commented Mar 13, 2021

webpack5 doesn't include polyfills for node core modules anymore. works fine if you add:

"buffer": "^6.0.3",
"stream-browserify": "^3.0.0",

in package.json / devDependencies

and

resolve: {
    fallback: {
      'stream': require.resolve('stream-browserify'),
      'buffer': require.resolve('buffer/')
    }
  }

in webpack.conf

@shijianchun
Copy link

only add "stream" and "buffer" can also work in package.json

"stream": "0.0.2",
"buffer": "^6.0.3",

@sepulzera
Copy link

only add "stream" and "buffer" can also work in package.json

"stream": "0.0.2",
"buffer": "^6.0.3",

Confirmed for my CRA with react-scripts 5.0.0. No webpack.conf changes needed.

@GimpMaster
Copy link

I had the same problem of this with Vite, but even after adding stream / buffer but then it failed with emitter, then I added npm emitter, now it fails with SA.

I don't think this package works well with Vite.

@barbalex
Copy link

barbalex commented Nov 24, 2022

@GimpMaster
It worked for me though, also using vite: vitejs/vite#10664

@alissonmbr
Copy link
Owner

Version 2.0.0-beta.4 published. Version 2.0.0 comming soon

@alissonmbr
Copy link
Owner

Version 2.0.0 release fixing the compatibility with webpack 5

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

7 participants