![](/img/trans.png)
[英]SCSS npm is not compiling CSS when I use -w "watch:sass"
[英]'a is undefined' when compiling a cljs prj with an NPM module under :prod profile
我遵循了此方法: http : //blob.tomerweller.com/reagent-import-react-components-from-npm ,它的效果很好。 在这个重新设计的示例应用程序的顶部,我什至设法使用了我自己的NPM模块之一: https : //github.com/Day8/re-frame/tree/master/examples/simple/
使用以下命令启动生成的应用程序:
lein clean && lein figwheel
一切正常,但是当我这样做时:
lein do clean, with-profile prod compile
我收到TypeError: a is undefined
。 有解决这个问题的主意吗?
让我为您提供代码:错误的提交在这里 ,而:dev
和:prod
配置文件在上一次提交时都可以正常工作。
更新 :我设法修复了这样的编译版本(请参阅commit ):
return d.c?d.c(c,v,w):d.call(null,c,v,w)}}(G,r,b,c,d,e)),I=dw(G);rf.b?: […]
};w.b=v;w.c=f;return w}()}(c,d,e,f))};hf.b(ow,ik);hf.b(ow,bp);hf.b(ow,To); […]
function nx(a){var b=window.deps["react-mathjax"],
- c=window.deps.clubexpr.kf;
+ c=window.deps.clubexpr.renderLispAsLaTeX;
return new U(null,3,5,V,[Vj,b.Context,new U(null,4,null)}
function Wv(){return function(a){return function(){return new U(null,6,5,V,[…]
在我看来,这似乎是编译错误或错误。
更新2 :如果将:optimizations
设置为:simple
(是:advanced
),我的代码将编译正常。 有关此选项,请参见cljs编译器文档 。
谢谢。
失败的代码在这里 。
看来您可能需要为clubexpr提供extern,以便Closure编译器知道不将renderLispAsLatex
重写为kf
。 在:simple下进行编译时,Closure Compiler不会重写函数名称,因此不会出现此问题。
附带说明一下,您可能不应该使用aget
从窗口获取对象, aget
仅设计用于数组访问。 要获取对象,您应该使用goog.object/get
。 有关更多信息,请参见Checked Array Access上的这篇文章。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.