You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears the current version of this library is incompatible with babel-loader. Importing it into a React app causes the app to fail to compile with the following error:
./node_modules/react-idle-timer/dist/index.esm.js 239:8
Module parse failed: Unexpected token (239:8)
File was processed with these loaders:
* ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| var Q = {},
| Ae = class {
> name;
| closed = !1;
| mc = new MessageChannel();
Reproduction Steps
1. Added package via `yarn add react-idle-timer`.
2. Imported into React app with `import { useIdleTimer } from 'react-idle-timer';`3. Try to compile the app....
Relevant log output
[1] Failed to compile.
[1]
[1] ./node_modules/react-idle-timer/dist/index.esm.js 239:8
[1] Module parse failed: Unexpected token (239:8)
[1] File was processed with these loaders:
[1] * ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
[1] You may need an additional loader to handle the result of these loaders.
[1] | var Q = {},
[1] | Ae = class {
[1] > name;
[1] | closed = !1;
[1] | mc = new MessageChannel();
Screenshots or Additional Context
Babel versions from the main package.json file: "@babel/cli": "^7.23.0", "@babel/core": "^7.23.2", "@babel/preset-env": "^7.23.2",
In the react app's yarn.lock file, babel-loader (required by [email protected]) is:
Update: If I use version 5.6.2 I don't see this problem and the plugin works fine. My theory is that this bug was caused by the legacy bundle exports which were added to the package.json file in v 5.7.0. Babel-loader seems not to be able to handle that, or at least the version I'm using can't.
What happened?
It appears the current version of this library is incompatible with babel-loader. Importing it into a React app causes the app to fail to compile with the following error:
Reproduction Steps
Relevant log output
Screenshots or Additional Context
Babel versions from the main package.json file:
"@babel/cli": "^7.23.0", "@babel/core": "^7.23.2", "@babel/preset-env": "^7.23.2",
In the react app's yarn.lock file, babel-loader (required by [email protected]) is:
[email protected]: version "8.1.0" resolved "https://registry.yarnpkg.com/babel-loader/-/babel-loader-8.1.0.tgz#c611d5112bd5209abe8b9fa84c3e4da25275f1c3" integrity sha512-7q7nC1tYOrqvUrN3LQK4GwSk/TQorZSOlO9C+RZDZpODgyN4ZlCqE5q9cDsyWOliN+aU9B4JX01xK9eJXowJLw== dependencies: find-cache-dir "^2.1.0" loader-utils "^1.4.0" mkdirp "^0.5.3" pify "^4.0.1" schema-utils "^2.6.5"
Module Version
5.7.2
What browsers are you seeing the problem on? Select all that apply.
Chrome
What devices are you seeing the problem on?
Desktop
Verification
The text was updated successfully, but these errors were encountered: