server-side-rendering - angular ssr mod.require 不是函数
问题描述
我正在开发一个角度 ssr 应用程序。当我这样做时npm run dev:ssr
,我收到以下错误
Your NodeJS application doesn't support 'perf_hooks'. TypeError: mod.require is not a function
A server error has occurred.
node exited with 1 code.
connect ECONNREFUSED 127.0.0.1:54208
我不知道是什么导致我出现这个错误?有人可以帮我解决这个问题吗?谢谢你。
解决方案
你在使用ngx-skeleton-loader吗?所有 > 2.2.1 的版本都通过perf-marks包使用 perf_hooks。
我恢复到 2.2.1。并将尝试为装载机骨架找到不同的解决方案。
推荐阅读
- javascript - 如何在不使用全局范围或 redux 的情况下在 react-native 中使用全局变量?
- c++ - 禁止“使用‘X’属性是 C++17 扩展”警告
- javascript - 如何移动此图像的位置?
- vbscript - 未在 For 循环中设置对象变量
- rest - 类似于 REST 但也使用像 GraphQL 这样的突变的 API?
- graphql - 检查自定义客户端解析器中的查询类型或突变字段
- r - 根据分类运行进行总结
- regex - 如何替换六个字符的倍数后的序列?
- jenkins - Jenkins Pipeline 脚本中逻辑 Groovy 运算符的问题
- c++ - 使用 void 指针:void **ptr... 如何修改共享内存的值?