在Heroku上部署我的AdonisJS应用程序之后。尝试通过浏览器访问应用程序时遇到错误。
我正在使用AdonisJS 4.1版。
Error: Cannot find module 'Youch'
Error: Cannot find module 'Youch'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:655:15)
at Function.Module._load (internal/modules/cjs/loader.js:580:25)
at Module.require (internal/modules/cjs/loader.js:711:19)
at require (internal/modules/cjs/helpers.js:14:16)
at requireStack (/app/node_modules/require-stack/src/index.js:44:12)
at Ioc._require (/app/node_modules/@adonisjs/fold/src/Ioc/index.js:345:12)
at Ioc.use (/app/node_modules/@adonisjs/fold/src/Ioc/index.js:742:17)
at Object.<anonymous> (/app/app/Exceptions/Handler.js:6:15)
at Module._compile (internal/modules/cjs/loader.js:805:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)
at Module.load (internal/modules/cjs/loader.js:672:32)
at tryModuleLoad (internal/modules/cjs/loader.js:612:12)
at Function.Module._load (internal/modules/cjs/loader.js:604:3)
at Module.require (internal/modules/cjs/loader.js:711:19)
at require (internal/modules/cjs/helpers.js:14:16)
at requireStack (/app/node_modules/require-stack/src/index.js:44:12)
at Ioc._resolveAutoloadedPath (/app/node_modules/@adonisjs/fold/src/Ioc/index.js:265:20)
at Ioc.use (/app/node_modules/@adonisjs/fold/src/Ioc/index.js:739:19)
at Server._handleException (/app/node_modules/@adonisjs/framework/src/Server/index.js:245:36)
at _executeServerMiddleware.then.then.catch (/app/node_modules/@adonisjs/framework/src/Server/index.js:441:14)
at processTicksAndRejections (internal/process/task_queues.js:86:5)
我想犯那个错误,但是我不知道怎么做。
答案 0 :(得分:0)
尝试使用Thread.sleep(1000);
代替const Youch = use(‘youch’)
。