Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'babel-runtime/regenerator' #64

Open
aadityabhatia opened this issue Apr 12, 2020 · 2 comments
Open

Error: Cannot find module 'babel-runtime/regenerator' #64

aadityabhatia opened this issue Apr 12, 2020 · 2 comments
Labels
bug Something isn't working dependencies Pull requests that update a dependency file

Comments

@aadityabhatia
Copy link

aadityabhatia commented Apr 12, 2020

Installed koa-access by running npm install @uswitch/koa-access. Adding require('@uswitch/koa-access') to my code results in the following error:

Error: Cannot find module 'babel-runtime/regenerator'

node_modules/@uswitch/koa-access/build/koa-access.js references babel-runtime/regenerator but babel-runtime is not a dependency. Possibly the build process is broken.

Running on node v12.16.2 with npm v6.14.4.

@annez annez added bug Something isn't working dependencies Pull requests that update a dependency file labels Apr 15, 2020
@annez
Copy link
Contributor

annez commented Apr 15, 2020

Hi there @aadityabhatia this is probably an oversight due to the way we have used these packages historically. Do you mind showing us your build process for this?

We'll take a look as to how we can remove that dependency and transpile something appropriate.

@aadityabhatia
Copy link
Author

I did not build the package. I installed it from npm and used require to reference it from my code. The following is the simplest way to reproduce the issue.

$ npm i koa @uswitch/koa-access
+ koa@2.11.0                                                                   
+ @uswitch/koa-access@2.4.5                                         
added 44 packages from 24 contributors and audited 58 packages in 2.369s
found 0 vulnerabilities                               

$ echo "require('@uswitch/koa-access');" > server.js

$ node server.js 
internal/modules/cjs/loader.js:983
  throw err;
  ^

Error: Cannot find module 'babel-runtime/regenerator'
Require stack:
- /tmp/tmp.xO0KjUPcu6/node_modules/@uswitch/koa-access/build/koa-access.js
- /tmp/tmp.xO0KjUPcu6/server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Module.require (internal/modules/cjs/loader.js:1042:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/tmp/tmp.xO0KjUPcu6/node_modules/@uswitch/koa-access/build/koa-access.js:8:20)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1042:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/tmp/tmp.xO0KjUPcu6/node_modules/@uswitch/koa-access/build/koa-access.js',
    '/tmp/tmp.xO0KjUPcu6/server.js'
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file
Projects
None yet
Development

No branches or pull requests

2 participants