Skip to content

react-bootstrap-table2-toolkit Import Error in Webpack 5 #1520

@enosisbd-anonta

Description

@enosisbd-anonta

Describe 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:

  1. Clone this sample repository. It's a minimal react project that uses webpack 5.
  2. Checkout master branch
  3. Start the app using npm start and look for the error in console.
  4. 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.
error-screenshot

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions