diff --git a/packages/compiler-sfc/__tests__/cssVars.spec.ts b/packages/compiler-sfc/__tests__/cssVars.spec.ts
index ffa5d4e798b..05e5f689ac9 100644
--- a/packages/compiler-sfc/__tests__/cssVars.spec.ts
+++ b/packages/compiler-sfc/__tests__/cssVars.spec.ts
@@ -255,5 +255,22 @@ describe('CSS vars injection', () => {
)
expect(cssVars).toMatchObject([`count.toString(`, `xxx`])
})
+
+ // #7759
+ test('It should correctly parse the case where there is no space after the script tag', () => {
+ const { content } = compileSFCScript(
+ `
+ `
+ )
+ expect(content).toMatch(
+ `export default {\n setup(__props, { expose }) {\n expose();\n\n_useCssVars(_ctx => ({\n "xxxxxxxx-background": (_unref(background))\n}))`
+ )
+ })
})
})