未捕获错误EmberJS和Polyfills

时间:2018-02-15 14:54:53

标签: javascript ember.js polyfills

我克隆了一个Ember项目,在运行它时会抛出以下错误:

loader.js:247 Uncaught Error: Could not find module `@ember/polyfills` imported from `radio/initializers/viewport-config`
    at missingModule (loader.js:247)
    at findModule (loader.js:258)
    at Module.findDeps (loader.js:168)
    at findModule (loader.js:262)
    at requireModule (loader.js:24)
    at index.js:18
    at Array.forEach (<anonymous>)
    at exports.default (index.js:15)
    at Module.callback (app.js:13)
    at Module.exports (loader.js:106)

之前我已经安装了ember客户端,phantomJS,我做了bower安装和npm安装以下文件:

Package.json:

{
  "name": "radio",
  "version": "0.0.0",
  "description": "Small description for radio goes here",
  "private": true,
  "directories": {
    "doc": "doc",
    "test": "tests"
  },
  "scripts": {
    "build": "ember build",
    "start": "ember server",
    "test": "ember test",
    "deploy": "**",
    "deploy-prod": "**"
  },
  "repository": "",
  "engines": {
    "node": ">= 0.10.0"
  },
  "author": "",
  "license": "MIT",
  "devDependencies": {
    "broccoli-asset-rev": "^2.4.2",
    "broccoli-sass": "^0.7.0",
    "ember-ajax": "^2.0.1",
    "ember-cli": "2.7.0",
    "ember-cli-app-version": "^1.0.0",
    "ember-cli-babel": "^5.1.6",
    "ember-cli-bourbon": "1.2.2",
    "ember-cli-dependency-checker": "^1.2.0",
    "ember-cli-google-analytics": "1.5.0",
    "ember-cli-htmlbars": "^1.0.3",
    "ember-cli-htmlbars-inline-precompile": "^0.3.1",
    "ember-cli-inject-live-reload": "^1.4.0",
    "ember-cli-jshint": "^1.0.0",
    "ember-cli-meta-tags": "3.0.1",
    "ember-cli-moment-shim": "2.2.1",
    "ember-cli-pace": "0.1.0",
    "ember-cli-qunit": "^2.0.0",
    "ember-cli-release": "^0.2.9",
    "ember-cli-slick": "1.0.14",
    "ember-cli-sri": "^2.1.0",
    "ember-cli-test-loader": "^1.1.0",
    "ember-cli-uglify": "^1.2.0",
    "ember-data": "^2.7.0",
    "ember-export-application-global": "1.1.1",
    "ember-lazy-image": "0.0.15",
    "ember-load-initializers": "^0.5.1",
    "ember-local-storage": "1.3.1",
    "ember-moment": "6.1.0",
    "ember-resize": "0.0.17",
    "ember-resolver": "^2.0.3",
    "ember-responsive": "1.2.7",
    "ember-social": "0.3.0",
    "ember-youtube": "0.8.2",
    "liquid-fire": "0.24.1",
    "loader.js": "^4.0.1"
  }
}

bower.json:

{
  "name": "radio",
  "dependencies": {
    "ember": "~2.7.0",
    "ember-cli-shims": "0.1.1",
    "ember-qunit-notifications": "0.1.0",
    "bourbon": "4.2.6",
    "slick-carousel": "^1.6.0",
    "pace": "^1.0.2",
    "blob-polyfill": "^1.0.20150320"
  }
}

我一直在安装npm / bower几个库来解决polyfills的问题,但我没有找到解决方案,有谁知道如何解决这个问题?问候。

2 个答案:

答案 0 :(得分:0)

如果没有错误消息中提到的文件的实际源代码,很难确定您的问题。

你可能正在使用一个使用新模块结构的ember插件。你必须要么:

  1. 将您的ember版本更新为支持此新模型结构的版本(@ember命名空间)。
  2. 使用旧版本的从属插件,该插件不使用新的模块结构。

答案 1 :(得分:0)

尝试删除ember-lazy-image,似乎它无法正常工作。我最近遇到过那个问题