adonuxt-template icon indicating copy to clipboard operation
adonuxt-template copied to clipboard

Unhandled promise rejection

Open smitray opened this issue 8 years ago • 3 comments

Just installed and tried to build the boilerplate but facing 'Unhandled promise rejection (rejection id: 2): TypeError: this.nuxt.build is not a function'

screenshot_2017-09-01_09-19-06

Need help, thanks

This question is available on Nuxt.js community (#c55)

smitray avatar Sep 01 '17 03:09 smitray

I have same problem on my heroku build.

EDIT: Production build is not working for me, but i got development build to work.

alanaasmaa avatar Sep 10 '17 13:09 alanaasmaa

Did you resolve this issue? I am stucked in same issue

ChangJoo-Park avatar Oct 23 '17 04:10 ChangJoo-Park

@ChangJoo-Park If im not wrong then i think i edited my App\Http\Controllers\NuxtController to get it work

'use strict'

const Env = use('Env')
const Config = use('Config')
const { Nuxt, Builder } = require('nuxt')

class NuxtController {
  constructor () {
    let config = Config.get('nuxt')
    config.dev = Env.get('NODE_ENV') === 'development'
    this.nuxt = new Nuxt(config)
    // Start build process (only in development)
    if (config.dev) {
      new Builder(this.nuxt).build()
    }
  }

  * render (request, response) {
    this.nuxt.render(request.request, response.response)
  }
}

module.exports = new NuxtController()

alanaasmaa avatar Oct 23 '17 17:10 alanaasmaa