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

Vercel deployments broken with pnpm #5020

Closed
1 task
sammccord opened this issue Oct 7, 2022 · 6 comments · Fixed by #5033
Closed
1 task

Vercel deployments broken with pnpm #5020

sammccord opened this issue Oct 7, 2022 · 6 comments · Fixed by #5033
Assignees

Comments

@sammccord
Copy link

What version of astro are you using?

1.4.6

Are you using an SSR adapter? If so, which one?

Vercel

What package manager are you using?

pnpm

What operating system are you using?

Linux

Describe the Bug

When deploying an Astro site inside a pnpm monorepo to Vercel with the @astrojs/vercel/serverless adapter, the deployment succeeds, but all requests fail with 500 errors. See this deployed example - https://pnpm-astro.vercel.app/

The only error being thrown in the logs is:

ERROR	Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@astrojs/vercel' imported from /var/task/entry.js    at new NodeError (node:internal/errors:372:5)

This is essentially a duplicate of #4567, but I'm re-opening this specifically for pnpm / Vercel functionality.

I'll also note that shamefully-hoist=true in the root .npmrc doesn't seem to have any effect, even though it was fixed in >1.4.0

Link to Minimal Reproducible Example

https://github.com/sammccord/pnpm-astro

Participation

  • I am willing to submit a pull request for this issue.
@matthewp
Copy link
Contributor

matthewp commented Oct 8, 2022

Do you need to move that package into a regular (non dev) dependencies?

@sammccord
Copy link
Author

Do you need to move that package into a regular (non dev) dependencies?

Both astro and @astrojs/vercel are listed in the package's production dependencies in the attached reproduction - https://github.com/sammccord/pnpm-astro/blob/main/packages/astro/package.json

@JuanM04
Copy link
Contributor

JuanM04 commented Oct 10, 2022

@sammccord I've made a fix. Could you try it and tell me if it works?

$ pnpm add @astrojs/vercel@next--monorepos

@sammccord
Copy link
Author

I've made a fix. Could you try it and tell me if it works?

Looks good to me! Thanks! <3

@BrightonMboya
Copy link

idk if it was removed in the latter releases and I have the same exact issue as this one. Followed the above instructions but still doesnt work. I have opened a new Issue

@jon-xo
Copy link

jon-xo commented Dec 8, 2023

I opened #9382 with my Vercel output and a screenshot

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

Successfully merging a pull request may close this issue.

5 participants