From 070869443548e4d8458f55621df772eac0093b6f Mon Sep 17 00:00:00 2001 From: daeunnniii <66058870+daeunnniii@users.noreply.github.com> Date: Wed, 17 Dec 2025 10:41:13 +0900 Subject: [PATCH] fix: avoid ERR_REQUIRE_ESM during reflex export with rx.code_block Fixes #6054 --- reflex/compiler/templates.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/reflex/compiler/templates.py b/reflex/compiler/templates.py index 2abcb6dd533..7bff8ef3441 100644 --- a/reflex/compiler/templates.py +++ b/reflex/compiler/templates.py @@ -581,6 +581,11 @@ def vite_config_template( }}, }}, }}, + ssr: {{ + noExternal: config.command === "build" + ? ["react-syntax-highlighter", "refractor"] + : [], + }}, experimental: {{ enableNativePlugin: false, hmr: {"true" if experimental_hmr else "false"},