nuxt / nuxt

The Intuitive Vue Framework.

Home Page:https://nuxt.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build failing on production Digital Ocean - ERROR Cannot find module '/workspace/@nuxtjs/supabase'

nosizejosh opened this issue · comments

Environment


  • Operating System: Windows_NT
  • Node Version: v20.11.1
  • Nuxt Version: 3.11.2
  • CLI Version: 3.11.1
  • Nitro Version: 2.9.6
  • Package Manager: npm@10.4.0
  • Builder: -
  • User Config: debug, runtimeConfig, devtools, modules, ui, css, app, supabase, security
  • Runtime Modules: @nuxtjs/supabase@1.2.2, @vueuse/nuxt@10.9.0, @pinia/nuxt@0.5.1, @nuxt/ui@2.15.2, @pinia-plugin-persistedstate/nuxt@1.2.0, nuxt-icon@0.6.10, @nuxtjs/device@3.1.1
  • Build Modules: -

Reproduction

My App builds successfully on local (windows) but fails in production with the error ERROR Cannot find module '/workspace/@nuxtjs/supabase'

Describe the bug

I have attached the build error log from DO build.txt

I have not made any package changes except add new features. Not sure new features are the culprit since my code builds just fine on local.

Can someone please help me figure out what's happening?

Thanks

Additional context

No response

Logs

2024-05-07T16:09:38.515467749Z �[34m╭────────────�[34m�[30m�[44m git repo clone �[0m�[0m�[34m───────────╼�[0m
2024-05-07T16:09:38.515504267Z �[34m│�[0m �[34m › fetching app source code�[0m
2024-05-07T16:09:38.515508673Z �[34m│�[0m => Selecting branch "master"
2024-05-07T16:09:39.209252749Z �[34m│�[0m => Checking out commit "a4e8eb53a0d0e21785871ae0cf0ab47240db652b"
2024-05-07T16:09:39.238411413Z �[34m│�[0m 
2024-05-07T16:09:39.239736617Z �[34m│�[0m �[32m ✔ cloned repo to �[35m/workspace�[0m�[0m
2024-05-07T16:09:39.256480257Z �[34m╰────────────────────────────────────────╼�[0m
2024-05-07T16:09:39.256499475Z 
2024-05-07T16:09:39.345702350Z �[34m › configuring build-time app environment variables:�[0m
2024-05-07T16:09:39.345725971Z      SUPABASE_SERVICE_KEY SERVER_PRESET SUPABASE_URL SUPABASE_KEY
2024-05-07T16:09:39.345728496Z 
2024-05-07T16:09:39.348320212Z �[34m › configuring custom build command to be run at the end of the build:�[0m
2024-05-07T16:09:39.350528613Z    �[34m│�[0m npm run build
2024-05-07T16:09:39.350535576Z 
2024-05-07T16:09:39.442388193Z �[34m╭────────────�[34m�[30m�[44m buildpack detection �[0m�[0m�[34m───────────╼�[0m
2024-05-07T16:09:39.456774499Z �[34m│�[0m �[34m › using Ubuntu 22.04 stack�[0m
2024-05-07T16:09:39.843397676Z �[34m│�[0m Detected the following buildpacks suitable to build your app:
2024-05-07T16:09:39.843608835Z �[34m│�[0m 
2024-05-07T16:09:39.843617289Z �[34m│�[0m    heroku/nodejs-engine   v1.5.3  
2024-05-07T16:09:39.843619644Z �[34m│�[0m    digitalocean/node      v0.4.0  (Node.js)
2024-05-07T16:09:39.843621600Z �[34m│�[0m    digitalocean/procfile  v0.0.4  (Procfile)
2024-05-07T16:09:39.843624177Z �[34m│�[0m    digitalocean/custom    v0.1.2  (Custom Build Command)
2024-05-07T16:09:39.843626542Z �[34m│�[0m 
2024-05-07T16:09:39.843628820Z �[34m│�[0m For documentation on the buildpacks used to build your app, please see:
2024-05-07T16:09:39.843630780Z �[34m│�[0m 
2024-05-07T16:09:39.843632791Z �[34m│�[0m    Node.js  v0.4.0  https://do.co/apps-buildpack-node
2024-05-07T16:09:39.846234072Z �[34m╰─────────────────────────────────────────────╼�[0m
2024-05-07T16:09:39.846240778Z 
2024-05-07T16:09:39.848792645Z �[34m╭────────────�[34m�[30m�[44m build caching �[0m�[0m�[34m───────────╼�[0m
2024-05-07T16:09:39.850789127Z �[34m│�[0m �[34m › checking for cache from a previous build�[0m
2024-05-07T16:09:40.215614579Z �[34m│�[0m Restoring metadata for "heroku/nodejs-engine:nodejs" from app image
2024-05-07T16:09:40.215640358Z �[34m│�[0m Restoring metadata for "heroku/nodejs-engine:toolbox" from cache
2024-05-07T16:09:40.215642531Z �[34m│�[0m Restoring metadata for "digitalocean/node:node_modules" from cache
2024-05-07T16:09:40.686976721Z �[34m│�[0m Restoring data for "heroku/nodejs-engine:nodejs" from cache
2024-05-07T16:09:40.687010132Z �[34m│�[0m Restoring data for "heroku/nodejs-engine:toolbox" from cache
2024-05-07T16:09:40.687242077Z �[34m│�[0m Restoring data for "digitalocean/node:node_modules" from cache
2024-05-07T16:09:45.761118989Z �[34m╰───────────────────────────────────────╼�[0m
2024-05-07T16:09:45.761161585Z 
2024-05-07T16:09:45.764020589Z �[34m╭────────────�[34m�[30m�[44m app build �[0m�[0m�[34m───────────╼�[0m
2024-05-07T16:09:45.790344156Z �[34m│�[0m [INFO] Node.js Buildpack
2024-05-07T16:09:45.792362287Z �[34m│�[0m [INFO] Setting NODE_ENV to production
2024-05-07T16:09:45.792636839Z �[34m│�[0m [INFO] Installing toolbox
2024-05-07T16:09:45.794202923Z �[34m│�[0m 
2024-05-07T16:09:45.794413103Z �[34m│�[0m �[1;35m[Installing Node]�[0m
2024-05-07T16:09:45.794423140Z �[34m│�[0m [INFO] Getting Node version
2024-05-07T16:09:45.801370544Z �[34m│�[0m [INFO] Resolving Node version
2024-05-07T16:09:46.617021240Z �[34m│�[0m [INFO] Reusing Node v20.12.2
2024-05-07T16:09:46.617328215Z �[34m│�[0m 
2024-05-07T16:09:46.617361455Z �[34m│�[0m �[1;35m[Parsing package.json]�[0m
2024-05-07T16:09:46.617366684Z �[34m│�[0m [INFO] Parsing package.json
2024-05-07T16:09:47.067662040Z �[34m│�[0m [INFO] No file to start server
2024-05-07T16:09:47.068076268Z �[34m│�[0m [INFO] either use 'docker run' to start container or add index.js or server.js
2024-05-07T16:09:47.078950213Z �[34m│�[0m Project contains package-lock.json, using npm
2024-05-07T16:09:47.292241044Z �[34m│�[0m Using npm v10.5.0. To configure a different version of npm, set the engines.npm property in package.json.
2024-05-07T16:09:47.292494209Z �[34m│�[0m   See https://do.co/apps-buildpack-node for further instructions.
2024-05-07T16:09:47.292517886Z �[34m│�[0m Installing node_modules using npm (from package-lock.json)
2024-05-07T16:09:47.480903983Z �[34m│�[0m Running npm ci
2024-05-07T16:09:47.481047340Z �[34m│�[0m 
2024-05-07T16:10:02.612157648Z �[34m│�[0m 
2024-05-07T16:10:02.612251958Z �[34m│�[0m > postinstall
2024-05-07T16:10:02.612256885Z �[34m│�[0m > nuxt prepare
2024-05-07T16:10:02.612259743Z �[34m│�[0m 
2024-05-07T16:10:03.814660809Z �[34m│�[0m [nuxt] modules:before: 0.193ms
2024-05-07T16:10:03.879396070Z �[34m│�[0m [nuxt] kit:compatibility: 12.638ms
2024-05-07T16:10:03.879658074Z �[34m│�[0m [nuxt] kit:compatibility�: 13.451ms
2024-05-07T16:10:03.879684819Z �[34m│�[0m [nuxt] kit:compatibility��: 13.607ms
2024-05-07T16:10:03.879857168Z �[34m│�[0m [nuxt] kit:compatibility���: 13.725ms
2024-05-07T16:10:03.880079176Z �[34m│�[0m [nuxt] kit:compatibility����: 14.025ms
2024-05-07T16:10:03.880293591Z �[34m│�[0m [nuxt] kit:compatibility�����: 14.182ms
2024-05-07T16:10:03.880467422Z �[34m│�[0m [nuxt] kit:compatibility������: 14.342ms
2024-05-07T16:10:03.880661084Z �[34m│�[0m [nuxt] kit:compatibility�������: 14.59ms
2024-05-07T16:10:03.881284155Z �[34m│�[0m [nuxt] kit:compatibility��������: 15.095ms
2024-05-07T16:10:03.881381076Z �[34m│�[0m [nuxt] kit:compatibility���������: 15.096ms
2024-05-07T16:10:03.881779859Z �[34m│�[0m [nuxt] kit:compatibility����������: 15.364ms
2024-05-07T16:10:03.928884309Z �[34m│�[0m 
2024-05-07T16:10:03.929158679Z �[34m│�[0m  ERROR  Error while requiring module @nuxtjs/supabase: Error: Cannot find module '/workspace/@nuxtjs/supabase'
2024-05-07T16:10:03.929171028Z �[34m│�[0m Require stack:
2024-05-07T16:10:03.929175057Z �[34m│�[0m - /workspace/index.js
2024-05-07T16:10:03.929177386Z �[34m│�[0m 
2024-05-07T16:10:03.929375834Z �[34m│�[0m 
2024-05-07T16:10:03.929397775Z �[34m│�[0m  ERROR  Cannot find module '/workspace/@nuxtjs/supabase'
2024-05-07T16:10:03.929402505Z �[34m│�[0m Require stack:
2024-05-07T16:10:03.929406652Z �[34m│�[0m - /workspace/index.js
2024-05-07T16:10:03.929410428Z �[34m│�[0m 
2024-05-07T16:10:03.929413887Z �[34m│�[0m   Require stack:
2024-05-07T16:10:03.929417154Z �[34m│�[0m   - index.js
2024-05-07T16:10:03.929420700Z �[34m│�[0m   at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
2024-05-07T16:10:03.929424061Z �[34m│�[0m   at Function.resolve (node:internal/modules/helpers:190:19)
2024-05-07T16:10:03.929444829Z �[34m│�[0m   at Function._resolve [as resolve] (node_modules/jiti/dist/jiti.js:1:251148)
2024-05-07T16:10:03.929448831Z �[34m│�[0m   at resolveModule (node_modules/@nuxt/kit/dist/index.mjs:2210:29)
2024-05-07T16:10:03.929452308Z �[34m│�[0m   at requireModule (node_modules/@nuxt/kit/dist/index.mjs:2215:24)
2024-05-07T16:10:03.929455888Z �[34m│�[0m   at loadNuxtModuleInstance (node_modules/@nuxt/kit/dist/index.mjs:2451:92)
2024-05-07T16:10:03.929459553Z �[34m│�[0m   at async installModule (node_modules/@nuxt/kit/dist/index.mjs:2407:47)
2024-05-07T16:10:03.929463375Z �[34m│�[0m   at async initNuxt (node_modules/nuxt/dist/index.mjs:4233:7)
2024-05-07T16:10:03.929466734Z �[34m│�[0m   at async loadNuxt (node_modules/nuxt/dist/index.mjs:4331:5)
2024-05-07T16:10:03.929726607Z �[34m│�[0m   at async loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:2570:19)
2024-05-07T16:10:03.929741079Z �[34m│�[0m   at async Object.run (node_modules/nuxi/dist/chunks/prepare.mjs:53:18)
2024-05-07T16:10:03.929744976Z �[34m│�[0m   at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1648:16)
2024-05-07T16:10:03.929748609Z �[34m│�[0m   at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1639:11)
2024-05-07T16:10:03.929752489Z �[34m│�[0m   at async runMain$1 (node_modules/nuxi/dist/shared/nuxi.9edf0930.mjs:1777:7) 
2024-05-07T16:10:03.929800081Z �[34m│�[0m 
2024-05-07T16:10:03.929805480Z �[34m│�[0m 
2024-05-07T16:10:03.929812066Z �[34m│�[0m 
2024-05-07T16:10:03.929947840Z �[34m│�[0m  ERROR  Cannot find module '/workspace/@nuxtjs/supabase'
2024-05-07T16:10:03.929966919Z �[34m│�[0m Require stack:
2024-05-07T16:10:03.929971661Z �[34m│�[0m - /workspace/index.js
2024-05-07T16:10:03.929975135Z �[34m│�[0m 
2024-05-07T16:10:03.940712304Z �[34m│�[0m npm notice 
2024-05-07T16:10:03.940957235Z �[34m│�[0m npm notice New minor version of npm available! 10.5.0 -> 10.7.0
2024-05-07T16:10:03.940970959Z �[34m│�[0m npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.7.0>
2024-05-07T16:10:03.940973937Z �[34m│�[0m npm notice Run `npm install -g npm@10.7.0` to update!
2024-05-07T16:10:03.940976781Z �[34m│�[0m npm notice 
2024-05-07T16:10:03.941782832Z �[34m│�[0m npm ERR! code 1
2024-05-07T16:10:03.942179752Z �[34m│�[0m npm ERR! path /workspace
2024-05-07T16:10:03.943206783Z �[34m│�[0m npm ERR! command failed
2024-05-07T16:10:03.943478133Z �[34m│�[0m npm ERR! command sh -c nuxt prepare
2024-05-07T16:10:03.944278266Z �[34m│�[0m 
2024-05-07T16:10:03.944554308Z �[34m│�[0m npm ERR! A complete log of this run can be found in: /home/apps/.npm/_logs/2024-05-07T16_09_47_601Z-debug-0.log
2024-05-07T16:10:03.965291211Z �[34m│�[0m unable to invoke layer creator
2024-05-07T16:10:03.965518728Z �[34m│�[0m installing node_modules: exit status 1
2024-05-07T16:10:03.965528416Z �[34m│�[0m 
2024-05-07T16:10:03.965862025Z �[34m│�[0m �[31;1mERROR: �[0mfailed to build: exit status 1
2024-05-07T16:10:04.221507804Z �[34m│�[0m 
2024-05-07T16:10:04.225186579Z �[34m│�[0m 
2024-05-07T16:10:04.225482140Z �[34m│�[0m For documentation on the buildpacks used to build your app, please see:
2024-05-07T16:10:04.225523650Z �[34m│�[0m 
2024-05-07T16:10:04.225535910Z �[34m│�[0m    Node.js  v0.4.0  https://do.co/apps-buildpack-node
2024-05-07T16:10:04.226022513Z �[34m│�[0m 
2024-05-07T16:10:04.234603621Z �[34m│�[0m �[31m ✘ build failed�[0m

Is it installed?

Would you be able to provide a reproduction? 🙏

More info

Why do I need to provide a reproduction?

Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making.

What will happen?

If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritize it based on its severity and how many people we think it might affect.

If needs reproduction labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it.

How can I create a reproduction?

We have a couple of templates for starting with a minimal reproduction:

👉 https://stackblitz.com/github/nuxt/starter/tree/v3-stackblitz
👉 https://codesandbox.io/s/github/nuxt/starter/v3-codesandbox

A public GitHub repository is also perfect. 👌

Please ensure that the reproduction is as minimal as possible. See more details in our guide.

You might also find these other articles interesting and/or helpful:

Is it installed?

Yes it is. This app has been in production for a while with multiple successful deploys.

After hours of painstakingly reverting I found the culprit.
image
not sure why this is what is causing build fail or why now, but for now, build is passing.

Will report this at the appropriate repo

Thanks @danielroe