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

fix: Make <Link /> not async #250

Merged
merged 1 commit into from
Jan 9, 2025
Merged

fix: Make <Link /> not async #250

merged 1 commit into from
Jan 9, 2025

Conversation

4513ECHO
Copy link
Contributor

@4513ECHO 4513ECHO commented Jan 8, 2025

Problem

<Link /> is an async component in spite of unnecessary and because of this causes following error in Deno:

A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.
Error: A component suspended while responding to synchronous input. This will cause the UI to be replaced with a loading indicator. To fix, updates that suspend should be wrapped with startTransition.
    at renderToStringImpl (file:///Users/234531sch/Library/Develops/github.com/4513ECHO/etude-honox-deno/node_modules/.deno/[email protected]/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:7125:15)
    at process.env.NODE_ENV.exports.renderToString (file:///Users/234531sch/Library/Develops/github.com/4513ECHO/etude-honox-deno/node_modules/.deno/[email protected]/node_modules/react-dom/cjs/react-dom-server-legacy.node.development.js:8566:14)
    at Context.eval (/Users/234531sch/Library/Develops/github.com/4513ECHO/etude-honox-deno/node_modules/.deno/@[email protected]/node_modules/@hono/react-renderer/dist/index.js, <anonymous>:26:68)
    at Context.render (/Users/234531sch/Library/Develops/github.com/4513ECHO/etude-honox-deno/node_modules/.deno/[email protected]/node_modules/hono/dist/context.js, <anonymous>:98:26)
    at handler (/Users/234531sch/Library/Develops/github.com/4513ECHO/etude-honox-deno/app/routes/_error.tsx, <anonymous>:10:12)
    at errorHandler (/Users/234531sch/Library/Develops/github.com/4513ECHO/etude-honox-deno/node_modules/.deno/[email protected]/node_modules/honox/dist/server/server.js, <anonymous>:171:20)
    at dispatch (/Users/234531sch/Library/Develops/github.com/4513ECHO/etude-honox-deno/node_modules/.deno/[email protected]/node_modules/hono/dist/compose.js, <anonymous>:38:25)
    at async handler (/Users/234531sch/Library/Develops/github.com/4513ECHO/etude-honox-deno/node_modules/.deno/[email protected]/node_modules/hono/dist/hono-base.js, <anonymous>:95:39)
    at async dispatch (/Users/234531sch/Library/Develops/github.com/4513ECHO/etude-honox-deno/node_modules/.deno/[email protected]/node_modules/hono/dist/compose.js, <anonymous>:32:17)
    at async Object.innerMeta [as handler] (/Users/234531sch/Library/Develops/github.com/4513ECHO/etude-honox-deno/node_modules/.deno/[email protected]/node_modules/honox/dist/server/server.js, <anonymous>:85:11)

Solution

I have removed async declation.

@yusukebe
Copy link
Member

yusukebe commented Jan 9, 2025

Hi @4513ECHO

I've struggled to add an e2e test using Deno to test something like this fix. But, currently, I can't. I'll merge this now, though it can't be tested. We have to keep trying to add an e2e test on Deno. Thanks!

Copy link
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yusukebe yusukebe merged commit 04fc5e6 into honojs:main Jan 9, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants