gpt4 book ai didi

使用 isDevMode 的 Angular AOT 给出错误

转载 作者:太空狗 更新时间:2023-10-29 18:24:55 26 4
gpt4 key购买 nike

当使用 isDevMode() 时,JIT 构建工作正常,而 AOT 声明失败

Error: Error encountered resolving symbol values statically. Calling function 'isDevMode', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function

尝试创建这样的导出函数,但没有成功

export function isDevModeEnabled() {
return isDevMode();
}

最佳答案

所以我也遇到了这个错误,并提出了一个问题here . Angular 2 开发团队的官方回应是这不是一个错误:

I believe this is an intended behaviour. The solution is to move isDevMode() out of the annotation. (By defining to a variable)

官方的解决方案是:

[...] You will need to set the return value to a variable, and use the variable rather than calling the function when wiring up the NgModule.

关于使用 isDevMode 的 Angular AOT 给出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46363596/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com