[solid-start-cloudflare-pages] making http request...
# pages-help
a
Hi 😁 I'm new to cloudflare and I'm trying to make an http request. When I use a library like
got
it works fine locally but when I deploy I get that it needs
nodejs_compat
. I tried adding in the UI at settings > function > compatibility flags but didn't work. When I use fetch it fails locally with a
fetch failed
with something about a
new ReadableStream()
(will get a more detailed error when I revert to this scenario). Tell me if there any other necessary information 😁 But the main question is: What is the proper way to make a http reauest inside a
createServerData$
?
s
Is the compatibility date in your pages functions settings on a pretty old date? I'm guessing that's why
a
It's recent 🤔
The deployment id is on the url? If it is here is a failed deployment: 0c17b6db-d8d5-4238-86e2-c4eda75b4ff4
s
I would probably just try using
fetch
and seeing what errors come locally from that - a lot of libraries that wrap fetching will use things like
net
and
http
node internals, that the workers runtime isn't able to (easily) replicate
a
here is the error locally 🤔 When I remove the cloudflare adapter it works. I think it's something related to
miniflare
right?
s
You're using
wrangler pages dev
I assume?
a
nope just added the
solid-start-cloudflare-pages
like the doc suggested
the deployment was successfull but now there is something wrong https://let-it-go.pages.dev/
s
Ah, I guess they manage running wrangler for you. You'll probably want to reach out to them to ask how to enable that compatibility flag
a
for now I'm not using anything from cloudflare locally so I can just disable the adapter and it works, but I'll ask on a wrangler/worker channel anyway. but what about the error now that it deployed. do you know something about it? 🤔
s
Its just a 404, that means it can't find an index.html in your output directory
That could be for a number of reasons, but usually it's because the wrong output folder has been set in your pages project settings
a
strange. I followed the instructions on https://developers.cloudflare.com/pages/framework-guides/deploy-a-solid-site/ and it said to put a `dist/public`as
Build directory
🤔
oh
I think it's my mistake
added a new environment variable and forgot to add on the pages settings 🤣 let me re-deploy and see if it fix 😄
nope it didn't work 🤔
s
I'm unfortunately not very familiar with the solid framework, it seems like they have a Discord server at https://discord.com/invite/solidjs which might be able to help you better?
a
Oh ok
Thank you for you help 🥰