Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

srcDir error layout folder #54

Closed
danieloprado opened this issue Dec 9, 2016 · 3 comments
Closed

srcDir error layout folder #54

danieloprado opened this issue Dec 9, 2016 · 3 comments

Comments

@danieloprado
Copy link

danieloprado commented Dec 9, 2016

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)
@Atinux
Copy link
Member

Atinux commented Dec 9, 2016

Fixed in v0.8.6 👍

@danieloprado
Copy link
Author

Wow so fast, you are awesome! hahaha

@lock
Copy link

lock bot commented Nov 5, 2018

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.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 5, 2018
@danielroe danielroe added the 2.x label Jan 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants