question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 7 years ago
  • Comments:17 (16 by maintainers)

github_iconTop GitHub Comments

2reactions
surya-tamirisacommented, Oct 5, 2019

english please

0reactions
atian25commented, Oct 8, 2019

@surya-tamirisa sorry, we will.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found