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

Build: Cannot see dist folder #52

Closed
hswmartin opened this issue Mar 4, 2023 · 13 comments
Closed

Build: Cannot see dist folder #52

hswmartin opened this issue Mar 4, 2023 · 13 comments
Labels
question Further information is requested

Comments

@hswmartin
Copy link
Contributor

请问有人build成功了吗?运行run build,有几个warning,但是看不到dist文件夹

@cuicui-V5
Copy link

@blkcor
Copy link

blkcor commented Mar 4, 2023

因为使用vercel部署的 vercel会自动执行一些edge function,dist会作为中间产物生成,最终会生成一个vercel目录

@hieiip1203
Copy link

我没成功

@ninvfeng
Copy link

ninvfeng commented Mar 4, 2023

本地build可以看这个
https://docs.astro.build/zh-cn/guides/integrations-guide/node/

安装
npx astro add node
npm install @astrojs/node

启动
node ./dist/server/entry.mjs

@ninvfeng
Copy link

ninvfeng commented Mar 4, 2023

直接build静态文件好像是不行的

@lxxxv5
Copy link
Contributor

lxxxv5 commented Mar 4, 2023

本地build可以看这个 https://docs.astro.build/zh-cn/guides/integrations-guide/node/

安装 npx astro add node npm install @astrojs/node

启动 node ./dist/server/entry.mjs

本地启动后开始对话,看到 /api/generate 接口一直在 pending 是怎么回事啊

@appsdog
Copy link

appsdog commented Mar 4, 2023

在centos上部署很复杂啊。

设置和安装依赖项npm i
制作一个副本.env.example,然后将其重命名为.env

添加到.env OPENAI_API_KEY=sk-xxx...
运行应用 npm run dev

这四步成功了,打开网站,403

@ninvfeng
Copy link

ninvfeng commented Mar 4, 2023

本地build可以看这个 https://docs.astro.build/zh-cn/guides/integrations-guide/node/
安装 npx astro add node npm install @astrojs/node
启动 node ./dist/server/entry.mjs

本地启动后开始对话,看到 /api/generate 接口一直在 pending 是怎么回事啊

估计是接口地址被屏蔽了 curl https://api.openai.com 看下, 如果一直pending就是被qiang了

@super6wenzi
Copy link

本地build可以看这个 https://docs.astro.build/zh-cn/guides/integrations-guide/node/
安装 npx astro add node npm install @astrojs/node
启动 node ./dist/server/entry.mjs

本地启动后开始对话,看到 /api/generate 接口一直在 pending 是怎么回事啊

估计是接口地址被屏蔽了 curl https://api.openai.com 看下, 如果一直pending就是被qiang了

被墙了怎么处理呢

@ninvfeng
Copy link

ninvfeng commented Mar 4, 2023

本地build可以看这个 https://docs.astro.build/zh-cn/guides/integrations-guide/node/
安装 npx astro add node npm install @astrojs/node
启动 node ./dist/server/entry.mjs

本地启动后开始对话,看到 /api/generate 接口一直在 pending 是怎么回事啊

估计是接口地址被屏蔽了 curl https://api.openai.com 看下, 如果一直pending就是被qiang了

被墙了怎么处理呢

最简单的, 按本项目推荐的部署方式直接用Vercel, 我选的是香港地区, 填个key就能用, 方便得很

@ddiu8081
Copy link
Member

ddiu8081 commented Mar 4, 2023

现在默认的 build 模式已经改为了 node,可以 build 后使用 node ./dist/server/entry.mjs 运行。

@ddiu8081 ddiu8081 closed this as completed Mar 4, 2023
@ddiu8081
Copy link
Member

ddiu8081 commented Mar 4, 2023

本地build可以看这个 https://docs.astro.build/zh-cn/guides/integrations-guide/node/
安装 npx astro add node npm install @astrojs/node
启动 node ./dist/server/entry.mjs

本地启动后开始对话,看到 /api/generate 接口一直在 pending 是怎么回事啊

估计是接口地址被屏蔽了 curl https://api.openai.com 看下, 如果一直pending就是被qiang了

被墙了怎么处理呢

本地运行的话,可以使用 HTTPS_PROXY 变量,为 OpenAI 接口指定一个 HTTP 代理。

@ddiu8081 ddiu8081 changed the title 请问这个项目能build吗? Build: Cannot see dist folder Mar 6, 2023
@ddiu8081 ddiu8081 added the question Further information is requested label Mar 6, 2023
@web256
Copy link

web256 commented Mar 8, 2023

HOST=0.0.0.0 PORT=80 node ./dist/server/entry.mjs
访问 /api/generate 接口 500 这个错误日志在哪看?

npm run dev 正常
node 执行就失败

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

No branches or pull requests

10 participants