Replies: 1 comment 5 replies
-
@haishanh Can you clarify why you are using a Route Handler for this instead of just using a regular component? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Link to the code that reproduces this issue
https://github.com/haishanh/nextjs-react-dom-render-reprod
To Reproduce
Current vs. Expected behavior
I expect no error on importing "react-dom/server" in route.ts. In my route.ts
GET
method, I'd like to render html string templated using React. It maybe not a very common use case, given we are using Next.js, but should be a legit one.Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.1.0: Thu Nov 14 18:19:02 PST 2024; root:xnu-11215.41.3~13/RELEASE_ARM64_T8132 Available memory (MB): 24576 Available CPU cores: 10 Binaries: Node: 20.18.0 npm: 10.8.2 Yarn: N/A pnpm: 10.4.0 Relevant Packages: next: 15.1.7 // Latest available version is detected (15.1.7). eslint-config-next: 15.1.7 react: 19.0.0 react-dom: 19.0.0 typescript: 5.7.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Module Resolution
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local)
Additional context
What shows in my terminal:
And in the browser:
Beta Was this translation helpful? Give feedback.
All reactions