Skip to content
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

disableSSG from hono/ssg is not work with HonoX #58

Closed
berlysia opened this issue Feb 15, 2024 · 4 comments
Closed

disableSSG from hono/ssg is not work with HonoX #58

berlysia opened this issue Feb 15, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@berlysia
Copy link
Contributor

berlysia commented Feb 15, 2024

What version of HonoX are you using?

0.1.1

What steps can reproduce the bug?

  1. npx create hono@latest , select "x-basic"
  2. Add routes using Hono instance or createRoute and use disableSSG from "hono/ssg"
  3. Generate pages by build.ts that runs https://github.com/honojs/vite-plugins/blob/55e3abfb8017c7ee9606458da665e3f09e0d428f/packages/ssg/src/ssg.ts#L34-L50 , or use "@hono/vite-ssg"
  4. Generated codes include text files that contains "SSG is disabled"

What is the expected behavior?

Not even a text file containing "SSG is disabled" is left behind, and nothing is generated from the disableSSG route.

What do you see instead?

Text files that contains "SSG is disabled"

Additional information

This is runtime agnostic issue. Reproduced in Node v21.6.0, Bun 1.0.23, Deno 1.39.4

@berlysia berlysia added the bug Something isn't working label Feb 15, 2024
@berlysia
Copy link
Contributor Author

Maybe I should write this in https://github.com/honojs/hono ?

@usualoma
Copy link
Member

Hi @berlysia. Thank you!

I believe this is a regression due to the following change.
This mechanism did not work when notFound was wrapped in jsxRenderer as in honox
honojs/hono#2179

However, I also believe that this problem is not due to the PR above, but rather to the "output of a page that returns a 404".
I think the following issues also need to be discussed at the same time
honojs/hono#2180

P.S.
If you have stream enabled, maybe the following issues are also relevant.
honojs/hono#2218

@berlysia
Copy link
Contributor Author

berlysia commented Feb 16, 2024

In my another investigation says this issue's key line is here (by good old console debug):

https://github.com/honojs/hono/blob/553d555e096855686b64cfb56c9560606c379396/src/helper/ssg/index.ts#L154

I don't know why currently. And what's even weirder is that it works when pure hono and @hono/vite-ssg ...

@berlysia
Copy link
Contributor Author

Resolved by honojs/hono#2477 , thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants