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

[Bug] Fail in Vercel deployment: Module not found: Can't resolve 'http' #670

Closed
ymansurozer opened this issue Dec 15, 2023 · 7 comments ยท Fixed by #672
Closed

[Bug] Fail in Vercel deployment: Module not found: Can't resolve 'http' #670

ymansurozer opened this issue Dec 15, 2023 · 7 comments ยท Fixed by #672
Labels
๐Ÿ› Bug Something isn't working | ็ผบ้™ท released

Comments

@ymansurozer
Copy link
Contributor

๐Ÿ’ป ็ณป็ปŸ็Žฏๅขƒ | Operating System

Windows

๐ŸŒ ๆต่งˆๅ™จ | Browser

Chrome

๐Ÿ› ้—ฎ้ข˜ๆ่ฟฐ | Bug Description

I simply clicked on the Deploy on Vercel button, added the OpenAI API Key but keep getting the below error in building:
image

Full logs:

[10:14:16.023] Running build in Washington, D.C., USA (East) โ€“ iad1
[10:14:16.124] Cloning github.com/ymansurozer/lobe-chat (Branch: main, Commit: 6d19564)
[10:14:16.132] Skipping build cache, deployment was triggered without cache.
[10:14:19.365] Cloning completed: 3.242s
[10:14:19.674] Running "vercel build"
[10:14:20.182] Vercel CLI 32.7.1
[10:14:20.597] Running "install" command: `/bun1/bun install`...
[10:14:20.648] bun install v1.0.15 (b3bdf22e)
[10:14:20.663]  Resolving dependencies
[10:14:28.401]  Resolved, downloaded and extracted [8062]
[10:14:28.402] warn: incorrect peer dependency "stylelint@15.11.0"
[10:14:28.402] 
[10:14:28.402] warn: incorrect peer dependency "stylelint@15.11.0"
[10:14:28.402] 
[10:14:28.402] warn: incorrect peer dependency "@octokit/core@5.0.2"
[10:14:28.402] 
[10:14:28.402] warn: incorrect peer dependency "@octokit/core@5.0.2"
[10:14:28.641]  Saved lockfile
[10:14:31.041]  + @commitlint/cli@18.4.3
[10:14:31.041]  + @ducanh2912/next-pwa@9.7.2
[10:14:31.041]  + @lobehub/i18n-cli@1.15.1
[10:14:31.041]  + @lobehub/lint@1.21.0
[10:14:31.041]  + @next/bundle-analyzer@14.0.4
[10:14:31.041]  + @next/eslint-plugin-next@14.0.4
[10:14:31.041]  + @testing-library/jest-dom@6.1.5
[10:14:31.041]  + @testing-library/react@14.1.2
[10:14:31.042]  + @types/chroma-js@2.4.3
[10:14:31.042]  + @types/lodash@4.14.202
[10:14:31.042]  + @types/lodash-es@4.17.12
[10:14:31.042]  + @types/node@20.10.4
[10:14:31.042]  + @types/react@18.2.45
[10:14:31.042]  + @types/react-dom@18.2.17
[10:14:31.042]  + @types/semver@7.5.6
[10:14:31.042]  + @types/systemjs@6.13.5
[10:14:31.042]  + @types/ua-parser-js@0.7.39
[10:14:31.042]  + @types/uuid@9.0.7
[10:14:31.042]  + @umijs/lint@4.0.89
[10:14:31.042]  + @vitest/coverage-v8@0.34.6
[10:14:31.042]  + commitlint@18.4.3
[10:14:31.042]  + consola@3.2.3
[10:14:31.042]  + dpdm@3.14.0
[10:14:31.042]  + eslint@8.55.0
[10:14:31.042]  + fake-indexeddb@5.0.1
[10:14:31.042]  + glob@10.3.10
[10:14:31.042]  + husky@8.0.3
[10:14:31.042]  + jsdom@23.0.1
[10:14:31.042]  + lint-staged@15.2.0
[10:14:31.043]  + lodash@4.17.21
[10:14:31.043]  + markdown-table@3.0.3
[10:14:31.043]  + node-fetch@3.3.2
[10:14:31.043]  + p-map@7.0.0
[10:14:31.043]  + prettier@3.1.1
[10:14:31.043]  + remark-cli@11.0.0
[10:14:31.043]  + remark-parse@10.0.2
[10:14:31.043]  + semantic-release@21.1.2
[10:14:31.043]  + stylelint@15.11.0
[10:14:31.043]  + ts-node@10.9.2
[10:14:31.043]  + typescript@5.3.3
[10:14:31.043]  + unified@11.0.4
[10:14:31.044]  + unist-util-visit@5.0.0
[10:14:31.044]  + vitest@0.34.6
[10:14:31.044]  + @ant-design/icons@5.2.6
[10:14:31.044]  + @icons-pack/react-simple-icons@9.2.0
[10:14:31.044]  + @lobehub/chat-plugin-sdk@1.30.1
[10:14:31.044]  + @lobehub/chat-plugins-gateway@1.8.2
[10:14:31.044]  + @lobehub/tts@1.23.3
[10:14:31.044]  + @lobehub/ui@1.120.14
[10:14:31.044]  + @vercel/analytics@1.1.1
[10:14:31.044]  + ahooks@3.7.8
[10:14:31.044]  + ai@2.2.29
[10:14:31.044]  + antd@5.12.2
[10:14:31.044]  + antd-style@3.6.1
[10:14:31.044]  + brotli-wasm@1.3.1
[10:14:31.044]  + chroma-js@2.4.2
[10:14:31.045]  + copy-to-clipboard@3.3.3
[10:14:31.045]  + dayjs@1.11.10
[10:14:31.045]  + dexie@3.2.4
[10:14:31.045]  + fast-deep-equal@3.1.3
[10:14:31.045]  + gpt-tokenizer@2.1.2
[10:14:31.045]  + i18next@23.7.11
[10:14:31.045]  + i18next-browser-languagedetector@7.2.0
[10:14:31.045]  + i18next-resources-for-ts@1.4.0
[10:14:31.045]  + i18next-resources-to-backend@1.2.0
[10:14:31.045]  + idb-keyval@6.2.1
[10:14:31.045]  + immer@10.0.3
[10:14:31.046]  + lodash-es@4.17.21
[10:14:31.046]  + lucide-react@0.295.0
[10:14:31.046]  + modern-screenshot@4.4.36
[10:14:31.046]  + nanoid@5.0.4
[10:14:31.046]  + next@14.0.4
[10:14:31.046]  + openai@4.22.0
[10:14:31.046]  + polished@4.2.2
[10:14:31.046]  + posthog-js@1.96.0
[10:14:31.046]  + query-string@8.1.0
[10:14:31.046]  + react@18.2.0
[10:14:31.046]  + react-dom@18.2.0
[10:14:31.046]  + react-hotkeys-hook@4.4.1
[10:14:31.046]  + react-i18next@13.5.0
[10:14:31.047]  + react-intersection-observer@9.5.3
[10:14:31.047]  + react-layout-kit@1.7.4
[10:14:31.047]  + react-lazy-load@4.0.1
[10:14:31.047]  + react-wrap-balancer@1.1.0
[10:14:31.047]  + remark@14.0.3
[10:14:31.047]  + remark-gfm@3.0.1
[10:14:31.047]  + remark-html@15.0.2
[10:14:31.047]  + semver@7.5.4
[10:14:31.047]  + sharp@0.33.0
[10:14:31.047]  + swr@2.2.4
[10:14:31.047]  + systemjs@6.14.2
[10:14:31.047]  + ts-md5@1.3.1
[10:14:31.047]  + ua-parser-js@1.0.37
[10:14:31.047]  + url-join@5.0.0
[10:14:31.047]  + use-merge-value@1.2.0
[10:14:31.048]  + utility-types@3.10.0
[10:14:31.048]  + uuid@9.0.1
[10:14:31.048]  + zod@3.22.4
[10:14:31.048]  + zustand@4.4.7
[10:14:31.048]  + zustand-utils@1.3.1
[10:14:31.554] husky - Git hooks installed
[10:14:31.560] 
[10:14:31.560]  2172 packages installed [10.42s]
[10:14:31.601] Detected Next.js version: 14.0.4
[10:14:31.609] Running "bun run build"
[10:14:31.617] $ next build
[10:14:36.362] Attention: Next.js now collects completely anonymous telemetry regarding usage.
[10:14:36.362] This information is used to shape Next.js' roadmap and prioritize features.
[10:14:36.362] You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
[10:14:36.362] https://nextjs.org/telemetry
[10:14:36.362] 
[10:14:36.473]    โ–ฒ Next.js 14.0.4
[10:14:36.473]    - Experiments (use at your own risk):
[10:14:36.473]      ยท forceSwcTransforms
[10:14:36.474] 
[10:14:36.474]    Creating an optimized production build ...
[10:14:37.005]  โœ“ (pwa) Compiling for server...
[10:14:37.006]  โœ“ (pwa) Compiling for server...
[10:14:37.007]  โœ“ (pwa) Compiling for client (static)...
[10:14:37.007]  โ—‹ (pwa) Service worker: /vercel/path0/public/sw.js
[10:14:37.007]  โ—‹ (pwa)   URL: /sw.js
[10:14:37.007]  โ—‹ (pwa)   Scope: /
[10:15:49.488] Failed to compile.
[10:15:49.488] 
[10:15:49.488] ./node_modules/@apidevtools/swagger-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/resolvers/http.js:3:13
[10:15:49.488] Module not found: Can't resolve 'http'
[10:15:49.489] Did you mean './http'?
[10:15:49.489] Requests that should resolve in the current directory need to start with './'.
[10:15:49.489] Requests that start with a name are treated as module requests and resolve within module directories (node_modules, /vercel/path0).
[10:15:49.489] If changing the source code is not an option there is also a resolve options called 'preferRelative' which tries to resolve these kind of requests in the current directory too.
[10:15:49.489] 
[10:15:49.489] https://nextjs.org/docs/messages/module-not-found
[10:15:49.489] 
[10:15:49.489] Import trace for requested module:
[10:15:49.489] ./node_modules/@apidevtools/swagger-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/options.js
[10:15:49.489] ./node_modules/@apidevtools/swagger-parser/lib/options.js
[10:15:49.489] ./node_modules/@apidevtools/swagger-parser/lib/index.js
[10:15:49.489] ./node_modules/@lobehub/chat-plugin-sdk/lib/openapi/index.js
[10:15:49.489] ./node_modules/@lobehub/chat-plugin-sdk/openapi.js
[10:15:49.489] ./node_modules/@lobehub/chat-plugins-gateway/dist/gateway.js
[10:15:49.489] ./node_modules/@lobehub/chat-plugins-gateway/dist/index.js
[10:15:49.489] ./src/app/api/plugins/route.ts
[10:15:49.490] ./node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js?absolutePagePath=private-next-app-dir%2Fapi%2Fplugins%2Froute.ts&page=%2Fapi%2Fplugins%2Froute&appDirLoader=bmV4dC1hcHAtbG9hZGVyP25hbWU9YXBwJTJGYXBpJTJGcGx1Z2lucyUyRnJvdXRlJnBhZ2U9JTJGYXBpJTJGcGx1Z2lucyUyRnJvdXRlJnBhZ2VQYXRoPXByaXZhdGUtbmV4dC1hcHAtZGlyJTJGYXBpJTJGcGx1Z2lucyUyRnJvdXRlLnRzJmFwcERpcj0lMkZ2ZXJjZWwlMkZwYXRoMCUyRnNyYyUyRmFwcCZhcHBQYXRocz0lMkZhcGklMkZwbHVnaW5zJTJGcm91dGUmcGFnZUV4dGVuc2lvbnM9dHN4JnBhZ2VFeHRlbnNpb25zPXRzJnBhZ2VFeHRlbnNpb25zPWpzeCZwYWdlRXh0ZW5zaW9ucz1qcyZiYXNlUGF0aD0mYXNzZXRQcmVmaXg9Jm5leHRDb25maWdPdXRwdXQ9JnByZWZlcnJlZFJlZ2lvbj0mbWlkZGxld2FyZUNvbmZpZz1lMzAlM0Qh&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!
[10:15:49.490] 
[10:15:49.490] ./node_modules/@apidevtools/swagger-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/resolvers/http.js:4:14
[10:15:49.490] Module not found: Can't resolve 'https'
[10:15:49.490] 
[10:15:49.490] https://nextjs.org/docs/messages/module-not-found
[10:15:49.490] 
[10:15:49.490] Import trace for requested module:
[10:15:49.490] ./node_modules/@apidevtools/swagger-parser/node_modules/@apidevtools/json-schema-ref-parser/lib/options.js
[10:15:49.490] ./node_modules/@apidevtools/swagger-parser/lib/options.js
[10:15:49.490] ./node_modules/@apidevtools/swagger-parser/lib/index.js
[10:15:49.490] ./node_modules/@lobehub/chat-plugin-sdk/lib/openapi/index.js
[10:15:49.490] ./node_modules/@lobehub/chat-plugin-sdk/openapi.js
[10:15:49.490] ./node_modules/@lobehub/chat-plugins-gateway/dist/gateway.js
[10:15:49.490] ./node_modules/@lobehub/chat-plugins-gateway/dist/index.js
[10:15:49.490] ./src/app/api/plugins/route.ts
[10:15:49.490] ./node_modules/next/dist/build/webpack/loaders/next-edge-app-route-loader/index.js?absolutePagePath=private-next-app-dir%2Fapi%2Fplugins%2Froute.ts&page=%2Fapi%2Fplugins%2Froute&appDirLoader=bmV4dC1hcHAtbG9hZGVyP25hbWU9YXBwJTJGYXBpJTJGcGx1Z2lucyUyRnJvdXRlJnBhZ2U9JTJGYXBpJTJGcGx1Z2lucyUyRnJvdXRlJnBhZ2VQYXRoPXByaXZhdGUtbmV4dC1hcHAtZGlyJTJGYXBpJTJGcGx1Z2lucyUyRnJvdXRlLnRzJmFwcERpcj0lMkZ2ZXJjZWwlMkZwYXRoMCUyRnNyYyUyRmFwcCZhcHBQYXRocz0lMkZhcGklMkZwbHVnaW5zJTJGcm91dGUmcGFnZUV4dGVuc2lvbnM9dHN4JnBhZ2VFeHRlbnNpb25zPXRzJnBhZ2VFeHRlbnNpb25zPWpzeCZwYWdlRXh0ZW5zaW9ucz1qcyZiYXNlUGF0aD0mYXNzZXRQcmVmaXg9Jm5leHRDb25maWdPdXRwdXQ9JnByZWZlcnJlZFJlZ2lvbj0mbWlkZGxld2FyZUNvbmZpZz1lMzAlM0Qh&nextConfigOutput=&preferredRegion=&middlewareConfig=e30%3D!
[10:15:49.490] 
[10:15:49.491] 
[10:15:49.491] > Build failed because of webpack errors
[10:15:49.612] error: script "build" exited with code 1 (SIGHUP)
[10:15:49.616] Error: Command "bun run build" exited with 1
[10:15:51.117] 

๐Ÿšฆ ๆœŸๆœ›็ป“ๆžœ | Expected Behavior

No response

๐Ÿ“ท ๅค็Žฐๆญฅ้ชค | Recurrence Steps

No response

๐Ÿ“ ่กฅๅ……ไฟกๆฏ | Additional Information

No response

@ymansurozer ymansurozer added the ๐Ÿ› Bug Something isn't working | ็ผบ้™ท label Dec 15, 2023
@lobehubbot
Copy link
Member

๐Ÿ‘€ @ymansurozer

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
้žๅธธๆ„Ÿ่ฐขๆ‚จๆไบค issueใ€‚ๆˆ‘ไปฌไผšๅฐฝๅฟซ่ฐƒๆŸฅๆญคไบ‹๏ผŒๅนถๅฐฝๅฟซๅ›žๅคๆ‚จใ€‚ ่ฏท็กฎไฟๆ‚จๅทฒ็ปๆไพ›ไบ†ๅฐฝๅฏ่ƒฝๅคš็š„่ƒŒๆ™ฏไฟกๆฏใ€‚

@Les1ey
Copy link

Les1ey commented Dec 15, 2023

+1๏ผŒๆˆ‘ๆŠ˜่…พไบ†ๅŠๅฐๆ—ถไปฅไธบๆ˜ฏๆˆ‘็š„้—ฎ้ข˜๏ผŒๅˆšๅ‡†ๅค‡ๆฅๆissue

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


+1, I struggled for half an hour thinking it was my problem, and I was just about to raise an issue.

@yhwymy
Copy link

yhwymy commented Dec 15, 2023

+1๏ผŒๆˆ‘ๆŠ˜่…พไบ†ๅŠๅฐๆ—ถไปฅไธบๆ˜ฏๆˆ‘็š„้—ฎ้ข˜๏ผŒๅˆšๅ‡†ๅค‡ๆฅๆissue

ไฟบไนŸไธ€ๆ ทใ€‚

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. ๐Ÿ‘ฏ๐Ÿ‘ญ๐Ÿป๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘๐Ÿ‘ซ๐Ÿง‘๐Ÿฟโ€๐Ÿคโ€๐Ÿง‘๐Ÿป๐Ÿ‘ฉ๐Ÿพโ€๐Ÿคโ€๐Ÿ‘จ๐Ÿฟ๐Ÿ‘ฌ๐Ÿฟ


+1, I struggled for half an hour thinking it was my problem, and I was just about to raise an issue.

Me too.

@lobehubbot
Copy link
Member

โœ… @ymansurozer

This issue is closed, If you have any questions, you can comment and reply.
ๆญค้—ฎ้ข˜ๅทฒ็ปๅ…ณ้—ญใ€‚ๅฆ‚ๆžœๆ‚จๆœ‰ไปปไฝ•้—ฎ้ข˜๏ผŒๅฏไปฅ็•™่จ€ๅนถๅ›žๅคใ€‚

@lobehubbot
Copy link
Member

๐ŸŽ‰ This issue has been resolved in version 0.111.6 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
๐Ÿ› Bug Something isn't working | ็ผบ้™ท released
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants