Replies: 4 comments
-
React (Server) and Emotion actually does support the same thing, it would be great to add this! |
Beta Was this translation helpful? Give feedback.
-
Not sure if anyone monitors these discussions or if this is where issues come to die. I just ran into a situation where it would be beneficial to have an option to target server components conditionally as well. In Next 13 the compiler fails hard when something like useState is imported from React regardless whether that import is actually used at runtime or not. |
Beta Was this translation helpful? Give feedback.
-
I just tried it and it seems that the Edge Runtime already supports the |
Beta Was this translation helpful? Give feedback.
-
Thanks for letting me know! |
Beta Was this translation helpful? Give feedback.
-
Describe the feature you'd like to request
Api routes configured with
{runtime: 'experimental-edge'}
target"browser"
exports during bundling.Libraries that use conditional exports might want to export different code for server and client. Currently it seems there's no way to target the edge api routes specifically. For users this can result in build errors such as
Dynamic Code Evaluation (e. g. 'eval', 'new Function', 'WebAssembly.compile') not allowed in Edge Runtime
for unwanted browser specific code.Cloudflare workers via wrangler have the option of targetting the
"worker"
export.Describe the solution you'd like
Provide a target which enables libraries to conditionally provide exports for the edge runtime. Potentially re-use the
"worker"
condition.Describe alternatives you've considered
Don't see other options.
Beta Was this translation helpful? Give feedback.
All reactions