首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >成员3.6.1升级后注入未知注入:“服务:-文档”

成员3.6.1升级后注入未知注入:“服务:-文档”
EN

Stack Overflow用户
提问于 2020-02-03 09:18:22
回答 1查看 531关注 0票数 0

因此,我目前正在尝试更新最初版本为3.0.2的EmberJS应用程序。首先,我的应用程序运行在3.2上。然后,我进一步升级,在我的浏览器控制台中受到了Error: Assertion Failed: Attempting to inject an unknown injection: 'service:-document'的欢迎。

该应用程序使用ember serve成功构建,但我只有一个白色屏幕旁边的错误,堆栈跟踪也是绝对无用的。唯一提到这样的错误是一个github问题在ember-wormhole上的一个更老的成员版本,我甚至没有在我的应用程序中使用这个插件。我还意识到,在执行app.js之后,应用程序会在某个地方消失,但我的初始化程序都没有被调用。

package.json:

代码语言:javascript
复制
"devDependencies": {
    "@babel/plugin-transform-block-scoping": "^7.8.3",
    "@sentry/browser": "^5.6.3",
    "@sentry/integrations": "^5.6.1",
    "broccoli-asset-rev": "^2.7.0",
    "ember-ajax": "^3.1.0",
    "ember-array-contains-helper": "^2.0.0",
    "ember-auto-import": "1.3.0",
    "ember-bootstrap": "^3.1.1",
    "ember-bootstrap-datepicker": "^2.0.1",
    "ember-changeset": "^2.2.4",
    "ember-changeset-validations": "^2.2.1",
    "ember-cli": "~3.6.1",
    "ember-cli-active-link-wrapper": "^0.5.0",
    "ember-cli-app-version": "^3.2.0",
    "ember-cli-babel": "^7.1.2",
    "ember-cli-code-coverage": "^0.4.1",
    "ember-cli-dependency-checker": "^3.0.0",
    "ember-cli-dependency-lint": "^1.0.2",
    "ember-cli-eslint": "^4.2.3",
    "ember-cli-htmlbars": "^4.2.2",
    "ember-cli-icon-rating": "^2.0.1",
    "ember-cli-inject-live-reload": "^1.8.2",
    "ember-cli-page-object": "^1.11.0",
    "ember-cli-sass": "^7.0.0",
    "ember-cli-sticky": "^0.6.4",
    "ember-cli-string-helpers": "^2.0.0",
    "ember-cli-template-lint": "^1.0.0-beta.1",
    "ember-cli-uglify": "^2.1.0",
    "ember-collapsible-panel": "^3.2.1",
    "ember-composable-helpers": "^2.0.1",
    "ember-confirm-dialog": "^1.3.0",
    "ember-countries": "^2.0.2",
    "ember-data": "~3.6.0",
    "ember-form-for-intl": "^1.0.6",
    "ember-i18n-iso-countries": "^1.5.0",
    "ember-keyboard": "^4.0.0",
    "ember-keycloak-auth": "~0.3.0",
    "ember-load-initializers": "^2.1.1",
    "ember-moment": "8.0.0",
    "ember-notify": "^5.2.0",
    "ember-pikaday": "2.4.1",
    "ember-power-select-with-create": "^0.6.0",
    "ember-qunit": "^3.4.1",
    "ember-resolver": "~5.3.0",
    "ember-route-action-helper": "^2.0.3",
    "ember-source": "~3.6.0",
    "ember-toggle": "^5.3.2",
    "eslint-config-prettier": "^4.3.0",
    "eslint-plugin-ember": "^5.2.0",
    "eslint-plugin-prettier": "^3.1.0",
    "husky": "^2.3.0",
    "keycloak-js": "^8.0.1",
    "lint-staged": "^8.1.7",
    "loader.js": "^4.7.0",
    "prettier": "1.17.1",
    "qunit-dom": "^0.8.0",
    "ui-ember-slider": "github:ifad/ui-slider",
    "watchman": "^1.0.0"
  },
  "engines": {
    "node": "6.* || 8.* || >= 10.*"
  },
  "dependencies": {
    "@babel/core": "7.8.4",
    "bootstrap": "^4.3.1",
    "bootstrap-slider": "^10.6.1",
    "ember-cli-update": "^0.27.1",
    "ember-intl": "^4.2.3",
    "global": "^4.4.0",
    "jquery": "^3.4.1",
    "npm": "^5.7.1",
    "popper.js": "^1.16.0",
    "to": "^0.2.9",
    "update": "^0.7.4"
  }

app.js:

代码语言:javascript
复制
import Application from "@ember/application";
import RSVP from "rsvp";
import Resolver from "./resolver";
import loadInitializers from "ember-load-initializers";
import config from "./config/environment";
import $ from "jquery";

window.Promise = RSVP.Promise;

const App = Application.extend({
  modulePrefix: config.modulePrefix,
  podModulePrefix: config.podModulePrefix,
  Resolver
});

$.getJSON("/api/env_settings", function(envSettings) {
  config.sentryDsn = envSettings.sentry;
  config.keycloak.url = envSettings.keycloak.url;
  config.keycloak.realm = envSettings.keycloak.realm;
  config.keycloak.clientId = envSettings.keycloak.clientId;
  config.keycloak.secret = envSettings.keycloak.secret;
  config.helplink = envSettings.helplink;
  config.keycloak.disable = envSettings.keycloak.disable;
});

loadInitializers(App, config.modulePrefix);
export default App;

有什么办法造成这个问题吗?

快速更新:

我还尝试将我的应用程序直接升级到3.15.2,这导致了同样的错误.

另一个更新:

堆栈跟踪如下所示:

代码语言:javascript
复制
Error: Assertion Failed: Attempting to inject an unknown injection: 'service:-document' vendor.js:54143:15
    assert http://localhost:4200/assets/vendor.js:54143
    validateInjections http://localhost:4200/assets/vendor.js:17702
    processInjections http://localhost:4200/assets/vendor.js:16916
    buildInjections http://localhost:4200/assets/vendor.js:16956
    injectionsFor http://localhost:4200/assets/vendor.js:16970
    create http://localhost:4200/assets/vendor.js:17036
    instantiateFactory http://localhost:4200/assets/vendor.js:16896
    _lookup http://localhost:4200/assets/vendor.js:16828
    processInjections http://localhost:4200/assets/vendor.js:16936
    buildInjections http://localhost:4200/assets/vendor.js:16956
    injectionsFor http://localhost:4200/assets/vendor.js:16970
    create http://localhost:4200/assets/vendor.js:17036
    instantiateFactory http://localhost:4200/assets/vendor.js:16896
    _lookup http://localhost:4200/assets/vendor.js:16828
    processInjections http://localhost:4200/assets/vendor.js:16936
    buildInjections http://localhost:4200/assets/vendor.js:16952
    injectionsFor http://localhost:4200/assets/vendor.js:16970
    create http://localhost:4200/assets/vendor.js:17036
    instantiateFactory http://localhost:4200/assets/vendor.js:16896
    _lookup http://localhost:4200/assets/vendor.js:16828
    lookup http://localhost:4200/assets/vendor.js:16666
    lookup http://localhost:4200/assets/vendor.js:45312
    getDOM http://localhost:4200/assets/vendor.js:163053
    updateDocumentLanguage http://localhost:4200/assets/vendor.js:163000
    set http://localhost:4200/assets/vendor.js:162810
    _set http://localhost:4200/assets/vendor.js:34139
    set http://localhost:4200/assets/vendor.js:34080
    CPSETTER_FUNCTION http://localhost:4200/assets/vendor.js:31584
    _set2 http://localhost:4200/assets/vendor.js:33493
    setLocale http://localhost:4200/assets/vendor.js:162946
    init http://localhost:4200/assets/vendor.js:162862
    superWrapper http://localhost:4200/assets/vendor.js:48884
    initialize http://localhost:4200/assets/vendor.js:47083
    create http://localhost:4200/assets/vendor.js:47667
    create http://localhost:4200/assets/vendor.js:17092
    instantiateFactory http://localhost:4200/assets/vendor.js:16896
    _lookup http://localhost:4200/assets/vendor.js:16828
    lookup http://localhost:4200/assets/vendor.js:16666
    initialize http://localhost:4200/assets/frontend.js:8767
    runInitializers http://localhost:4200/assets/vendor.js:54873
    each http://localhost:4200/assets/vendor.js:73443
    walk http://localhost:4200/assets/vendor.js:73357
    each http://localhost:4200/assets/vendor.js:73287
    topsort http://localhost:4200/assets/vendor.js:73295
    _runInitializer http://localhost:4200/assets/vendor.js:54899
    runInitializers http://localhost:4200/assets/vendor.js:54871
    _bootSync http://localhost:4200/assets/vendor.js:53180
    domReady http://localhost:4200/assets/vendor.js:53080
    _run http://localhost:4200/assets/vendor.js:72991
    _join http://localhost:4200/assets/vendor.js:72967
    join http://localhost:4200/assets/vendor.js:72684
    join http://localhost:4200/assets/vendor.js:59338
    bind http://localhost:4200/assets/vendor.js:59442
    mightThrow http://localhost:4200/assets/vendor.js:9158
    process http://localhost:4200/assets/vendor.js:9226

在应用程序的3.2个版本上使用ember-inspector,我试图在ember-inspector服务中的容器下面找到服务:-document。遗憾的是我也找不到那里的服务..。

EN

回答 1

Stack Overflow用户

发布于 2020-02-05 14:42:16

正如@Lux所说,堆栈轨迹是支点。对initialize函数的一个调用由一个ember-form-for-intl调用,该调用在该版本中被中断。因此,我刚刚移除它,并使它正常工作。

非常感谢!!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60036189

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档