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

🐛 astro add vercel fails in a misleading way #3815

Closed
1 task done
mayank99 opened this issue Jul 4, 2022 · 0 comments · Fixed by #3854
Closed
1 task done

🐛 astro add vercel fails in a misleading way #3815

mayank99 opened this issue Jul 4, 2022 · 0 comments · Fixed by #3854
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@mayank99
Copy link
Contributor

mayank99 commented Jul 4, 2022

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 in astro.config and it was calling the adpater under the integrations: field instead of the adapter:. Also it was missing the ENABLE_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 running astro add vercel or astro add netlify. It even gives the false impression that it is making the right config changes. Ideally, passing an unsupported name or flag to astro 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, running npx 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

  • I am willing to submit a pull request for this issue.
@mayank99 mayank99 changed the title 🐛 BUG: 🐛 astro add vercel fails in a misleading way Jul 4, 2022
@natemoo-re natemoo-re added s2-medium - P4: important Violate documented behavior or significantly impacts performance (priority) labels Jul 8, 2022
@natemoo-re natemoo-re linked a pull request Jul 8, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants