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: extract Cloudflare_CA.pem to temp dir before using it #1154

Merged
merged 1 commit into from
May 31, 2022

Conversation

threepointone
Copy link
Contributor

@threepointone threepointone commented May 31, 2022

With package managers like yarn, the cloudflare cert won't be available on the filesystem as expected (since the module is inside a .zip file). This fix instead extracts the file out of the module, copies it to a temporary directory, and directs node to use that as the cert instead, preventing warnings like #1136.

Fixes #1136

With package managers like yarn, the cloudflare cert won't be available on the filesystem as expected (since the module is inside a .zip file). This fix instead extracts the file out of the module, copies it to a temporary directory, and directs node to use that as the cert instead, preventing warnings like #1136.

Fixes #1136
@changeset-bot
Copy link

changeset-bot bot commented May 31, 2022

🦋 Changeset detected

Latest commit: 6441d38

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

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/2414058163/npm-package-wrangler-1154

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

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

Or you can use npx with this latest build directly:

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

@threepointone
Copy link
Contributor Author

Alright, I think this works. It definitely works with npm so we're not breaking anything. yarn doesn't allow installing from arbitrary urls, so I can't test with the preeleases. I tried locally and it worked, but that doesn't test the .zip nature of things. So let's try landing this and seeing how it goes?

packages/wrangler/bin/wrangler.js Show resolved Hide resolved
packages/wrangler/bin/wrangler.js Show resolved Hide resolved
@threepointone threepointone merged commit 5d6de58 into main May 31, 2022
@threepointone threepointone deleted the yarn-certs-warning branch May 31, 2022 11:03
@github-actions github-actions bot mentioned this pull request May 31, 2022
@threepointone
Copy link
Contributor Author

Confirmed with the beta that this works fine with yarn now

threepointone added a commit that referenced this pull request Jul 19, 2022
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)
threepointone added a commit that referenced this pull request Jul 19, 2022
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)
@github-actions github-actions bot mentioned this pull request Jul 19, 2022
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.

🐛 BUG: Ignoring extra certs warnings
2 participants