JsCommunity / JsCommunity/json-rpc-peer

Error: Cannot find module '@babel/runtime/core-js/object/create'

Open
#57 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
13
Forks
3
PR merge metrics
No merged PRs in 30d

Description

I meet this error today, it seems might relate to a version breaking change of Babel runtime.

This problem will not exist any more after we converted to TypeScript.

11:21:27 INFO PuppetManager install(wechaty-puppet-padchat@^0.8.1) done
{ Error: Cannot find module '@babel/runtime/core-js/object/create'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/ubuntu/workspace/node_modules/json-rpc-peer/dist/index.js:12:38)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/padchat-rpc.ts:4:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/padchat-manager.ts:28:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/puppet-padchat.ts:80:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/index.ts:19:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Promise.resolve.then (/home/ubuntu/workspace/src/puppet-manager.ts:79:26) code: 'MODULE_NOT_FOUND' }
11:21:27 ERR Wechaty start() exception: Cannot find module '@babel/runtime/core-js/object/create'
Bot error: { Error: Cannot find module '@babel/runtime/core-js/object/create'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/ubuntu/workspace/node_modules/json-rpc-peer/dist/index.js:12:38)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/padchat-rpc.ts:4:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/padchat-manager.ts:28:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/puppet-padchat.ts:80:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/ubuntu/workspace/node_modules/wechaty-puppet-padchat/src/index.ts:19:1)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Promise.resolve.then (/home/ubuntu/workspace/src/puppet-manager.ts:79:26) code: 'MODULE_NOT_FOUND' }
11:21:27 INFO Wechaty <padchat> stop() v#git[1668086] is stoping ...
11:21:27 SILL StateSwitch <Wechaty> off() is false
11:21:27 SILL StateSwitch <WechatyReady> off() is true
11:21:27 VERB StateSwitch <WechatyReady> off(true) <- (true)
11:21:27 SILL StateSwitch <Wechaty> off() is false
11:21:27 VERB StateSwitch <Wechaty> off(pending) <- (false)
11:21:27 VERB MemoryCard <> save() file: /home/ubuntu/workspace/default.memory-card.json
11:21:27 WARN Wechaty stop() puppet.stop() exception: static puppet not found for Wechaty, please see issue #1217: https://github.com/Chatie/wechaty/issues/1217
11:21:27 SILL StateSwitch <Wechaty> off() is pending
11:21:27 VERB StateSwitch <Wechaty> off(true) <- (pending)
zixia:~/workspace (master) $ ^C
zixia:~/workspace (master) $ vi src/npm ls ^C
zixia:~/workspace (master) $ npm ls @babel/runtime
wechaty@0.19.123 /home/ubuntu/workspace
└─┬ wechaty-puppet-padchat@0.8.7
  └─┬ json-rpc-peer@0.15.3
    └── @babel/runtime@7.0.0-beta.56 

See: https://github.com/lijiarui/wechaty-puppet-padchat/issues/126

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The failure enters through node_modules/json-rpc-peer/dist/index.js when wechaty-puppet-padchat loads, and npm ls shows @babel/runtime@7.0.0-beta.56. Start by checking the package metadata and generated entry point against that runtime version, then reproduce the install and startup path. Done means the reported MODULE_NOT_FOUND error no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, javascript
Domain
api, backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.