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

"Build failed with errors" message instead of webpack cause #1155

Closed
Toilal opened this issue Dec 11, 2017 · 9 comments
Closed

"Build failed with errors" message instead of webpack cause #1155

Toilal opened this issue Dec 11, 2017 · 9 comments

Comments

@Toilal
Copy link
Contributor

Toilal commented Dec 11, 2017

When webpack build fails (npm build), it displays "Build failed with errors" without any other explanation.

Problem is that this piece of code hide actual errors.

process.stdout.write(stats.toString({
colors: true,
modules: false,
children: false,
chunks: false,
chunkModules: false
}) + '\n\n')

If is set this to toString({color: true}), errors are displayed with other informations.

@LinusBorg
Copy link
Contributor

On what kind of errors does this happen?

I tried:

  • a syntax error wiht eslint enabled: shows eslint errors
  • as syntax error with eslint disabled: shows error with highlighted code-snippet.
  • a from path on an import: shows "module not found ..." error

Please provide more information.

@Toilal
Copy link
Contributor Author

Toilal commented Dec 11, 2017

import { Vue } from 'vue/types/vue' instead of import vue from 'vue'

@Toilal
Copy link
Contributor Author

Toilal commented Dec 11, 2017

Sorry, I forgot one important thing ! The error is caused by ts-loader (i'm running typescript).

@LinusBorg
Copy link
Contributor

bildschirmfoto 2017-12-11 um 16 04 55

@LinusBorg
Copy link
Contributor

Sorry, I forgot one important thing ! The error is caused by ts-loader (i'm running typescript).

Not an unimportant detail ^^

@LinusBorg
Copy link
Contributor

Please provide a repository with a reproduction, I won't build one myself.

@Toilal
Copy link
Contributor Author

Toilal commented Dec 11, 2017

@LinusBorg
Copy link
Contributor

Thanks. Seems ts-loader is a weird beast. In webpack 1, it even made webpack exit with code 0 on a compile error (TypeStrong/ts-loader#108), so getting errors out of ts-loader seems to not be that easy :-P

So I played around a little and found that removing children: false is enough to make the error appear again.

The thing is that this alone makes the output quite verbose on a successful build. and since this template is not laid out for typescript yet, I would hesitate to make the output verbose for everyone just to accomodate those who implement typescript into that template on their own.

So my suggetion would be the following:

  1. Add a comment in build.js to tip off people using typescript how to fix it.
  2. If /when we make typescript an option for the template, with e.g. Minimal TypeScript support option added #797, we can make this option change depending on wether typescript was added or not.

Does that sound sensible to you?

@Toilal
Copy link
Contributor Author

Toilal commented Dec 11, 2017

I think the comment would be ok for now.

In fact I realised later the problem was maybe related to ts-loader, so let's close this one, no problem. thanks :)

LinusBorg added a commit that referenced this issue Dec 14, 2017
LinusBorg added a commit that referenced this issue Dec 14, 2017
* develop:
  correct wording for #1155
  bump version to 1.2.7
  remove eventsource-polyfill (#1169)
  Remove useless code when lint is not chosen (#1165)
  Set spawn opt shell as true to avoid ENOENT (#1170)
  restore gitignore
  [WIP] Accurate CompleteMsg when not using autoInstall (fix #1157) (#1158)
  close #1155
shenron pushed a commit to shenron/webpack that referenced this issue Mar 20, 2018
shenron pushed a commit to shenron/webpack that referenced this issue Mar 20, 2018
shenron pushed a commit to shenron/webpack that referenced this issue Mar 20, 2018
* develop:
  correct wording for vuejs-templates#1155
  bump version to 1.2.7
  remove eventsource-polyfill (vuejs-templates#1169)
  Remove useless code when lint is not chosen (vuejs-templates#1165)
  Set spawn opt shell as true to avoid ENOENT (vuejs-templates#1170)
  restore gitignore
  [WIP] Accurate CompleteMsg when not using autoInstall (fix vuejs-templates#1157) (vuejs-templates#1158)
  close vuejs-templates#1155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants