Skip to content

Can't get any webpack output/webpack-bundle-analyzer output on yarn build -- typescript semantic errors break the build #1294

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

Closed
archseer opened this issue May 15, 2018 · 3 comments

Comments

@archseer
Copy link

Version

3.0.0-beta.10

Reproduction link

https://gist.github.com/archSeer/da83151406461966adaa9bd7c4125622

Steps to reproduce

yarn build

What is expected?

⠼  Building for production...

 WARNING  Compiled with 3 warnings                                                                                                                                                               11:13:50 AM

 warning

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  js/vendors~app.0c7b91b4.js (700 KiB)

 warning
entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  app (992 KiB)
      css/vendors~app.0.0c2d3117.css
      js/vendors~app.0c7b91b4.js
      css/app.db2af613.css
      js/app.ef588c7d.js


 warning

webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/

  File                                   Size              Gzipped

  dist/js/vendors~app.0c7b91b4.js        699.72 kb         224.05 kb
  dist/js/app.ef588c7d.js                126.79 kb         22.49 kb
  dist/css/app.db2af613.css              157.99 kb         34.97 kb
  dist/css/vendors~app.0.0c2d3117.css    7.92 kb           1.83 kb

  Images and other types of assets omitted.

 DONE  Build complete. The dist directory is ready to be deployed.

✨  Done in 15.46s.

What is actually happening?

...

 error  in /.../views/Tasks.vue

(81,28): Type '{ assignedTasks: never[]; }' is not assignable to type 'User'.
  Object literal may only specify known properties, and 'assignedTasks' does not exist in type 'User'.

 ERROR  Build failed with errors.
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c vue-cli-service build
Directory: /ui
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/ui/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I'm using the typescript plugin with the class syntax, and on yarn build, I can't get any useful webpack output in the console (a breakdown of the webpack chunks that you'd usually see on the old cli).

I do have a bunch of errors in typescript, but those are unfixable since a lot of the ecosystem still isn't prepared to work with vue typescript. I figured it might be that the errors swallow up the output (but I couldn't find any ignore errors flag), so what I did next was add the bundle analyzer. It runs fine on yarn serve, but I can't get any output from it on yarn build, I've tried both static and the server setting. Meanwhile the compressor plugins ran just fine.

I think this issue is related wmonk/create-react-app-typescript#171, there's no way to get typescript semantic errors to not halt the build.

@yyx990803
Copy link
Member

In your case it is not a semantic error, but a type error.

But either way this not fixable in Vue CLI - it has to either happen in ts-loader or TypeScript itself.

@archseer
Copy link
Author

@yyx990803 in the linked issue, they made the type checking step optional. vue-cli could offer a flag for that:

(process.env.NO_EMIT_ON_ERROR ? new ForkTsCheckerWebpackPlugin({
      async: false,
      watch: paths.appSrc,
      tsconfig: paths.appTsConfig,
      tslint: paths.appTsLint,
    }) : null),
  ].filter(Boolean),

@yyx990803
Copy link
Member

You can conditionally delete the ForkTSChecker plugin in vue.config.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants