nuxt nitro generated imports failing at `sm-commons/utils/str` after nuxt bridge upgrade
See original GitHub issueVersions
- slice-machine-ui: 0.1.0
- sm-commons: 0.0.23
- node: 16.11.1
- @nuxtjs/bridge: npm:@nuxtjs/bridge-edge (3.0.0-27234503.d5127e9)
- nuxt-edge: latest (2.16.0-27226092.034b9901)
Additional Details
Logs:
โน Full static generation activated 14:31:48
โน Nitro preset is server 14:31:48
โน Cleaning up .output 14:31:48
โน Generating output directory: public/ 14:31:49
start Building server... 14:31:49
start Writing server bundle... 14:31:55
โ Server built 14:31:57
โโ node_modules/.cache/nuxt/nitro/index.mjs.map (1.33 MB) (149 kB gzip)
โโ node_modules/.cache/nuxt/nitro/index.mjs (1.61 MB) (346 kB gzip)
ฮฃ Total size: 2.94 MB (495 kB gzip)
FATAL [worker] Cannot find module '/Users/usr/Documents/Github/project/node_modules/sm-commons/utils/str' imported from /Users/usr/Documents/Github/project/node_modules/.cache/nuxt/nitro/index.mjs
Did you mean to import sm-commons/utils/str.js?
Did you mean to import sm-commons/utils/str.js?
at new NodeError (node:internal/errors:371:5)
at finalizeResolution (node:internal/modules/esm/resolve:416:11)
at moduleResolve (node:internal/modules/esm/resolve:932:10)
at Loader.defaultResolve [as _resolve] (node:internal/modules/esm/resolve:1044:11)
at Loader.resolve (node:internal/modules/esm/loader:89:40)
at Loader.getModuleJob (node:internal/modules/esm/loader:242:28)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36)
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ โ Nuxt Fatal Error โ
โ โ
โ Error: [worker] Cannot find module โ
โ โ/Users/usr/Documents/Github/project/node_modules/sm-commons/utils/strโ imported from โ
โ /Users/usr/Documents/Github/project/node_modules/.cache/nuxt/nitro/index.mjs โ
โ Did you mean to import sm-commons/utils/str.js? โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Steps to reproduce
Upgrade an existing nuxt project using slicemachine following nuxt bridge guide: https://v3.nuxtjs.org/getting-started/bridge/
yarn dev
works as intended
yarn generate
fails after nitro server built
What is expected?
Generation should not throw error at sm-commons imports
What is actually happening?
Nitro generates nodes_modules/.cache/nuxt/nitro/index.mjs
, adds the import of sm-commons
, then throws error at line:
import * as str from 'sm-commons/utils/str';
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
You welcome, just also add
sm-commons
to it and you should be fine ๐Itโs working! Iโve been trying to figure this out all afternoon. ๐
Thank you!