【问题标题】:Starting Remix project with netlify but got this error : Unexpected Server Error使用 netlify 启动 Remix 项目但收到此错误:意外的服务器错误
【发布时间】:2022-07-18 22:52:43
【问题描述】:

我刚刚使用 remix 和 netlify 开始了一个新项目,它可以在生产中运行,但是当我使用 npm run dev 并转到 localhost:3000 时,我得到了这个:

Unexpected Server Error

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

这很奇怪,因为它可以在生产中使用,而我现在所做的只是遵循 README 文件

【问题讨论】:

    标签: node.js reactjs netlify remix.run


    【解决方案1】:

    我只是忘了运行 posinstall 脚本,它不在自述文件中,而是在文档中

    npm run postinstall
    

    【讨论】:

      猜你喜欢
      • 2018-03-16
      • 1970-01-01
      • 1970-01-01
      • 2020-08-27
      • 2018-12-10
      • 2013-05-26
      • 1970-01-01
      • 2020-09-27
      • 1970-01-01
      相关资源
      最近更新 更多