MUI-DATATABLES:服务器端渲染“ WebPackError:ReferenceError:未定义窗口”

问题描述 投票:0回答:1
但然后收到:

在以下几行: enter image description herefunction _inheritsLoose(subClass, superClass) { 4 | subClass.prototype = Object.create(superClass.prototype); > 5 | subClass.prototype.constructor = subClass; | ^ 6 | setPrototypeOf(subClass, superClass); 7 | }

通过盖茨比(Gatsby)构建中的构建杂物抛出的东西:

WebpackError: Minified React error #130
从查看版本的历史记录,看起来同样的问题发生了,并已修复在3.1.3中,但似乎回来了。
    

在您的代码中,您需要进行明确检查,直到源更新到源:

{typeof window !== 'undefined' && <MUIDataTable title={""} data={faqData} columns={columns} options={options} /> }

webpack gatsby server-side-rendering mui-datatable
1个回答
0
投票
gatsby build

可以完成,并且控件将在生产中起作用。


最新问题
© www.soinside.com 2019 - 2025. All rights reserved.