BigCommerce Bundle.js模板主题的错误



我在本地使用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...而不是$(window).load(function...

让我知道您是否需要其他任何东西。

谢谢。


****下面添加了01-09-2017 ****


我让某人在本地安装模具,然后将主题下载到他们的计算机上,但他们没有遇到任何错误,并且页面工作正常。我让他将文件上传到BigCommerce Backend中,并将其应用于商店,因为它现在正在运行。然后,我下载了现在正常工作的主题,然后在我的计算机上本地运行它,并再次遇到了错误。由于我遇到了这个主题的错误,而另一个人则不是,所以我认为我正在使用的一个库是旧的,需要更新。你怎么看?

谢谢大家的帮助。由于我遇到了错误,而今天刚刚安装模版的人并非如此,所以我认为这与我的依赖关系过时有关。我做了以下操作,它解决了问题:

  1. stencil目录中的打开git bash
  2. 运行npm install && jspm install
  3. 运行stencil init
  4. stencil init运行后,导航到/资产/JS并删除bundle.js文件。
  5. 重新运行stencil init
  6. 运行stencil start

相关内容

最新更新