ant-design / ant-design-mobile

Essential UI blocks for building mobile web apps.

Home Page:https://mobile.ant.design

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

在egg.js ssr项目编译失败,无法识别global.css文件的 :root 伪类,请问如何解决?

fangpeijie opened this issue · comments

Version of antd-mobile

5.33.0

Description

server render bundle error, try client render, the server render error D:\项目\node_modules\antd-mobile\cjs\global\global.css:1
:root {
^

SyntaxError: Unexpected token ':'
at compileFunction ()
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1124:15)
at Module._compile (node:internal/modules/cjs/loader:1160:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
at Object.require.extensions. [as .js] (D:\项目\node_modules\ts-node\src\index.ts:431:14)
at Module.load (node:internal/modules/cjs/loader:1074:32)
at Function.Module._load (node:internal/modules/cjs/loader:909:12)
at Module.require (node:internal/modules/cjs/loader:1098:19)
at require (node:internal/modules/cjs/helpers:108:18)

Hi, fangpeijie.

Please provide a online reproduction so that we can help you troubleshoot the problem. You can create a demo by codesandbox or stackblitz.

我们需要你提供一个在线的重现实例,以便于我们帮你排查问题。你可以通过 codesandboxstackblitz 创建一个实例。