#SSR Issues with deployment on Cloudflare pages

19 messages Β· Page 1 of 1 (latest)

somber juniper
#

I am trying to deploy on Cloudflare Pages a Qwik city fron that is attached to a Directus backend.

Everything seemed to work fine, but I cannot access the front. Every route leads up to a 500 error.

The only logs that I have are:
(error) TypeError: This WritableStream is currently locked to a writer.
and
(error) error [src/routes/layout.tsx] Error: t is not a function

( t is a json file imported like this: import t from '@locales/fr/fr.json')

So not really helpful.


I already have deployed a SSG site with Qwik so I think the issue comes from the directus implementation, but I cannot see what is wrong, as it is only failing when deployed on cloudlfare

somber juniper
#

Ah yeah okay, it seems that Directus cannot be implemented with SSR on thingssuch as cloudlfare pages, only SSG is possible.
The architecture of directus is not made to support serverless functions atm

abstract basalt
somber juniper
#

@abstract basalt as far as I tried no.
To be honest I was really tired yesterday, so I might give it another try today or tomorrow.

But I might have done something wrong so don't take my words as source of truth

abstract basalt
somber juniper
#

Yeah, directus can be self hosted though, which is what I am doing. It works great on a 7$/month heroku dyno πŸ™‚

#

And honestly the tool is really good and they keep on improving it

#

At the time I tried it, I preferred strapi and went for it, but since then, directus outclasses strapi imho

abstract basalt
#

Or is it an issue with the edge?

somber juniper
#

At the moment directus backend cannot be hosted ony a serverless structure as far as I know, so the answer would most likely be no πŸ˜…

somber juniper
#

@abstract basalt
So one of the reason it can fail on cloudflare is because cloudflare pages does not support axios, and the directus client is currently built on top of it.
Directus team is actively working on a new version that does not rely on axios

#

However, I am not sure this is the cause of the issue as even when trying to deploy with vercel I get the exact same issue (although vercel does support axios)

#

It's been 48h I struggle with that, I'm about to give up on the project

gray hull
#

You can try Sanity instead of Directus or Strapi. I have heard only good things. πŸ™‚

gray hull
somber juniper
#

I come from strapi but I abandoned it, directus is better imho.
Heard a lot about sanity but did not give it a try yet.

Directus is very fine but the current sdk is meh.
I will replace it with a custom implementation until the new sdk (which is currently under development) comes alive

modern merlin