From 9c2b620570a18e0265da0a64129a5b7fd3f8cfa2 Mon Sep 17 00:00:00 2001 From: Tim Havlicek Date: Mon, 11 Nov 2024 02:13:14 +0100 Subject: [PATCH] fix(plugin-jsx): work around bun bug for ssrRegisterHelper (#380) close #376 --- packages/plugin-vue-jsx/src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/plugin-vue-jsx/src/index.ts b/packages/plugin-vue-jsx/src/index.ts index ef96326c..79a2976c 100644 --- a/packages/plugin-vue-jsx/src/index.ts +++ b/packages/plugin-vue-jsx/src/index.ts @@ -13,7 +13,10 @@ export * from './types' const ssrRegisterHelperId = '/__vue-jsx-ssr-register-helper' const ssrRegisterHelperCode = `import { useSSRContext } from "vue"\n` + - `export ${ssrRegisterHelper.toString()}` + // the const here is just to work around the Bun bug where + // Function.toString() isn't working as intended + // https://github.com/oven-sh/bun/issues/9543 + `export const ssrRegisterHelper = ${ssrRegisterHelper.toString()}` /** * This function is serialized with toString() and evaluated as a virtual