vercel-builder icon indicating copy to clipboard operation
vercel-builder copied to clipboard

Cannot resolve “~/api/index.js” from “/var/task/api/index.js”

Open WaldemarKarasik opened this issue 6 years ago • 3 comments

My app is deployed on vercel. However, it's not working. In function logs it has the following

FATAL Cannot resolve "~/api/index.js" from "/var/task/api/index.js" at Resolver.resolvePath (/var/task/node_modules/@nuxt/core/dist/core.js:572:11) at Server._requireMiddleware (/var/task/node_modules/@nuxt/server/dist/server.js:799:32) at Server._normalizeMiddleware (/var/task/node_modules/@nuxt/server/dist/server.js:756:25) at Server.resolveMiddleware (/var/task/node_modules/@nuxt/server/dist/server.js:824:23) at Server.useMiddleware (/var/task/node_modules/@nuxt/server/dist/server.js:849:36) at Server.setupMiddleware (/var/task/node_modules/@nuxt/server/dist/server.js:707:12) at async Server.ready (/var/task/node_modules/@nuxt/server/dist/server.js:637:5) at async Nuxt._init (/var/task/node_modules/@nuxt/core/dist/core.js:719:7) RequestId: da066c7e-660f-4f4e-b080-9dfca786aa73 Error: Runtime exited with error: exit status 1 Runtime.ExitError'

WaldemarKarasik avatar Aug 21 '20 10:08 WaldemarKarasik

@WaldemarKarasik Have you added that file to your serverFiles array in the config?

danielroe avatar Aug 22 '20 11:08 danielroe

serverMiddleware: ['~/api/index.js']

сб, 22 авг. 2020 г. в 19:38, Daniel Roe [email protected]:

@WaldemarKarasik https://github.com/WaldemarKarasik Have you added that file to your serverFiles array in the config?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nuxt/vercel-builder/issues/331#issuecomment-678629939, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALOI4X2EV6YM63ALCJV2PJLSB6UZRANCNFSM4QHFCIGQ .

WaldemarKarasik avatar Aug 22 '20 12:08 WaldemarKarasik

I think that's the issue then :smiley:

See https://github.com/nuxt/vercel-builder#serverfiles

danielroe avatar Aug 22 '20 12:08 danielroe