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.

Runtime dependency on `@babel/runtime`?

See original GitHub issue

I’m looking into updating a couple packages’ dependencies from a custom fork of cannon.js to cannon-es. When installing and running my tests, however, I’m seeing the error about @babel/runtime below. Looking at the generated output on unpkg, I see the dependency on @babel/runtime as well. I’m not particularly familiar with using Babel directly, and it’s not part of my package. Is that supposed to be a runtime dependency? I’m assuming not, but if so shouldn’t it be declared in dependencies or peerDependencies?

The project I’m updating now is three-to-cannon, and the issue can be reproduced with npm install && npm run dist && npm test after cloning the repo. Note that it’s a library, not an application: I declare cannon-es as a peer dependency rather than bundling it with the package, and I cannot transpile cannon-es on behalf of my users.

> three-to-cannon@2.0.0 test /Users/donmccurdy/Documents/Projects/three-to-cannon
> node test/index.js

internal/modules/cjs/loader.js:775
    throw err;
    ^

Error: Cannot find module '@babel/runtime/helpers/possibleConstructorReturn'
Require stack:
- /Users/donmccurdy/Documents/Projects/three-to-cannon/node_modules/cannon-es/dist/index.cjs.js
- /Users/donmccurdy/Documents/Projects/three-to-cannon/dist/three-pathfinding.js
- /Users/donmccurdy/Documents/Projects/three-to-cannon/test/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
    at Function.Module._load (internal/modules/cjs/loader.js:677:27)
    at Module.require (internal/modules/cjs/loader.js:830:19)
    at require (internal/modules/cjs/helpers.js:68:18)
    at Object.<anonymous> (/Users/donmccurdy/Documents/Projects/three-to-cannon/node_modules/cannon-es/dist/index.cjs.js:7:1)
    at Module._compile (internal/modules/cjs/loader.js:936:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
    at Module.load (internal/modules/cjs/loader.js:790:32)
    at Function.Module._load (internal/modules/cjs/loader.js:703:12)
    at Module.require (internal/modules/cjs/loader.js:830:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/donmccurdy/Documents/Projects/three-to-cannon/node_modules/cannon-es/dist/index.cjs.js',
    '/Users/donmccurdy/Documents/Projects/three-to-cannon/dist/three-pathfinding.js',
    '/Users/donmccurdy/Documents/Projects/three-to-cannon/test/index.js'
  ]
}
npm ERR! Test failed.  See above for more details.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
codynovacommented, Apr 26, 2020

I believe that’s in the World class file, it’s an older attempt to polyfill. I will take a look soon if Marco doesn’t beat me to it.

1reaction
marcofugarocommented, Jun 24, 2020

Yes I’ve found a solution in #38.

It avoids us from using any polyfill.

Read more comments on GitHub >

github_iconTop Results From Across the Web

babel/runtime
babel /runtime` is a library that contains Babel modular runtime helpers. ... This is meant to be used as a runtime dependency along...
Read more >
Shouldn't babel-runtime be in dependencies rather than ...
Bottom line: babel-runtime should be added as dependency to make clean install work. 1
Read more >
@babel/runtime is a true dependency | /*code-comments*/
I've been working on nom, a CLI designed to manage a directory of notes. It's written in Typescript, but I use Babel to...
Read more >
Do @babel/runtime / @babel/plugin-transform-runtime in CLI ...
The short answer is yes: @babel/runtime (and @babel/plugin-transform-runtime ) is intended to be treated as a dependency.
Read more >
@babel/runtime - npm
@babel/runtime. 7.20.7 • Public • Published 5 days ago. Readme · Code Beta · 1 Dependency · 29,096 Dependents · 122 Versions ...
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