Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

服务端渲染 / SSR中使用报错 #4228

Closed
Przeblysk opened this issue Oct 20, 2021 · 7 comments
Closed

服务端渲染 / SSR中使用报错 #4228

Przeblysk opened this issue Oct 20, 2021 · 7 comments
Labels
pending Need more information to continue

Comments

@Przeblysk
Copy link
Contributor

:root {
^

SyntaxError: Unexpected token ':'
    at wrapSafe (internal/modules/cjs/loader.js:979:16)
    at Module._compile (internal/modules/cjs/loader.js:1027:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/mac/BabyCare/SSRProject/frontend-bckid-wap-ssr2/node_modules/antd-mobile/cjs/global/index.js:3:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
@awmleer
Copy link
Member

awmleer commented Oct 20, 2021

请提供一下具体的信息哈:

你使用的脚手架是?
antd-mobile 的版本号是?
你是如何在项目中引入 antd-mobile 的?

@awmleer awmleer added the pending Need more information to continue label Oct 20, 2021
@Przeblysk
Copy link
Contributor Author

Przeblysk commented Oct 20, 2021

脚手架:http://doc.ssr-fc.com/
antd-mobile 的版本号:5.0.0-beta.18
按照官网的使用方式直接引入的

import { Button } from 'antd-mobile'

麻烦了哈😀

@awmleer
Copy link
Member

awmleer commented Oct 20, 2021

怀疑可能是这个 SSR 框架的问题,可以在他们的 GitHub 仓库里也提个 issue 哈:https://github.com/ykfe/ssr

@zhangyuang
Copy link

module.exports = {
    whiteList: [/antd-mobile/]
}

事实上是 antd-mobile 自己的打包规范跟 antd 不一样,在 js 文件中去 import 样式文件

@zhangyuang
Copy link

@aioros2016
Copy link

@zhangyuang 你给的这个文档里也没有说清楚whiteList具体应该怎么用啊?

@zhangyuang
Copy link

@zhangyuang 你给的这个文档里也没有说清楚whiteList具体应该怎么用啊?

https://doc.ssr-fc.com/docs/api$config#whiteList%F0%9F%A4%94
文档写得很清楚了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending Need more information to continue
Projects
None yet
Development

No branches or pull requests

4 participants