denoland / fresh-wordpress-themes

https://wp-blog-example.deno.dev/ https://wp-sweets-co.deno.dev/
https://deno.com/blog/introducing-fresh-wordpress-themes
52 stars 10 forks source link

An error occured during route handling or page rendering. #15

Open kewp opened 10 months ago

kewp commented 10 months ago

I got an error on first attempt to view localhost:8000:

An error occured during route handling or page rendering.

SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at parse (<anonymous>)
    at packageData (ext:deno_fetch/22_body.js:369:14)
    at consumeBody (ext:deno_fetch/22_body.js:246:12)
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async callApi (file:///Users/karl/tmp/fresh-wordpress-themes/blog/utils/wp.ts:49:11)
    at async getPages (file:///Users/karl/tmp/fresh-wordpress-themes/blog/utils/wp.ts:63:19)
    at async Promise.all (index 0)
    at async GET (file:///Users/karl/tmp/fresh-wordpress-themes/blog/routes/index.tsx:26:62)
    at async https://deno.land/x/rutt@0.0.13/mod.ts:228:22
    at async Server.#respond (https://deno.land/std@0.150.0/http/server.ts:298:18)

I should mentioned I needed to change docker-compose.yml to use port 8080:80 since my port 80 is used

Fefe973 commented 1 month ago

I got the same error, Is it working for you right now ? the change you made resolved this error ?

kewp commented 1 month ago

I got the same error, Is it working for you right now ? the change you made resolved this error ?

If I remember correctly it did fix the error

Fefe973 commented 1 month ago

Ok ! Can you explain me how you did that, because i changed the port in docker-compose.yml like you did but then i suppose i also need to change the app port, where should I do this? sorry i'm a lay user.

kewp commented 1 month ago

Ok ! Can you explain me how you did that, because i changed the port in docker-compose.yml like you did but then i suppose i also need to change the app port, where should I do this? sorry i'm a lay user.

I'm actually not sure I'll have to try tomorrow off to bed but I'll let you know

kewp commented 1 month ago

Hmm I just tried it @Fefe973 and everything worked for me - didn't need to change anything, just followed the instructions in the readme:

cd blog
deno task docker
deno task start

browsed to http://localhost:8000 and i see the blog.

don't even remember trying to use this, to be honest ...

Fefe973 commented 1 month ago

Ok Thanks for the answer, i don't know if you can help me on this error knowing i'm new to Fresh Framework and on this kind of Wordpress integration, but here is what i get :

WP_API and WP_COM_DOMAIN env vars are not set. Using default WP_API (http://localhost/wp-json)

It's pity that there isn't more documentation on how to use and configure Deno fresh Wordpress Themes, maybe i'm missing some informations sources i don't know ...

kewp commented 1 month ago

Not sure what to suggest. Wordpress integration? All I did was run two commands ... it sounds like you're trying to do something more complex.

This isn't really the place for this kind of chat. Have you tried the Deno discord?

kewp commented 1 month ago

I only had docker installed and followed the instructions

On Sat, 03 Aug 2024 at 19:51, Fefe973 @.***> wrote:

Yes i know it's not really the place, i will find a solution by myself and write it down here, but just a last question : Did you have to install docker and wordpress in localhost before running these commands ? Or you only followed instructions in the read me file ?

— Reply to this email directly, view it on GitHub https://github.com/denoland/fresh-wordpress-themes/issues/15#issuecomment-2266703504, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADAY2XYDVREQOS3KT2AUIDZPTG6RAVCNFSM6AAAAABLW7DRWGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRWG4YDGNJQGQ . You are receiving this because you authored the thread.Message ID: @.***>