zhangyuang / egg-react-ssr

最小而美的Egg + React + SSR 服务端渲染应用骨架,同时支持JS和TS
http://doc.ssr-fc.com/
MIT License
1.91k stars 212 forks source link

按需引入antd-mobile报错 #197

Closed Przeblysk closed 4 years ago

Przeblysk commented 4 years ago
Page Controller renderToStream Error 
/node_modules/normalize.css/normalize.css:12
[0] [0] html {
[0] [0]      ^
[0] [0]
[0] [0] SyntaxError: Unexpected token '{'
[0] [0]     at wrapSafe (internal/modules/cjs/loader.js:1054:16)
[0] [0]     at Module._compile (internal/modules/cjs/loader.js:1102:27)
[0] [0]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
[0] [0]     at Module.load (internal/modules/cjs/loader.js:986:32)
[0] [0]     at Function.Module._load (internal/modules/cjs/loader.js:879:14)
[0] [0]     at Module.require (internal/modules/cjs/loader.js:1026:19)
[0] [0]     at require (internal/modules/cjs/helpers.js:72:18)
[0] [0]     at Object.<anonymous> (/Users/mac/work/BabyCare/EggProjects/frontend-bckid-widgets/node_modules/antd-mobile/lib/style/css.js:3:1)
[0] [0]     at Module._compile (internal/modules/cjs/loader.js:1138:30)
[0] [0]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
Przeblysk commented 4 years ago

image

zhangyuang commented 4 years ago

参考example/ssr-with-antd

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: Przeblysk <notifications@github.com> 发送时间: 2020年10月16日 13:33 收件人: ykfe/egg-react-ssr <egg-react-ssr@noreply.github.com> 抄送: Subscribed <subscribed@noreply.github.com> 主题: 回复:[ykfe/egg-react-ssr] 按需引入antd-mobile报错 (#197)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Przeblysk commented 4 years ago

没有看到webpack.config.server中的whitelist还要配置,不好意思