react-bootstrap-table2-toolkit Import Error in Webpack 5
See original GitHub issueBug report
What is the current behavior?
react-bootstrap-table2-toolkit
package causes error when bundled using webpack 5 (5.10.1
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)
If the current behavior is a bug, please provide the steps to reproduce.
- Clone this sample repository. It’s a minimal react project that uses webpack 5.
- Checkout
master
branch - Start the app using
npm start
and look for the error in console. - Changes made in this commit are causing the error
What is the expected behavior? We should be able to import the ‘react-bootstrap-table2-toolkit’ package without any error.
Other relevant information: webpack version: 5.10.1 Node.js version: 12.16.2 Operating System: Windows Additional tools: None
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
react-bootstrap-table-toolkit Search Import Error - Stack Overflow
import ToolkitProvider, {Search} from 'react-bootstrap-table2-toolkit'; const {SearchBar} = Search;. where search can not be found from this ...
Read more >ModuleFederationPlugin - webpack
Throws a runtime error if the required version is not found. ... will throw an error when the shared vue is < 2.6.5...
Read more >react-bootstrap-table2-toolkit - npm
The toolkit for react-bootstrap-table2. Latest version: 2.1.3, last published: 3 years ago. Start using react-bootstrap-table2-toolkit in ...
Read more >react-bootstrap-table - Bountysource
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 >Webpack 5 Issues | Documentation - Web3Auth
js packages have certain dependencies, which are not present within the browser environment by webpack 5. Hence, you require certain node polyfills to...
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
At the moment I am using the package by directly importing the UMD module provided in their
dist
directory.Here is a fix: https://github.com/react-bootstrap-table/react-bootstrap-table2/pull/1506