Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vercel adapter 1.0.0-next.62 build errors with Cannot find module.. #5543

Closed
tsukhu opened this issue Jul 15, 2022 · 3 comments · Fixed by #5551
Closed

vercel adapter 1.0.0-next.62 build errors with Cannot find module.. #5543

tsukhu opened this issue Jul 15, 2022 · 3 comments · Fixed by #5551
Labels
bug Something isn't working pkg:adapter-vercel Pertaining to the Vercel adapter

Comments

@tsukhu
Copy link

tsukhu commented Jul 15, 2022

Describe the bug

  • My sveltekit product uses mongoose , post the version 1.0.0-next.60 the build breaks with multiple errors of Cannot find module..

Build log

> vite build

vite v3.0.0 building for production...
✓ 13 modules transformed.
.svelte-kit/output/client/_app/manifest.json                              1.19 KiB
.svelte-kit/output/client/_app/immutable/layout.svelte-c3373a0a.js        0.53 KiB / gzip: 0.35 KiB
.svelte-kit/output/client/_app/immutable/error.svelte-ccaf9407.js         1.56 KiB / gzip: 0.74 KiB
.svelte-kit/output/client/_app/immutable/pages/index.svelte-d5d3b574.js   0.80 KiB / gzip: 0.47 KiB
.svelte-kit/output/client/_app/immutable/chunks/index-bf1ed64f.js         6.85 KiB / gzip: 2.80 KiB
.svelte-kit/output/client/_app/immutable/start-7f2c5316.js                23.42 KiB / gzip: 8.84 KiB
vite v3.0.0 building SSR bundle for production...
✓ 15 modules transformed.
Generated an empty chunk: "hooks"
.svelte-kit/output/server/manifest.json                           1.27 KiB
.svelte-kit/output/server/index.js                                76.00 KiB
.svelte-kit/output/server/entries/endpoints/api/demo.json.ts.js   1.56 KiB
.svelte-kit/output/server/entries/fallbacks/layout.svelte.js      0.25 KiB
.svelte-kit/output/server/entries/fallbacks/error.svelte.js       0.74 KiB
.svelte-kit/output/server/entries/pages/index.svelte.js           0.33 KiB
.svelte-kit/output/server/immutable/chunks/index-b9efae8a.js      2.61 KiB
.svelte-kit/output/server/immutable/chunks/hooks-d259abab.js      0.00 KiB

Run npm run preview to preview your production build locally.
(node:8720) ExperimentalWarning: buffer.Blob is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

> Using @sveltejs/adapter-vercel
Error: Failed to resolve dependency bson-ext:
Cannot find module 'bson-ext' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\bson.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 1)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 1)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 36)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency kerberos:
Cannot find module 'kerberos' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\deps.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 2)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 19)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 36)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency snappy:
Cannot find module 'snappy' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\deps.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 4)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 19)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 36)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency snappy/package.json:
Cannot find module 'snappy/package.json' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\deps.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 5)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 19)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 36)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency aws4:
Cannot find module 'aws4' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\deps.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 7)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 19)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 36)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency @mongodb-js/zstd:
Cannot find module '@mongodb-js/zstd' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\deps.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 3)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 19)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 36)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency mongodb-client-encryption:
Cannot find module 'mongodb-client-encryption' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\encrypter.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 4)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 7)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 2)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency supports-color:
Cannot find module 'supports-color' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\debug\src\node.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 2)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 1)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 3)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
  ✔ done
  • Workaround

  • revert to version 1.0.0-next.60

  • build log

> vite build

vite v3.0.0 building for production...
✓ 13 modules transformed.
.svelte-kit/output/client/_app/manifest.json                              1.19 KiB
.svelte-kit/output/client/_app/immutable/layout.svelte-c3373a0a.js        0.53 KiB / gzip: 0.35 KiB
.svelte-kit/output/client/_app/immutable/error.svelte-ccaf9407.js         1.56 KiB / gzip: 0.74 KiB
.svelte-kit/output/client/_app/immutable/pages/index.svelte-d5d3b574.js   0.80 KiB / gzip: 0.47 KiB
.svelte-kit/output/client/_app/immutable/start-fa5ebffe.js                23.42 KiB / gzip: 8.84 KiB
.svelte-kit/output/client/_app/immutable/chunks/index-bf1ed64f.js         6.85 KiB / gzip: 2.80 KiB
vite v3.0.0 building SSR bundle for production...
✓ 15 modules transformed.
Generated an empty chunk: "hooks"
.svelte-kit/output/server/manifest.json                           1.27 KiB
.svelte-kit/output/server/index.js                                76.00 KiB
.svelte-kit/output/server/entries/endpoints/api/demo.json.ts.js   1.56 KiB
.svelte-kit/output/server/entries/fallbacks/layout.svelte.js      0.25 KiB
.svelte-kit/output/server/entries/fallbacks/error.svelte.js       0.74 KiB
.svelte-kit/output/server/entries/pages/index.svelte.js           0.33 KiB
.svelte-kit/output/server/immutable/chunks/index-b9efae8a.js      2.61 KiB
.svelte-kit/output/server/immutable/chunks/hooks-d259abab.js      0.00 KiB

Run npm run preview to preview your production build locally.
(node:12096) ExperimentalWarning: buffer.Blob is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

> Using @sveltejs/adapter-vercel
  ✔ done

Reproduction

Logs

> Using @sveltejs/adapter-vercel
Error: Failed to resolve dependency bson-ext:
Cannot find module 'bson-ext' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\bson.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 1)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 1)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 36)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency kerberos:
Cannot find module 'kerberos' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\deps.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 2)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 19)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 36)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency snappy:
Cannot find module 'snappy' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\deps.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 4)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 19)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 36)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency snappy/package.json:
Cannot find module 'snappy/package.json' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\deps.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 5)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 19)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 36)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency aws4:
Cannot find module 'aws4' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\deps.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 7)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 19)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 36)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency @mongodb-js/zstd:
Cannot find module '@mongodb-js/zstd' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\deps.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 3)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 19)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 36)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency mongodb-client-encryption:
Cannot find module 'mongodb-client-encryption' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\mongodb\lib\encrypter.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 4)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 7)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 2)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
Error: Failed to resolve dependency supports-color:
Cannot find module 'supports-color' loaded from D:\workspace\kit-mongoose-vercel-bug\node_modules\debug\src\node.js
    at D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:301:39
    at async Promise.all (index 2)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 1)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
    at async Promise.all (index 3)
    at async Job.emitDependency (D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:287:9)
    at async D:\workspace\kit-mongoose-vercel-bug\node_modules\@vercel\nft\out\node-file-trace.js:316:21
  ✔ done

System Info

System:
    OS: Windows 10 10.0.22000
    CPU: (8) x64 Intel(R) Core(TM) i7-4790S CPU @ 3.20GHz
    Memory: 6.84 GB / 15.92 GB
  Binaries:
    Node: 16.15.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.18 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.10.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (103.0.1264.49)
    Internet Explorer: 11.0.22000.120
  npmPackages:
    @sveltejs/adapter-auto: ^1.0.0-next.60 => 1.0.0-next.60
    @sveltejs/adapter-node: ^1.0.0-next.81 => 1.0.0-next.81
    @sveltejs/adapter-vercel: 1.0.0-next.62 => 1.0.0-next.60
    @sveltejs/kit: next => 1.0.0-next.375
    svelte: ^3.44.0 => 3.49.0
    vite: ^3.0.0 => 3.0.0

Severity

serious, but I can work around it

Additional Information

No response

@elliott-with-the-longest-name-on-github elliott-with-the-longest-name-on-github added bug Something isn't working pkg:adapter-vercel Pertaining to the Vercel adapter labels Jul 15, 2022
@Rich-Harris
Copy link
Member

Is this causing an application failure, or is it just a noisy error message? The dependencies it's failing to resolve are wrapped in a try-catch inside mongoose code, e.g.:

let BSON = require('bson');
try {
    // Ensure you always wrap an optional require in the try block NODE-3199
    BSON = require('bson-ext');
}
catch { } // eslint-disable-line

adapter-vercel uses https://github.com/vercel/nft (NFT as in 'node file trace', rather than 'environmentally destructive JSON file') to trace which files from your project (including node_modules) should be included in the serverless function it generates. It's not able to distinguish between essential and optional modules.

If you do need those modules, you can simply install them. If you don't, you should be able to safely ignore the message. We should make it look a bit less intimidating though.

Rich-Harris added a commit that referenced this issue Jul 15, 2022
* make resolution failures more appealing - closes #5543

* lint
@Rich-Harris
Copy link
Member

closed via #5551 on the assumption that the warnings are harmless; please open a new issue if not

@tsukhu
Copy link
Author

tsukhu commented Jul 16, 2022

Hi @Rich-Harris ,
Thank you for this quick turnaround. Your assumption is right on these warnings as the app seems to still work, but good to not see these build time warnings any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pkg:adapter-vercel Pertaining to the Vercel adapter
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants