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
{{ message }}
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.
When looking at the compiled code which is included at runtime ([email protected]), there are calls to import files under the @babel/runtime package, eg.
node -e "require('react-scrollspy')"
internal/modules/cjs/loader.js:969
throw err;
^
Error: Cannot find module '@babel/runtime/helpers/interopRequireDefault'
Require stack:
- /Users/kengorab/code/bug-repro/node_modules/react-scrollspy/lib/scrollspy.js
- /Users/kengorab/code/bug-repro/[eval]
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Module.require (internal/modules/cjs/loader.js:1026:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/Users/kengorab/code/bug-repro/node_modules/react-scrollspy/lib/scrollspy.js:3:30)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Module.require (internal/modules/cjs/loader.js:1026:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/kengorab/code/bug-repro/node_modules/react-scrollspy/lib/scrollspy.js',
'/Users/kengorab/code/bug-repro/[eval]'
]
}
Potential Solution
A workaround for this would just be to explicitly depend on @babel/runtime, but this package should include it in its dependencies so npm/yarn can resolve it correctly. It appears this has a dependency on babel-runtime, which could probably just be changed to @babel/runtime to resolve this issue.
Note this might not be an issue in newer projects which were built with create-react-app, as react-scripts pulls in @babel/runtime.
The text was updated successfully, but these errors were encountered:
schmave
added a commit
to schmave/react-scrollspy
that referenced
this issue
Jun 24, 2021
The Bug
When looking at the compiled code which is included at runtime ([email protected]), there are calls to import files under the
@babel/runtime
package, eg.This throws an error at runtime, since it's not guaranteed that the
@babel/runtime
dependency is installed.Steps to Reproduce
You can reproduce this with a super minimal example:
The output of which will be:
Potential Solution
A workaround for this would just be to explicitly depend on
@babel/runtime
, but this package should include it in its dependencies so npm/yarn can resolve it correctly. It appears this has a dependency onbabel-runtime
, which could probably just be changed to@babel/runtime
to resolve this issue.Note this might not be an issue in newer projects which were built with
create-react-app
, asreact-scripts
pulls in@babel/runtime
.The text was updated successfully, but these errors were encountered: