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

fix: add fetch() dev helper correctly for pnp style package managers #1496

Merged
merged 1 commit into from
Jul 19, 2022

Conversation

threepointone
Copy link
Contributor

In #992, we added a dev-only helper that would warn when using fetch() in a manner that wouldn't work as expected (because of a bug we currently have in the runtime). We did this by injecting a file that would override usages of fetch(). When using pnp style package managers like yarn, this file can't be resolved correctly. So to fix that, we extract it into the temporary destination directory that we use to build the worker (much like a similar fix we did in #1154)

Reported at #1320 (comment)

@changeset-bot
Copy link

changeset-bot bot commented Jul 19, 2022

🦋 Changeset detected

Latest commit: 1381929

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jul 19, 2022

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/runs/2697120081/npm-package-wrangler-1496

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.developers.workers.dev/prs/1496/npm-package-wrangler-1496

Or you can use npx with this latest build directly:

npx https://prerelease-registry.developers.workers.dev/runs/2697120081/npm-package-wrangler-1496 dev path/to/script.js

@codecov
Copy link

codecov bot commented Jul 19, 2022

Codecov Report

Merging #1496 (a4f507d) into main (0953af8) will decrease coverage by 0.02%.
The diff coverage is 40.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1496      +/-   ##
==========================================
- Coverage   78.62%   78.59%   -0.03%     
==========================================
  Files          84       84              
  Lines        5768     5771       +3     
  Branches     1484     1484              
==========================================
+ Hits         4535     4536       +1     
- Misses       1233     1235       +2     
Impacted Files Coverage Δ
packages/wrangler/src/bundle.ts 94.33% <40.00%> (-3.67%) ⬇️

Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fast turnaround @threepointone - just one NIT.

packages/wrangler/src/bundle.ts Outdated Show resolved Hide resolved
In #992, we added a dev-only helper that would warn when using `fetch()` in a manner that wouldn't work as expected (because of a bug we currently have in the runtime). We did this by injecting a file that would override usages of `fetch()`. When using pnp style package managers like yarn, this file can't be resolved correctly. So to fix that, we extract it into the temporary destination directory that we use to build the worker (much like a similar fix we did in #1154)

Reported at #1320 (comment)
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 this pull request may close these issues.

2 participants