🐛 astro add vercel
fails in a misleading way
#3815
Labels
- P4: important
Violate documented behavior or significantly impacts performance (priority)
What version of
astro
are you using?1.0.0-beta.63
Are you using an SSR adapter? If so, which one?
Vercel, but it applies to all SSR adapters
What package manager are you using?
npm
What operating system are you using?
Windows
Describe the Bug
I tried running
npx astro add vercel
(not sure why I just assumed it should work, probably because the difference between adapters and integrations is not obvious). Running that successfully installed the@astrojs/vercel
package but it had the wrong import path inastro.config
and it was calling the adpater under theintegrations:
field instead of theadapter:
. Also it was missing theENABLE_VC_BUILD: 1
env var. All of these things are correctly mentioned in the@astrojs/vercel
README but I had to manually find that link.The problem here is not that
astro add
doesn't support adapters (which is just a missing feature). The problem is that it doesn't stop you from runningastro add vercel
orastro add netlify
. It even gives the false impression that it is making the right config changes. Ideally, passing an unsupported name or flag toastro add
should just fail, and optionally even link to the docs for manually configuring adapters correctly.Another scenario: I'd imagine this same problem will happen when there are other packages added under the
@astrojs
scope in the future, e.g.@astrojs/markdown
. Meanwhile, runningnpx astro add foo
successfully fails because there is no@astrojs/foo
package.Maybe the
add
script should only allow a small hardcoded list of integrations that it's known to support, and fail if anything else is passed?Link to Minimal Reproducible Example
N/A
Participation
The text was updated successfully, but these errors were encountered: