chatgpt-demo icon indicating copy to clipboard operation
chatgpt-demo copied to clipboard

support for one-click installation in netlify?

Open Root-FTW opened this issue 1 year ago • 16 comments

Clear and concise description of the problem

some of us have problems with vercel because its timeout is less than 10 seconds and if the api takes a long time to respond, it marks error because of the 10 seconds timeout.

Maybe having another option like netlify we can try other environments.

Suggested solution

https://www.netlify.com/

Alternative

No response

Additional context

No response

Validations

  • [X] Follow our Code of Conduct
  • [X] Read the Contributing Guide.
  • [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.

Root-FTW avatar Mar 07 '23 20:03 Root-FTW

According to https://docs.astro.build/en/guides/deploy/ , it should support deployment to Netlify, Vercel and other platforms that support SSR.

I'll look into the one-click deployment support for Netlify. If anyone wants to provide support for it on other platforms, PR welcome.

ddiu8081 avatar Mar 08 '23 03:03 ddiu8081

I'm wondering if netlify can be visited in China mainland directly, if so I'd like to try.

MC-dusk avatar Mar 08 '23 04:03 MC-dusk

You can switch to the feat/netlify branch for deployment #180

yzh990918 avatar Mar 08 '23 06:03 yzh990918

You can switch to the feat/netlify branch for deployment #180

When I click on the "Deploy to Netlify" button, it makes the request to Netlify with the "main" version. 2023_03_07_23_58_32_Welcome_to_Netlify_Get_your_site_in_1_min _Netlify

if I make the change in the URL of the button, like this: https://app.netlify.com/start/deploy?repository=https://github.com/ddiu8081/chatgpt-demo/tree/feat/netlify&ref=feat/netlify&env%5BOPEN_API_KEY%5D=xxx

I get this error: 2023_03_08_00_01_57_Welcome_to_Netlify_Get_your_site_in_1_min _Netlify

Root-FTW avatar Mar 08 '23 07:03 Root-FTW

Failed to deploy to Netlify with the following error.

The deployed address is https://mellow-dieffenbachia-42ad69..app.

The error message is as follows.

{
    "errorType": "ReferenceError",
    "errorMessage": "crypto is not defined",
    "trace": [
        "ReferenceError: crypto is not defined",
        "    at digestMessage (/var/task/.netlify/functions-internal/entry.js:90284:3)",
        "    at generateSignature (/var/task/.netlify/functions-internal/entry.js:90297:16)",
        "    at verifySignature (/var/task/.netlify/functions-internal/entry.js:90300:29)",
        "    at Module.post (/var/task/.netlify/functions-internal/entry.js:90513:14)",
        "    at async call (/var/task/.netlify/functions-internal/entry.js:86517:20)",
        "    at async App.#callEndpoint (/var/task/.netlify/functions-internal/entry.js:86844:20)",
        "    at async Runtime.myHandler [as handler] (/var/task/.netlify/functions-internal/entry.js:86938:22)"
    ]
}

h7ml avatar Mar 08 '23 08:03 h7ml

Failed to deploy to Netlify with the following error.

The deployed address is https://mellow-dieffenbachia-42ad69..app.

The error message is as follows.

{
    "errorType": "ReferenceError",
    "errorMessage": "crypto is not defined",
    "trace": [
        "ReferenceError: crypto is not defined",
        "    at digestMessage (/var/task/.netlify/functions-internal/entry.js:90284:3)",
        "    at generateSignature (/var/task/.netlify/functions-internal/entry.js:90297:16)",
        "    at verifySignature (/var/task/.netlify/functions-internal/entry.js:90300:29)",
        "    at Module.post (/var/task/.netlify/functions-internal/entry.js:90513:14)",
        "    at async call (/var/task/.netlify/functions-internal/entry.js:86517:20)",
        "    at async App.#callEndpoint (/var/task/.netlify/functions-internal/entry.js:86844:20)",
        "    at async Runtime.myHandler [as handler] (/var/task/.netlify/functions-internal/entry.js:86938:22)"
    ]
}

Fixed in https://github.com/ddiu8081/chatgpt-demo/pull/184

yzh990918 avatar Mar 08 '23 08:03 yzh990918

You can switch to the feat/netlify branch for deployment #180

When I click on the "Deploy to Netlify" button, it makes the request to Netlify with the "main" version. 2023_03_07_23_58_32_Welcome_to_Netlify_Get_your_site_in_1_min _Netlify

if I make the change in the URL of the button, like this: https://app.netlify.com/start/deploy?repository=https://github.com/ddiu8081/chatgpt-demo/tree/feat/netlify&ref=feat/netlify&env%5BOPEN_API_KEY%5D=xxx

I get this error: 2023_03_08_00_01_57_Welcome_to_Netlify_Get_your_site_in_1_min _Netlify

You can achieve this functionality by following these steps:

  1. Fork this project and create a new website on Netlify and connect it with the GitHub account.
  2. Configure environment variables in the project settings.
  3. Select "GitHub" as the continuous integration provider in the deployment settings and select the branch to deploy (e.g. feat/netlify).
  4. Select the default build command and output directory.
  5. Click the "Deploy site" button to start the deployment process.

yzh990918 avatar Mar 08 '23 09:03 yzh990918

You can switch to the feat/netlify branch for deployment #180

When I click on the "Deploy to Netlify" button, it makes the request to Netlify with the "main" version. 2023_03_07_23_58_32_Welcome_to_Netlify_Get_your_site_in_1_min _Netlify

if I make the change in the URL of the button, like this: https://app.netlify.com/start/deploy?repository=https://github.com/ddiu8081/chatgpt-demo/tree/feat/netlify&ref=feat/netlify&env%5BOPEN_API_KEY%5D=xxx

I get this error: 2023_03_08_00_01_57_Welcome_to_Netlify_Get_your_site_in_1_min _Netlify

The netlify deployment button seems to have no branch specified, only environment variable population and repository address. https://docs.netlify.com/site-deploys/create-deploys/#deploy-to-netlify-button

yzh990918 avatar Mar 08 '23 10:03 yzh990918

I have deployed one, but no matter what I input, there is no output, and nothing else, neither keep showing AI thinking.... I didn't find the log console in netlify, so what's the problem probably?


broswer console showed:

POST https://xxx.netlify.app/api/generate 502
A	@	Generator.3ad01aed.js:69
await in A(异步)		
b	@	Generator.3ad01aed.js:69
F	@	Generator.3ad01aed.js:71
J	@	web.49ca3d74.js:1

MC-dusk avatar Mar 08 '23 14:03 MC-dusk

I have deployed one, but no matter what I input, there is no output, and nothing else, neither keep showing AI thinking.... I didn't find the log console in netlify, so what's the problem probably?

broswer console showed:

POST https://xxx.netlify.app/api/generate 502
A	@	Generator.3ad01aed.js:69
await in A(异步)		
b	@	Generator.3ad01aed.js:69
F	@	Generator.3ad01aed.js:71
J	@	web.49ca3d74.js:1

Everything I set up seems work fine. image

yzh990918 avatar Mar 09 '23 01:03 yzh990918

@yzh990918 sir, this way, https://cancanneed.netlify.app/

MC-dusk avatar Mar 09 '23 03:03 MC-dusk

@yzh990918 sir, this way, https://cancanneed.netlify.app/

Could it be an issue with your http-proxy??

yzh990918 avatar Mar 10 '23 04:03 yzh990918

@yzh990918 sir, this way, https://cancanneed.netlify.app/

Could it be an issue with your http-proxy??

I can use it without any proxy, not really understand your hint

MC-dusk avatar Mar 10 '23 12:03 MC-dusk

Netlify deployment still has some problems, it is recommended to use Vercel first 🙏

yzh990918 avatar Mar 10 '23 13:03 yzh990918

To be confirmed, maybe a bug in https://github.com/withastro/astro/issues/6506

ddiu8081 avatar Mar 10 '23 15:03 ddiu8081

Netlify deployment still has some problems, it is recommended to use Vercel first 🙏

We have temporarily locked the version of "@astrojs/netlify": "2.0.0" and can now deploy normally through Netlify !. However, we will continue to follow up on this bug.

yzh990918 avatar Mar 10 '23 16:03 yzh990918