eyJOdnJHb25uYSI6Imd2VXVwIn0=
eyJOdnJHb25uYSI6Imd2VXVwIn0=
NNuxt
Created by eyJOdnJHb25uYSI6Imd2VXVwIn0= on 12/21/2023 in #❓・help
Organize folders?
No description
6 replies
NNuxt
Created by eyJOdnJHb25uYSI6Imd2VXVwIn0= on 7/12/2023 in #❓・help
impossible to use any lodash version in production build
I'm trying to use lodash-es within a server/api route. example:
import merge from 'lodash-es/merge'
import merge from 'lodash-es/merge'
It works within npm run dev, but breaks within npm run build & npm run preview I'm getting the following error:
Nuxi 3.6.2
ℹ Node.js version: 20.4.0
ℹ Preset: node-server
ℹ Working dir: .output
ℹ Loading .env. This will not be loaded when running the server in production.
ℹ Starting preview command: node ./server/index.mjs

node:internal/process/esm_loader:46
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/root/app-nuxt/.output/server/node_modules/lodash-es/merge' imported from /root/app-nuxt/.output/server/index.mjs
Did you mean to import lodash-es/merge.js?
at new NodeError (node:internal/errors:405:5)
at finalizeResolution (node:internal/modules/esm/resolve:225:11)
Nuxi 3.6.2
ℹ Node.js version: 20.4.0
ℹ Preset: node-server
ℹ Working dir: .output
ℹ Loading .env. This will not be loaded when running the server in production.
ℹ Starting preview command: node ./server/index.mjs

node:internal/process/esm_loader:46
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/root/app-nuxt/.output/server/node_modules/lodash-es/merge' imported from /root/app-nuxt/.output/server/index.mjs
Did you mean to import lodash-es/merge.js?
at new NodeError (node:internal/errors:405:5)
at finalizeResolution (node:internal/modules/esm/resolve:225:11)
Already tried to use the lodash or lodash.merge packages instead. But same errors.
2 replies