【问题标题】:How to I debug systemJS error loading js as "" from如何调试systemJS错误将js加载为“”
【发布时间】:2018-04-20 02:07:00
【问题描述】:

我收到以下错误:

system.src.js:123 Uncaught (in promise) Error: (SystemJS) XHR error (404 Not Found) loading http://localhost:8000/dist/jquery.js
    Error: XHR error (404 Not Found) loading http://localhost:8000/dist/jquery.js
    Error loading http://localhost:8000/dist/jquery.js as "jquery" from http://localhost:8000/jspm_packages/npm/toastr@2.1.2/toastr.js

我该如何解决这个问题?

我已经完成了npm installjspm install

谢谢!

【问题讨论】:

  • 您能分享更多详细信息,例如指向 plunker 或 gistrun 的链接吗?根据错误,找不到jquery.js is dist 文件夹。请检查该文件是否存在于正确的位置。

标签: npm aurelia systemjs jspm


【解决方案1】:

您需要确保 jquery 映射到 node_modules 中的正确路径,并且任何依赖 jquery 的模块都明确声明了依赖项:

map: {
  'jquery' : 'path_to_jquery'
},
meta: {
  'file_that depends_on_jquery' : {
    deps: ['jquery']
  }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-03-16
    • 1970-01-01
    • 1970-01-01
    • 2017-07-09
    • 2010-12-16
    • 1970-01-01
    • 2018-07-18
    • 1970-01-01
    相关资源
    最近更新 更多