react-bootstrap-table2-toolkit Import Error in Webpack 5
See original GitHub issueDescribe the Bug
react-bootstrap-table2-toolkit package causes error when bundled using webpack 5 (5.3.2 to be exact). Simply adding import { Search } from 'react-bootstrap-table2-toolkit'; to any js file produces the following error.
SearchBar.js:9 Uncaught ReferenceError: arguments is not defined
at eval (SearchBar.js:9)
at Object../node_modules/react-bootstrap-table2-toolkit/lib/src/search/SearchBar.js (bundle.js:459)
at __webpack_require__ (bundle.js:1141)
at fn (bundle.js:1335)
at eval (index.js:7)
at Object../node_modules/react-bootstrap-table2-toolkit/lib/src/search/index.js (bundle.js:507)
at __webpack_require__ (bundle.js:1141)
at fn (bundle.js:1335)
at eval (index.js:8)
at Object../node_modules/react-bootstrap-table2-toolkit/lib/index.js (bundle.js:313)
The package works fine when bundled using webpack 4.
To Reproduce Steps to reproduce the behavior:
- Clone this sample repository. It’s a minimal react project that uses webpack 5.
- Checkout
masterbranch - Start the app using
npm startand look for the error in console. - Changes made in this commit are causing the error
Screenshots
The app fails to start because it gets an error while importing from react-bootstrap-table2-toolkit package.

Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
react-bootstrap-table2-toolkit Import Error in Webpack 5
react-bootstrap-table2-toolkit package causes error when bundled using webpack 5 ( 5.10.1 to be exact). Simply adding import { Search } from ...
Read more >javascript - react-bootstrap-table-toolkit Search Import Error
Here is an easy fix, I resolved this issue by changing the import. from import ToolkitProvider, {Search} from ...
Read more >ModuleFederationPlugin
The ModuleFederationPlugin allows a build to provide or consume modules with other independent builds at runtime. const { ModuleFederationPlugin } ...
Read more >react-bootstrap-table2-toolkit
Start using react-bootstrap-table2-toolkit in your project by running `npm i react-bootstrap-table2-toolkit`. There are 57 other projects in ...
Read more >react-bootstrap-table
react-bootstrap-table2-toolkit package causes error when bundled using webpack 5 ( 5.3.2 to be exact). Simply adding import { Search } from ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

With
patch-package, this should do the same as the above-mentionned PR: (oh and remember to bust webpack’s cache!)patches/react-bootstrap-table2-toolkit+2.1.3.patch@Avasam thx, confirmed! Just applied it and works like a charm.