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

Deployed to vercel search error. #2

Open
macong0420 opened this issue Jan 6, 2025 · 12 comments
Open

Deployed to vercel search error. #2

macong0420 opened this issue Jan 6, 2025 · 12 comments

Comments

@macong0420
Copy link

HI. I deployed this project to vercel, but an error occurred when searching. How should I fix it? Thank you.

@zqdalianchina
Copy link

Hi,got a error when I deploy in vercel.

Running build in Washington, D.C., USA (East) – iad1
Cloning github.com/zqdalianchina/Gemini-Search (Branch: main, Commit: 4e05490)
Skipping build cache, deployment was triggered without cache.
Cloning completed: 7.044s
Running "vercel build"
Vercel CLI 39.2.5
Installing dependencies...
added 7 packages in 3s
61 packages are looking for funding
run npm fund for details
Running "npm run build"

rest-express@1.0.0 build
vite build && esbuild server/index.ts --platform=node --packages=external --bundle --format=esm --outdir=dist
vite v5.4.10 building for production...
transforming...
✓ 2008 modules transformed.
rendering chunks...
computing gzip size...
../dist/public/assets/favicon-C3iPMMUn.svg 1.26 kB │ gzip: 0.59 kB
../dist/public/index.html 4.68 kB │ gzip: 1.27 kB
../dist/public/assets/index-W5bAjaqH.css 79.45 kB │ gzip: 13.37 kB
../dist/public/assets/index-BsuqFRlc.js 607.32 kB │ gzip: 186.28 kB
(!) Some chunks are larger than 500 kB after minification. Consider:

  • Using dynamic import() to code-split the application
  • Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
  • Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
    ✓ built in 6.24s
    sh: line 1: /vercel/path0/node_modules/.bin/esbuild: cannot execute binary file: Exec format error
    Error: Command "npm run build" exited with 126

@Rekik88
Copy link

Rekik88 commented Jan 7, 2025

Hi,got a error when I deploy in vercel.

Running build in Washington, D.C., USA (East) – iad1
Cloning github.com/zqdalianchina/Gemini-Search (Branch: main, Commit: 4e05490)
Skipping build cache, deployment was triggered without cache.
Cloning completed: 7.044s
Running "vercel build"
Vercel CLI 39.2.5
Installing dependencies...
added 7 packages in 3s
61 packages are looking for funding
run npm fund for details
Running "npm run build"

rest-express@1.0.0 build
vite build && esbuild server/index.ts --platform=node --packages=external --bundle --format=esm --outdir=dist
vite v5.4.10 building for production...
transforming...
✓ 2008 modules transformed.
rendering chunks...
computing gzip size...
../dist/public/assets/favicon-C3iPMMUn.svg 1.26 kB │ gzip: 0.59 kB
../dist/public/index.html 4.68 kB │ gzip: 1.27 kB
../dist/public/assets/index-W5bAjaqH.css 79.45 kB │ gzip: 13.37 kB
../dist/public/assets/index-BsuqFRlc.js 607.32 kB │ gzip: 186.28 kB
(!) Some chunks are larger than 500 kB after minification. Consider:

  • Using dynamic import() to code-split the application
  • Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
  • Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.
    ✓ built in 6.24s
    sh: line 1: /vercel/path0/node_modules/.bin/esbuild: cannot execute binary file: Exec format error
    Error: Command "npm run build" exited with 126

Did you try to use the vercel CLI ? I managed to deploy it via the CLI. However, it showed me the raw index.js file, and I couldn't get the interface running.

@macong0420
Copy link
Author

image

@macong0420
Copy link
Author

image

我用图片中的命令,可以正常部署.但是执行搜索的时候会报错
image
目前我还没有找到原因

@macong0420
Copy link
Author

image 部署好,首页可以正常价值,但是执行搜索的时候,提示404了 不知道应该怎么修改

@Rekik88
Copy link

Rekik88 commented Jan 9, 2025

image

我用图片中的命令,可以正常部署.但是执行搜索的时候会报错
image
目前我还没有找到原因

I see what you are trying to do. By using vite build as a building command, you are only building the ui. You are missing the server backend. You need to execute the esbuild command as seen in the package.json file

@Run1997
Copy link

Run1997 commented Jan 9, 2025

image image image 使用 vercel部署,用 npm run build 命令构建报错,请问有大佬知道怎么解决吗?

@Rekik88
Copy link

Rekik88 commented Jan 9, 2025

For the npm build error, remove node_modules folder a redeploy.

@Run1997
Copy link

Run1997 commented Jan 10, 2025

Awesome, bro, but after successful deployment, the search request 404'd, how can I fix it?

@Rekik88
Copy link

Rekik88 commented Jan 10, 2025

Awesome, bro, but after successful deployment, the search request 404'd, how can I fix it?

You might have to create a vercel.json config file. Unfortunately, I couldn't get it to work after that.

@Rekik88
Copy link

Rekik88 commented Jan 10, 2025

I created a new repo https://github.com/Rekik88/Gemini-Search-Vercel-Build- , and tries various fixes, but without luck.

@Run1997
Copy link

Run1997 commented Jan 14, 2025

我部署到 vercel 上成功了,能够请求接口,但是接口报错了,尝试了很多方法都无法解决这个问题。
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants