vuejs-templates / webpack

A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
MIT License
9.7k stars 4.38k forks source link

Error During Build #945

Open Splode opened 7 years ago

Splode commented 7 years ago

Version

2.4.2

Reproduction link

https://github.com/Splode/lww-test

Steps to reproduce

  1. In CLI, npm run build

What is expected?

Expected a Vue build without errors.

What is actually happening?

Build process exits incomplete, with an error. Error seems to occur after CSS optimization process:

| building for production...
Starting to optimize CSS...
Processing static/css/app.8e679f67219356a9327dea38c0984880.css...
Processed static/css/app.8e679f67219356a9327dea38c0984880.css, before: 38178, after: 38110, ratio: 99.82%
(node:12596) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Cyclic dependency: "[object Object]"
(node:12596) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with
 a non-zero exit code.

Dev server will run as expected with both npm run dev and npm run start.

Vue-CLI is version 2.9.1

LongLiveCHIEF commented 7 years ago

I've also reproduced this here: https://gitlab.com/HackerHappyHour/wedreg.

What's even more awesome for reproduction purposes, is that my repro is available via a docker image. To reproduce:

git clone https://gitlab.com/HackerHappyHour/wedreg.git
cd wedreg
docker build -t wedreg .
docker run -it --rm -v `pwd`:/wedreg wedreg install
docker run -it --rm -v `pwd`:/wedreg - P wedreg run dev

The last 2 commands execute npm install and npm run dev, and result in the same error listed above. You can inspect this static system by running:

docker run -it --rm -v `pwd`:/wedreg -P --entrypoint /bin/bash wedreg

All files from the project, including node_modules should already be on your local machine in the wedreg folder you cloned to.

Tattomoosa commented 6 years ago

I'm getting a similar error, and again the dev server is working as expected.

⠇ building for production...Error processing file: static/css/app.a9c7f7cf4b2e38c2e4838cd2748640a3.css
(node:13368) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): SyntaxError: Unexpected token � in JSON at position 111054
(node:13368) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Is this the same issue? Any chance anyone knows how to start tracking it down?

EDIT: My issue was fixed by importing all CSS into your components styles instead of at the top of .js files. I'm sure that's not the intended behavior but it's a pretty easy workaround at least.

YannikG commented 6 years ago

I'm getting @Tattomoosa error with the CSS-Framework "materialdesignicons".

Is there any update in this topic?