Migmac
CDCloudflare Developers
•Created by Migmac on 4/24/2024 in #pages-help
I have different builds when building my vite-react app using cloudflare pages
I am committing the bun.lockb file to ensure the deps are the same, and locally it runs as expected, but for some reason the css file gets all weird when I run the build command through the cloudflare pages build process. exactly the same commands used, and as I mentioned the bun.lockb file is also comitted so it should be installing exactly the same. It does build, but messes somehting up in the process. Have no idea why this could be happening
Any suggestions/pointers?
my vite.config.ts looks like this:
The weird thing is the size of the css file is the same, but it is like it's broken somehow and only somethings work. 🤔
8 replies
CDCloudflare Developers
•Created by Migmac on 4/14/2024 in #workers-help
Can I assign a worker binding during runtime?
Provided I have the
account_id
and the bucketName
as well as an api key with the ability to do this, can I dynamically assign a binding to a worker on runtime?21 replies
CDCloudflare Developers
•Created by Migmac on 4/13/2024 in #workers-help
Is there any way I could setup bindings on a worker for r2_buckets from different accounts?
In my worker.toml, instead of having something like
The
bucket_name
is merely for the buckets in the account where this bucket will be deployed. I am wondering if there is a way to bind buckets from other accounts from within the same worker. (Without using the typical API key for every request)
The goal is to be able to take advantage of the bindings usefulness isntead of having to manually craft a POST request for everything I am doing.
Just wondering if there is someway to do this within wrangler.toml or if I have to end up doing something like the following:
This approach described above would manually require me to use an api key with permissions to email 1 and 2, and craft those requests by hand, as opposed to just using the bindings that "just work"
Any thoughts on this would be very helpful and appreciated, thanks!4 replies
CDCloudflare Developers
•Created by Migmac on 9/18/2023 in #workers-help
crypto.randomBytes is not a function
I am trying to use the speakeasy package that depends on node:crypto
By the looks of it the supported crypto version does not have crypto.randomBytes() implemented
Should I implement my own or is this something that you will be supporting in the future?
3 replies
CDCloudflare Developers
•Created by Migmac on 9/14/2023 in #workers-help
compatibility_flags = [ "nodejs_compat" ] not working
I get this message even after adding this flag to the
wrangler.toml
file
even when using different compatibility dates, currently with compatibility_date = "2023-08-15"
I have also tried the legacy node_compat = true
flag instead of the new compatibility_flags = [ "nodejs_compat" ]
setting.
Also tried running it with both and it gets mad.
Also tried installing the packages manually and it keeps erroring out.
Is there anything I'm doing wrong with this flag? How am I supposed to use it exactly?
This is all caused by trying to include the googleapis
package that has http2
(its the one thing that crashes with the legacy flag.
With the new flag about 50 things show the "Add "node_compat = true" "
flag9 replies
CDCloudflare Developers
•Created by Migmac on 9/14/2023 in #workers-help
How would I do require('googleapis') in a worker?
My question is pretty straightforward:
How would I do
In a worker?
9 replies
CDCloudflare Developers
•Created by Migmac on 4/25/2023 in #pages-help
MIME Type _headers help needed
I am trying to get a
Unity WebGL
build to deploy on pages and I can't seem to get the _headers
file right
I need the following files to be functional
/Build/BUILD.data.gz
/Build/BUILD.framework.js.gz
/Build/BUILD.loader.js
/Build/BUILD.wasm.gz
I have tried messing around with the _headers
file to no success
My current _headers
file looks like this:
I do get the following error message when trying to load the page though:
Any help would be useful. Thanks in advance1 replies