Stack Overflow на русском Asked by Vayas on February 19, 2021
Я использую тестовый проект для изучение Vue в связке с TypeScript
В проекте используется DI с помощью библиотеки inversify-props
После публикации на сервер в домашнюю папку nginx, в консоли браузера я получаю следующую ошибку:
Uncaught (in promise) Error: No matching bindings found for serviceIdentifier: Symbol(GameService)
at y (planner.js:62)
at g (planner.js:48)
at b (planner.js:85)
at Object.w [as plan] (planner.js:136)
at container.js:317
at t.e._get (container.js:310)
at t.e.get (container.js:230)
at t.get (container.js:60)
at Object.get (inject.helper.js:65)
at Object.getOwnPropertyNames.forEach.t.get.n.getters.n.getters.<computed> (index.js:262)
Когда проект запускаю локально, всё работает отлично и нет никаких ошибок.
Подгрузка DI зависимостей происходит через основной класс
class AppBootstrap {
constructor () {
AppBootstrap.loadDependencyContainer()
this.loadVueApp()
}
private static loadDependencyContainer (): void {
container.addTransient<GameServiceI>(GameService)
}
private loadVueApp (): void {
Vue.use(ElementUI)
Vue.config.productionTip = false
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')
}
}
new AppBootstrap()
На проекте используются следующие NPM зависимости
"dependencies": {
"axios": "^0.19.2",
"core-js": "^3.6.4",
"element-ui": "^2.13.0",
"inversify-props": "^2.2.6",
"inversify": "^5.0.1",
"reflect-metadata": "^0.1.13",
"vue": "^2.6.11",
"vue-class-component": "^7.2.2",
"vue-property-decorator": "^8.3.0",
"vue-router": "^3.1.5",
"vuex": "^3.1.2",
"vuex-class": "^0.3.2",
"vuex-module-decorators": "^0.16.1"
},
"devDependencies": {
"@types/jest": "^24.0.19",
"@typescript-eslint/eslint-plugin": "^2.18.0",
"@typescript-eslint/parser": "^2.18.0",
"@vue/cli-plugin-babel": "^4.2.0",
"@vue/cli-plugin-eslint": "^4.2.0",
"@vue/cli-plugin-router": "^4.2.0",
"@vue/cli-plugin-typescript": "^4.2.0",
"@vue/cli-plugin-unit-jest": "^4.2.0",
"@vue/cli-plugin-vuex": "^4.2.0",
"@vue/cli-service": "^4.2.0",
"@vue/eslint-config-prettier": "^6.0.0",
"@vue/eslint-config-typescript": "^5.0.1",
"@vue/test-utils": "1.0.0-beta.31",
"eslint": "^6.7.2",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^6.1.2",
"node-sass": "^4.12.0",
"prettier": "^1.19.1",
"sass-loader": "^8.0.2",
"typescript": "~3.7.5",
"vue-template-compiler": "^2.6.11"
}
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP