-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
"wrangler publish" fails, "Error: missing field type
"
#9
Comments
Hi @catharsis71, are you using wrangler2? Wrangler v1 doesn't work with the new |
seems like I have wrangler 1.19.12 is there any way to make it work with that version or am I just out of luck? |
Hmm, try setting |
Well that did something but I'm not sure what
I'll look into trying to get wrangler2 but I'm close to giving up on R2 because they make everything far too difficult I don't suppose there's any possibility of doing this through the Cloudflare dashboard instead of using wrangler? I tried using the worker "Quick Edit" button and pasting in stuff from the index.js or index.ts but unsurprisingly it didn't work. I don't really even want to have all this NPM / etc stuff installed, I just installed it all temporarily and plan on uninstalling everything once the worker is functional (or I give up on the whole endeavor) |
Yeah, I'm not entirely sure why it's not working with Wrangler v1. However, you can always try the GitHub Actions method, it doesn't require anything locally- you can create the R2 bucket, etc from the Cloudflare dashboard. If you decide on doing that, feel free to ask me if any issues arise. |
trying again now with wrangler2
|
Now I'm trying the Github Actions method is this the correct place for the secrets? When I was running wrangler locally I just used "wrangler login" so I didn't have to mess with tokens/keys I tried setting CF_API_TOKEN to my Global API Key but Cloudflare didn't seem to like it, I guess I actually need to create a token for this but what permissions does it need? |
Right, I forgot, you need to run
Yup!
Just Edit: README has been updated! |
okay so we definitely have some level of functionality now with a custom subdomain, seems to be working fine using workers.dev was also working fine but I turned it off because I don't really need it then I got to looking at "routes" stuff which I don't really understand I thought maybe instead of being reliant on a files.(domain).com subdomain, I could rig it so that (domain).com/files/ also works and it's clearly hitting the script because I'm getting your "File Not Found" message but I'm getting that even when requesting a file that does exist, also, requests to (domain).com/files/ without a file specified get "File Not Found" instead of "OK" If I do it like this do I need to move all my files into a /files/ subdirectory in the bucket or something along those lines? sorry to venture off-topic from what I opened this for |
Yeah, you'd have to prefix all your files with I'll also close this issue since the original problem was resolved, but if you have any other questions feel free to ask them. |
Thank you for all your assistance on this yes, a base/prefix thing could potentially be useful but not really a big deal |
I'm very new at this and having a bad time
The wrangler.toml does not have a "type" entry so "wrangler publish" fails like this:
I tried putting
type = "javascript"
in the file but it did not workI tried
type = "typescript"
but also did not workI tried some other random guesses but nothing that worked
The text was updated successfully, but these errors were encountered: