首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >React-loadable不适用于css模块

React-loadable不适用于css模块
EN

Stack Overflow用户
提问于 2018-11-17 22:26:24
回答 1查看 630关注 0票数 0

我根据React-loadable文档做了所有的工作,但它不能与css模块一起工作。

我使用的是服务器端渲染。

客户端上的错误:

代码语言:javascript
复制
TypeError: Cannot read property 'call' of undefined
    at __webpack_require__ (bundle.js:768)
    at fn (bundle.js:131)
    at eval (Comments.css?./node_modules/css-loader??ref--6-2:1)
    at Object../node_modules/css-loader/index.js?!./app/components/comment/Comments/Comments.css (1.bundle.js:440)
    at __webpack_require__ (bundle.js:768)
    at fn (bundle.js:131)
    at eval (Comments.css:2)
    at Object../app/components/comment/Comments/Comments.css (1.bundle.js:115)
    at __webpack_require__ (bundle.js:768)
    at fn (bundle.js:131)

服务器上的错误:

代码语言:javascript
复制
Warning: setState(...): Can only update a mounting component. This usually means you called setState() outside componentWillMount() on the server. This is a no-op.

Please check the code for the LoadableComponent component.
ReferenceError: window is not defined
    at eval (webpack:///./node_modules/style-loader/lib/addStyles.js?:23:2)
    at eval (webpack:///./node_modules/style-loader/lib/addStyles.js?:12:46)
    at module.exports (webpack:///./node_modules/style-loader/lib/addStyles.js?:77:88)
    at eval (webpack:///./app/components/comment/Comments/Comments.css?:16:143)
    at Object../app/components/comment/Comments/Comments.css (C:\site.dev\react\x\1.server.js:116:1)
    at __webpack_require__ (C:\site.dev\react\x\server.js:26:30)
    at eval (webpack:///./app/components/comment/Comments/index.js?:17:17)
    at Object../app/components/comment/Comments/index.js (C:\site.dev\react\x\1.server.js:128:1)
    at __webpack_require__ (C:\site.dev\react\x\server.js:26:30)
    at __webpack_require__.t (C:\site.dev\react\x\server.js:83:33)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
EN

回答 1

Stack Overflow用户

发布于 2018-11-18 03:12:14

解决了ExtractTextPlugin中添加allChunks: true选项后的问题

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53352126

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档