我构建的 React 网站在
npm run start
中完美运行。但是,在我运行 npm run build
并打开 build 文件夹下的 index.html
文件后,它是空白的(没有渲染任何东西)。我检查了控制台,发现我得到的唯一错误是:
Uncaught TypeError: Super expression must either be null or a function
at image-gallery.js:1020:1
at image-gallery.js:1019:1
at image-gallery.js:1018:1
at image-gallery.js:314:1
at Object.<anonymous> (image-gallery.js:4:1)
at Object.<anonymous> (image-gallery.js:4:1)
at f (index.html:1:1181)
at 205 (Footer.js:24:29)
at f (index.html:1:1181)
at 162 (main.94d179ed.chunk.js:1:110)
我在网上查了很多资源并询问了 ChatGPT,我得到的所有信息都与超类有关,并且在我的代码中使用了
extends
错误等。但是,我根本没有使用任何这些,也找不到任何一个 extends
或我的代码中的文件image-gallery.js
。