Sprockets :: CircularDependencyError application.js已经被要求 [英] Sprockets::CircularDependencyError application.js has already been required

查看:156
本文介绍了Sprockets :: CircularDependencyError application.js已经被要求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我收到一个Sprockets :: CircularDependencyError application.js已经被要求。这会影响我应用程序中的每个页面,因为没有加载JS。注意 - 这个错误发生在相当复杂的合并之后。

我的假设(如果我错了,请纠正我)是因为两个不同的文件需要application.js而发生此错误。如果是这样,我应该在哪些文件中调试这个错误?我怎么能测试我的应用程序,以确定哪些文件已经需要application.js?



非常感谢您的帮助。我很乐意提供任何有关的信息。

解决方案


这个错误发生在相当复杂的合并之后。 b

我确信冲突肯定会出现在 application.js 文件中。你可能没有删除你的版本控制为你创建的额外的application.js。*文件,这两个文件都有 require tree 或其他东西。需要彼此循环依赖。确保该文件夹中没有这样的额外文件...


In my application, I receive a Sprockets::CircularDependencyError application.js has already been required. This affects every page in my application because none of the JS loads. Note - this error occurred after a fairly complex merge.

My assumption (please correct me if I'm wrong) is that this error occurs because two different files require application.js. If so, in which files should I look to debug this error? How could I test my application to determine what files are already requiring application.js?

Thank you very much for any help. I'd be more than happy to supply any pertinent information.

解决方案

"this error occurred after a fairly complex merge. "

I'm sure the conflict would surely be in the application.js file too.. After the merge you might not have removed the extra application.js.* file your version control creates for you, where both of them would be having line of require tree or something.. i.e. both requiring each other thus circular dependency. Make sure there is no such extra file in that folder...

这篇关于Sprockets :: CircularDependencyError application.js已经被要求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆