question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Bug 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.

  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

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:closed
  • Created 3 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

10reactions
enosisbd-anontacommented, Dec 14, 2020

At the moment I am using the package by directly importing the UMD module provided in their dist directory.

import ToolkitProvider, { Search } from 'react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit';
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found