react-bootstrap-table2 icon indicating copy to clipboard operation
react-bootstrap-table2 copied to clipboard

remove handleDebounce incorrect arguments from arrow functions

Open justincorrigible opened this issue 5 years ago • 31 comments

Temporary workaround, for anyone who may come across this issue before this PR is merged:

use import ToolkitProvider from 'react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit.min'; instead.


Problem addressed: As seen in MDN's web docs, an arrow function...

"Does not have arguments, or new.target keywords."

leading to this error when trying to import the toolkit package.

image

Uncaught ReferenceError: arguments is not defined


Edit for housekeeping: closes #1520

justincorrigible avatar Nov 10 '20 02:11 justincorrigible

@AllenFang @Chun-MingChen For your consideration Thanks for a great set of packages. Time saving and very useful!

justincorrigible avatar Nov 10 '20 03:11 justincorrigible

I saw this issue upon attempting to upgrade to Webpack 5; thanks for the PR! Would love to see this merged and released to allow this package to work with newest version of Webpack

cjmaynar avatar Nov 13 '20 17:11 cjmaynar

Any chance for release?

Sharpek avatar Feb 22 '21 19:02 Sharpek

Hi @AllenFang and @chunming-c, could you please approve this PR and release a new version. I'm trying to upgrade webpack to v5 and this is the last thing which prevents me from that.

itsmepetrov avatar Mar 10 '21 14:03 itsmepetrov

What is the chance for a release?

janeksmielowski avatar Mar 12 '21 07:03 janeksmielowski

Hi folks!...Any news on this issue!? Cheers!

MarlonAEC avatar Mar 27 '21 14:03 MarlonAEC

Error is back Mix: Laravel Mix v6.0.13

juniorkibirige avatar Apr 02 '21 05:04 juniorkibirige

Using this inside vitejs for now

  // vite.config.ts
  const modulesFolder = path.resolve(__dirname, 'node_modules/');
  
  // ...

  resolve: {
    alias: {
      'react-bootstrap-table2-toolkit-css': `${modulesFolder}/react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit.min.css`,
      'react-bootstrap-table2-toolkit': `${modulesFolder}/react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit.js`,
      '@': srcFolder,
    },
  },

IlanFrumer avatar Apr 05 '21 16:04 IlanFrumer

PR is opened on Nov 10, And I see as time passes new developers getting same error like me. Don't you think to release?

erhanfirat avatar Jun 02 '21 13:06 erhanfirat

Hi, I have also encountered this problem. Any chance of this being merged soon?

mah51 avatar Jul 21 '21 13:07 mah51

Hi, I have also encountered this problem. Any chance of this being merged soon?

+1

afvieira avatar Aug 02 '21 00:08 afvieira

Hi, I have also encountered this problem. Any chance of this being merged soon?

+1

Jarvismkennedy avatar Sep 10 '21 17:09 Jarvismkennedy

+1

steveast avatar Oct 06 '21 11:10 steveast

I'm having this issue too

collynwalte avatar Oct 11 '21 19:10 collynwalte

Im having this issue can we get this MR reviewed and pushed please @AllenFang @itsmepetrov

The workaround in the MR description works, but we also needed to ignore some typescript pieces.. looking forward to updates

jeremy-london avatar Dec 21 '21 20:12 jeremy-london

Can we get to know the timeline for the merge and release for this? A lot of people (including me) are facing this issue. I tried the given workaround

use import ToolkitProvider from 'react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit.min'; instead.

But I'm still getting the same error. Please provide the resolution for this.

Anonymous3105 avatar Jan 04 '22 11:01 Anonymous3105

+1 on this issue

sheldonsebastian avatar Jan 19 '22 02:01 sheldonsebastian

+1

jamesbaker1 avatar Jan 19 '22 17:01 jamesbaker1

+1

xcarlosamm avatar Feb 25 '22 12:02 xcarlosamm

+1

regis-samurai avatar Mar 07 '22 15:03 regis-samurai

+1

RuDami avatar Mar 14 '22 13:03 RuDami

+1

wcordelo avatar Mar 15 '22 14:03 wcordelo

+1 +1 +1 +1 +1

duhmojo avatar Mar 15 '22 19:03 duhmojo

+1 I'm stuck here too. Used the link you gave but still same issue

DeDX3 avatar Mar 20 '22 17:03 DeDX3

+1

spookier avatar Mar 20 '22 21:03 spookier

FYI to all. The workaround by @IlanFrumer works for me. Added it to my resolve rebuilt and all is good again in the app.

Using this inside vitejs for now

  // vite.config.ts
  const modulesFolder = path.resolve(__dirname, 'node_modules/');
  
  // ...

  resolve: {
    alias: {
      'react-bootstrap-table2-toolkit-css': `${modulesFolder}/react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit.min.css`,
      'react-bootstrap-table2-toolkit': `${modulesFolder}/react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit.js`,
      '@': srcFolder,
    },
  },

There should still be a release or a statement that the project is inactive. With no activity in nearly 2 years, yet still 70K downloads weekly, this module is an example case of a disaster waiting to happen. If its inactive, just state it so people know what they're getting into.

duhmojo avatar Mar 21 '22 13:03 duhmojo

okay, i'm used comment by duhmojo, but adapted for use with react-app-rewired && react-scripts.

  1. yarn add react-app-rewired

  2. package.json:


"scripts": {
   "start": "react-app-rewired  start --scripts-version  react-scripts",
    "build": "react-app-rewired build --scripts-version  react-scripts"
}

  1. in project root create config-overrides.js with
module.exports = function override(config, env) {
  if (!config.resolve) {
    config.resolve ={
      alias: {
        "react/jsx-dev-runtime": "react/jsx-dev-runtime.js",
        "react/jsx-runtime": "react/jsx-runtime.js",
        'react-bootstrap-table2-toolkit-css': `react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit.min.css`,
        'react-bootstrap-table2-toolkit': `react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit.js`,
      }
    };
  }else {
    config.resolve = {
      ...config.resolve,
      alias: {
        ...config.resolve.alias,
        "react/jsx-dev-runtime": "react/jsx-dev-runtime.js",
        "react/jsx-runtime": "react/jsx-runtime.js",
        'react-bootstrap-table2-toolkit-css': `react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit.min.css`,
        'react-bootstrap-table2-toolkit': `react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit.js`,
      }
    }
  }

  return config;
}
  1. yarn start

  2. ???

  3. PROFIT

RuDami avatar Mar 21 '22 13:03 RuDami

This is preventing us from updating to react-scripts 5 due to the webpack 5 incompatibility. It seems like a small but critical patch. I'll echo what @duhmojo said. It sure looks like this project has been abandoned by its maintainers. If that's the case it would be great to know. Maybe someone would fork at that point.

KevinGage avatar Mar 29 '22 14:03 KevinGage

To use with TypeScript import types separately.

import { ToolkitContextType } from 'react-bootstrap-table2-toolkit';
import ToolkitProvider from 'react-bootstrap-table2-toolkit/dist/react-bootstrap-table2-toolkit';

<ToolkitProvider exportCSV {...tableProps}>
      {(props: ToolkitContextType) => (
          // everything else
      )}
</ToolkitProvider>

alex-shepel avatar May 17 '22 14:05 alex-shepel

Please anyone give me solution for this

Swethasri1512 avatar Aug 03 '23 08:08 Swethasri1512