在项目中使用react-fullpage时的GatsbyJS构建过程以Invariant Violation 130错误结束。 开发工作没有任何问题。
react-fullpage: https :
使用react-fullpage构建GatsbyJS。
示例存储库: https :
构建过程应该工作
构建过程结束于Invariant Violation#130错误
系统:
操作系统:Linux 4.16 Fedora 26(Workstation Edition)26(Workstation Edition)
CPU:x64 Intel(R)Core(TM)i5-4210U CPU @ 1.70GHz
Shell:5.3.1-/ usr / bin / zsh
二进制文件:
节点:8.11.3-〜/ .nvm / versions / node / v8.11.3 / bin / node
纱:1.9.4-/ usr / bin / yarn
npm:5.6.0-〜/ .nvm / versions / node / v8.11.3 / bin / npm
浏览器:
铬:69.0.3497.100
的Firefox:60.0
npmPackages:
盖茨比:^ 2.0.0 => 2.0.19
npmGlobalPackages:
gatsby-cli:1.1.58
@ValidRobot根据react-fullpage
的文档,您应该在使用SSR或预渲染页面时以以下方式(commonjs构建)导入它:
import ReactFullpage from '@fullpage/react-fullpage/dist/react-fullpage-commonjs';
如上更改导入后,您也可以删除gatsby-node.js
。 这应该为您解决此问题。
最有用的评论
@ValidRobot根据
react-fullpage
的文档,您应该在使用SSR或预渲染页面时以以下方式(commonjs构建)导入它:如上更改导入后,您也可以删除
gatsby-node.js
。 这应该为您解决此问题。