N
Nuxt10mo ago
Just Simeon

lru-cache missing [Unresolved]

Hey I updated our nuxt3 frontend today using nuxt upgrade and also updated all deps. Unfortunately when building the Project and pushing it to our server we can't run it because of this error: Cannot find package 'lru-cache' imported from /var/www/vod-stage/server/index.mjs. yarn dev locally and also using node .output/server/index.mjs locally in the project works, but not when build.
3 Replies
Just Simeon
Just SimeonOP10mo ago
These are my deps:
"devDependencies": {
"@nuxt/image": "^1.3.0",
"@nuxtjs/seo": "^2.0.0-rc.5",
"@types/video.js": "^7.3.56",
"nuxt": "^3.9.3",
"prisma": "^5.8.1",
"vue": "^3.4.15",
"vue-router": "^4.2.5"
},
"dependencies": {
"@heroicons/vue": "^2.1.1",
"@nuxtjs/tailwindcss": "^6.11.1",
"@prisma/client": "^5.8.1",
"mitt": "^3.0.1",
"nuxt-security": "^1.0.1",
"video.js": "8.10.0",
"videojs-quality-selector-hls-custom": "^1.1.0"
},
"devDependencies": {
"@nuxt/image": "^1.3.0",
"@nuxtjs/seo": "^2.0.0-rc.5",
"@types/video.js": "^7.3.56",
"nuxt": "^3.9.3",
"prisma": "^5.8.1",
"vue": "^3.4.15",
"vue-router": "^4.2.5"
},
"dependencies": {
"@heroicons/vue": "^2.1.1",
"@nuxtjs/tailwindcss": "^6.11.1",
"@prisma/client": "^5.8.1",
"mitt": "^3.0.1",
"nuxt-security": "^1.0.1",
"video.js": "8.10.0",
"videojs-quality-selector-hls-custom": "^1.1.0"
},
and this is the full error stack:
root@debian-2gb-fsn1-1:/var/www/vod-stage# node server/index.mjs
node:internal/modules/esm/resolve:853
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'lru-cache' imported from /var/www/vod-stage/server/index.mjs
at packageResolve (node:internal/modules/esm/resolve:853:9)
at moduleResolve (node:internal/modules/esm/resolve:910:20)
at defaultResolve (node:internal/modules/esm/resolve:1130:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36) {
code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v20.11.0
root@debian-2gb-fsn1-1:/var/www/vod-stage# node server/index.mjs
node:internal/modules/esm/resolve:853
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'lru-cache' imported from /var/www/vod-stage/server/index.mjs
at packageResolve (node:internal/modules/esm/resolve:853:9)
at moduleResolve (node:internal/modules/esm/resolve:910:20)
at defaultResolve (node:internal/modules/esm/resolve:1130:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36) {
code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v20.11.0
Okay I just found the Issue I think? for some reason lru-cache is symlinked but I am not sure why yea some dependencies where symlinked, and even after correcting them by manually adding the folders I am still having trouble. The App starts now but as soon as I try to view it, I see this in the frontend: Cannot find module '/var/www/vod-stage/server/node_modules/global/window' imported from /var/www/vod-stage/server/chunks/app/_nuxt/index-1PucZdpf.mjs Did you mean to import global/window.js? bump Bump
conner
conner10mo ago
One of your dependencies uses lru-cache, find out which one. Maybe its solved when you add lru-cache to your dependencies
Just Simeon
Just SimeonOP10mo ago
It’s babble and that is used by some vue dependency. I tried adding it. It’s mainly caused by the weird symlink it creates instead of copying the dependencies. lru-Cache, Video.js and 2 others are being symlinked instead of copied And if I manually add them. I get. Any idea what I can do ?
Want results from more Discord servers?
Add your server