首页 > 解决方案 > 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

我不知道是什么导致我出现这个错误?有人可以帮我解决这个问题吗?谢谢你。

标签: server-side-renderingangular9

解决方案


你在使用ngx-skeleton-loader吗?所有 > 2.2.1 的版本都通过perf-marks包使用 perf_hooks。

我恢复到 2.2.1。并将尝试为装载机骨架找到不同的解决方案。


推荐阅读