Nuxt.js: srcDir error layout folder

Created on 9 Dec 2016  路  3Comments  路  Source: nuxt/nuxt.js

I'm trying to use the srcDir with express. When I access the page, this red message appears:

Vue.js error

Error: Cannot find module "C:\Users\DNPO\projects\church-nuxt\layouts\error.vue"
    at webpackMissingModule (__vue_ssr_bundle__:435:78)
    at Object.module.exports.Object.defineProperty.value (__vue_ssr_bundle__:435:213)
    at __webpack_require__ (__vue_ssr_bundle__:21:30)
    at Object.module.exports.__vue_styles__ (__vue_ssr_bundle__:734:19)
    at __webpack_require__ (__vue_ssr_bundle__:21:30)
    at Object.module.exports.exports.b (__vue_ssr_bundle__:92:79)
    at __webpack_require__ (__vue_ssr_bundle__:21:30)
    at Object.<anonymous> (__vue_ssr_bundle__:1034:65)
    at __webpack_require__ (__vue_ssr_bundle__:21:30)
    at __vue_ssr_bundle__:65:18

my nuxt.config.js

const { resolve } = require('path');

module.exports = {
  srcDir: resolve('./app'),
  head: {
    title: 'starter',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', content: "Nuxt.js project" }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: 'favicon.ico' }
    ]
  },
  css: ['~assets/css/main.css'],
  loading: { color: '#3B8070' }
}

server/index.js

const express = require('express');
const Nuxt = require('nuxt');
const nuxtConfig = require('../app/nuxt.config');

const app = express();

console.log(nuxtConfig.srcDir);

app.get('/api', (req, res) => {
  res.json('Ok');
});

const nuxt = new Nuxt(nuxtConfig);
nuxt.build();
app.use(nuxt.render);

app.listen(3000, () => {
  console.log('now listening port 3000');
});

Folder structure:
structure

This bug report is available on Nuxt.js community (#c41)
bug-confirmed

Most helpful comment

Fixed in v0.8.6 馃憤

All 3 comments

Fixed in v0.8.6 馃憤

Wow so fast, you are awesome! hahaha

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lazycrazy picture lazycrazy  路  3Comments

bimohxh picture bimohxh  路  3Comments

maicong picture maicong  路  3Comments

VincentLoy picture VincentLoy  路  3Comments

vadimsg picture vadimsg  路  3Comments