AdrianGonz97 / refined-cf-pages-action

MIT License
22 stars 1 forks source link

wrangler: not found #17

Closed techniq closed 3 months ago

techniq commented 3 months ago

Hey @AdrianGonz97 👋, first awesome project, thanks for making it (and fixing the shortcomings of the official integration)!

We recently switched LayerChart and Svelte UX deployments to use this action (thanks @shyakadavis) and it's been working great until this afternoon when I updated to Node 20.x (dropping 18.x) and bumped some package.json dependencies.

Now the job is giving wrangler: not found from what looks to be npx wrangler@3 pages deploy ... which doesn't make sense to me.

image

Any thoughts of something I'm overlooking. Maybe it's just an npm hiccup or something, but it's failed for both Svelte UX and LayerChart after making the same changes.

Thanks for any help.

AdrianGonz97 commented 3 months ago

Hey! So I've noticed this issue in the past when using dependencies (such as @sveltejs/adapter-cloudflare) where wrangler is a transitive dependency and npx gets all confused for some reason. Not exactly sure why it behaves like that.

The fix is to install wrangler to the project as a devDependency. If you're in a monorepo, install it to the root.

techniq commented 3 months ago

Hey! So I've noticed this issue in the past when using dependencies (such as @sveltejs/adapter-cloudflare) where wrangler is a transitive dependency and npx gets all confused for some reason. Not exactly sure why it behaves like that.

The fix is to install wrangler to the project as a devDependency. If you're in a monorepo, install it to the root.

Thanks for the quick reply, and great idea. Giving that a go and will report back.

techniq commented 3 months ago

That did the trick, thanks @AdrianGonz97!

image