unjs / nitro-deploys

Nitro Deployments Testing
https://github.com/unjs/nitro
46 stars 8 forks source link

edgio #61

Open Hebilicious opened 1 year ago

Hebilicious commented 1 year ago

After investigating this preset, I found out it no longer works. It looks like it's no longer possible to deploy with the cli v6, and the cli v7 is required with new projects.

v6

npx edgio deploy --team=UnJs --site=nitro-deployment --token=$EDGIO_DEPLOY_TOKEN     
WARNING: edgio platform serverless runtime supports only Node.js v16. Your current version is v20.2.0.
If your backend code (SSR, Api endpoints, etc.) uses Node.js v20.2.0 features it may not work as expected once deployed on the edgio platform.
🔑 Incorrect apiKey.

Deploy token is invalid or disabled!

v7

npx edgio deploy --property=nitro-deployment --token=$EDGIO_DEPLOY_TOKEN

WARNING: edgio platform serverless runtime supports only Node.js v16. Your current version is v20.2.0.
If your backend code (SSR, Api endpoints, etc.) uses Node.js v20.2.0 features it may not work as expected once deployed on the edgio platform.
🔑 Logged in as "test2" deploy token of site "nitro-deployment".

📋 Deploying to:
> Team: unjs
> Property: nitro-deployment
> branch: edgio
> Environment: default
> Edgio version: 7.0.24
> Commit URL: https://github.com/unjs/nitro-deploys/commit/34bf6dbc08c7fc07211f7525abc1e0b06e0b9b1b
> Deployment #1

🛠️  Building your app for deployment on Edgio
> Bundling router... done.

TypeError: router.fallback is not a function

The v7 upgrade is a breaking change and breaks our current Nitro preset (the fallback() method is no longer available). I assume this provider is unpopular so no-one noticed...

This preset will need to be refactored with v7 in mind : https://docs.edg.io/guides/v7/sites_frameworks/getting_started/nuxt3 It looks like we can/should use their undocumented nitropack connector.

This should work for Nitro standalone, however it won't probably won't for Nuxt as there is a separated connector.

I don't have a way to test v6 apps and the old preset, but we need to either update it to v7 or create a new one and warn that the old one doesn't work for new apps anymore.

For the preset implementation, if we follow their instructions we can just run npx edgio init && npx edgio build in the preset.