TypeError: Cannot read property 'use' of undefined
See original GitHub issue- Node Version: 6.10.0
- Egg Version: 1.0.0-rc.1
- Plugin Name:
- Plugin Version:
- Platform: Linux
app.js
module.exports = app => {
app.view.use('handlebars', require('./lib/view'));
};
执行yarn test
1) test/egg-view-handlebars.test.js render "before all" hook:
TypeError: Cannot read property 'use' of undefined
at module.exports.app (app.js:8:11)
at AppWorkerLoader.loadFile (node_modules/egg-core/lib/loader/egg_loader.js:217:34)
at getLoadUnits.forEach.unit (node_modules/egg-core/lib/loader/mixin/custom.js:25:29)
at Array.forEach (native)
at AppWorkerLoader.loadCustomApp (node_modules/egg-core/lib/loader/mixin/custom.js:25:8)
at AppWorkerLoader.load (node_modules/egg/lib/loader/app_worker_loader.js:33:10)
at MeesengerApplication.Application (node_modules/egg/lib/application.js:34:19)
at MeesengerApplication (node_modules/egg-mock/lib/app.js:221:7)
at MockApplication.[init] (node_modules/egg-mock/lib/app.js:67:29)
at undefined.next (native)
at onFulfilled (node_modules/co/index.js:65:19)
at process._tickCallback (internal/process/next_tick.js:103:7)
怎么解决这个问题
Issue Analytics
- State:
- Created 7 years ago
- Comments:17 (16 by maintainers)
Top Results From Across the Web
Vue.use() is throwing "Cannot read property 'use' of undefined"
I created a Vue application using Vue CLI. I am trying to implement Vuex. I have followed numerous tutorials (usually set up 2...
Read more >Uncaught TypeError: Cannot read property of undefined In
JavaScript TypeError is thrown when an operand or argument passed to a function is incompatible with the type expected by that operator or...
Read more >[SOLVED] Cannot Read Property of Undefined in JavaScript
The “cannot read property of undefined” error occurs when you attempt to access a property or method of a variable that is undefined...
Read more >Error "Cannot read property 'use' of undefined" #50 - GitHub
I'm importing and using as per docs: import Vue from 'vue'; import DatatableFactory from 'vuejs-datatable'; Vue.use(DatatableFactory); ...
Read more >Uncaught TypeError: Cannot read property 'use' of undefined
Uncaught TypeError: Cannot read property 'use' of undefined · I created test project with vue@3.0.0-alpha.1 · Add some plugins (example: i18n) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
english please
@surya-tamirisa sorry, we will.