-
Notifications
You must be signed in to change notification settings - Fork 22
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
Can't upload worker #158
Comments
your second example is how this should be done. here is my snippet using 3.0.0-beta.3:
unfortunately, the bit that isn't working is the content-type handling. here is an example of a working payload (from Go):
note the content-types of however, when executing from the SDK, i can see that the content-types are not being picked up correctly. instead, they are defaulting to
this will need investigation as it looks like this either specific to the SDK or node. |
this was a bug in our handling of the types being passed through. this is now resolved in v3.0.0-beta.8 working example import Cloudflare from "cloudflare";
const cf = new Cloudflare({
apiToken: "<token>"
});
cf.workers.scripts.update("test-worker", {
"index.js": new File(
[
`export default {
async fetch() {
return new Response("Hello!");
}
}`,
],
"index.js",
{
type: "application/javascript+module",
}
),
metadata: new File(
[
JSON.stringify({
bindings: [],
main_module: "index.js",
}),
],
"metadata.json",
{
type: "application/json",
}
),
account_id: "<account id>",
}); |
@jacobbednarz Thanks |
@jacobbednarz After some testing, this code indeed works. However, this won't be compliled when using typescript, the definition of the type is completely incorrect. Are there any plans to fix it? the and metadata field here only requires a plain object but in this working code, it have to be a |
Hi!, I'm trying to upload the Cloudflare Worker, and receiving this error:
Steps to reproduce:
My current code, (the config is correct):
Additional Information
Also, after reviewing the
cloudflare
code, I tried following:Which occurs another error:
The text was updated successfully, but these errors were encountered: