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:
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.
Most helpful comment
Fixed in v0.8.6 馃憤