[英]Error with Bigcommerce bundle.js stencil theme
我在本地使用Bigcommerce模具框架时遇到了一些麻烦。 我可以使一切正常运行,但是在页面加载时出现以下错误:
Uncaught TypeError: url.indexOf is not a function
at jQuery.fn.init.jQuery.fn.load (eval at <anonymous> (bundle.js:1835), <anonymous>:9793:13)
at Object.init (eval at <anonymous> (bundle.js:1907), <anonymous>:345:17)
at HTMLDocument.eval (eval at <anonymous> (bundle.js:1907), <anonymous>:727:23)
at Function.each (eval at <anonymous> (bundle.js:1835), <anonymous>:368:19)
at jQuery.fn.init.each (eval at <anonymous> (bundle.js:1835), <anonymous>:157:17)
at jQuery.fn.init.$.fn.foundation (eval at <anonymous> (bundle.js:1907), <anonymous>:726:17)
at exports.default (eval at <anonymous> (bundle.js:2063), <anonymous>:6:14)
at Global.loaded (eval at <anonymous> (bundle.js:2249), <anonymous>:99:34)
at eval (eval at <anonymous> (bundle.js:1841), <anonymous>:718:13)
at iterate (eval at <anonymous> (bundle.js:1841), <anonymous>:262:13)
我使用这篇文章jquery 3.0 url.indexOf错误将$(window).load(function...
更改$(window).on('load', function...
就像它说的那样,这似乎可以解决问题。
但是,每次加载页面时都会重新创建bundle.js文件,它会自动生成$(window).load(函数,这就是导致此问题的原因。
有谁知道我在哪里可以找到生成的内容,因此我可以确保它加载正确的$(window).on('load', function...
INSTEAD of $(window).load(function...
需要帮助请叫我。
谢谢。
****下面添加了2017/01/09 ****
我让某人在本地安装模具并将主题下载到他们的计算机上,他们没有收到任何错误,并且页面运行正常。 我让他将文件上传到bigcommerce后端,然后将其应用于商店,因为它现在可以正常工作了。 然后,我下载了现在可以使用的主题,并在我的计算机上本地运行了该主题,再次遇到错误。 由于我在使用此主题时遇到错误,而其他人则没有,因此我认为我正在使用的一个库较旧,需要更新。 你怎么看?
感谢大家的帮助。 由于我遇到了错误,而今天刚脱机安装模具的人却没有,我认为这与我的依赖关系过时有关。 我做了以下工作,它解决了问题:
stencil
目录中打开git bash npm install && jspm install
stencil init
stencil init
运行后,导航至/ assets / js并删除bundle.js文件。 stencil init
stencil start
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.