cloudflare / pages-action

MIT License
468 stars 95 forks source link

wrangler: not found (npx error in pnpm repository) #75

Open aaronadamsCA opened 1 year ago

aaronadamsCA commented 1 year ago

After switching our repository from Yarn to pnpm, npx wrangler@2 fails to download Wrangler. If there is a local Wrangler v2 dependency, the action will run it, but otherwise it fails.

image

(Yes that's a screenshot of a fork, but it's not behind any commits.)

Our workaround for now will be to install Wrangler in each package that needs to run this action.

vaknir commented 1 year ago

Hey, You might want to try changing your image from ubuntu-latest to ubuntu-20.04 and adding the environment variable NODE_VERSION with 18.15.0.

aaronadamsCA commented 1 year ago

We've already managed to work around this with the local package dev dependency, it's just interesting that npx breaks under pnpm.

Some potential solutions:

I'd be happy to give any of these a shot in a PR.

WalshyDev commented 1 year ago

Hmm, this is fun...

We do have an unstable publish API now exposed we could use - https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/src/api/pages/publish.tsx

This supports all the options we currently support + #76 which is nice

I'll need to play around with it and see if we can make it work nicely.