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

stylelint-webpack-plugin block WDS launch #4891

Closed
joe223 opened this issue Nov 27, 2019 · 5 comments
Closed

stylelint-webpack-plugin block WDS launch #4891

joe223 opened this issue Nov 27, 2019 · 5 comments

Comments

@joe223
Copy link

joe223 commented Nov 27, 2019

Version

4.0.5

Reproduction link

https://github.com/joe223/stylelint-webpack-plugin-block-WDS-launch

Environment info


  System:
    OS: macOS Mojave 10.14.4
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
  Binaries:
    Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node
    Yarn: 1.16.0 - ~/.nvm/versions/node/v10.15.3/bin/yarn
    npm: 6.11.2 - ~/.nvm/versions/node/v10.15.3/bin/npm
  Browsers:
    Chrome: 78.0.3904.108
    Firefox: 70.0.1
    Safari: 12.1
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.1.2
    @vue/babel-preset-app:  4.0.5
    @vue/babel-preset-jsx:  1.1.2
    @vue/babel-sugar-functional-vue:  1.1.2
    @vue/babel-sugar-inject-h:  1.1.2
    @vue/babel-sugar-v-model:  1.1.2
    @vue/babel-sugar-v-on:  1.1.2
    @vue/cli-overlay:  4.0.5
    @vue/cli-plugin-babel: ^4.0.0 => 4.0.5
    @vue/cli-plugin-eslint: ^4.0.0 => 4.0.5
    @vue/cli-plugin-router:  4.0.5
    @vue/cli-plugin-vuex:  4.0.5
    @vue/cli-service: ^4.0.0 => 4.0.5
    @vue/cli-shared-utils:  4.0.5
    @vue/component-compiler-utils:  3.0.2
    @vue/preload-webpack-plugin:  1.1.1
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^5.0.0 => 5.2.3
    vue: ^2.6.10 => 2.6.10
    vue-eslint-parser:  5.0.0
    vue-hot-reload-api:  2.3.4
    vue-loader:  15.7.2
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.6.10 => 2.6.10
    vue-template-es2015-compiler:  1.9.1
  npmGlobalPackages:
    @vue/cli: 4.0.5

Steps to reproduce

What is expected?

WDS should be launched successfully

What is actually happening?

WDS Starting keep launching.
Output:

> vue-cli-service serve

 INFO  Starting development server...
@sodatea
Copy link
Member

sodatea commented Nov 27, 2019

If you run yarn build you'll see the error. It's because the config file name isn't correct. There should be no leading ..

Nevertheless, there's a bug in Vue CLI that we forgot to process the webpack failed hook in the serve command.

@joe223
Copy link
Author

joe223 commented Nov 28, 2019

I'd like to take care of this issue, it just takes some time.

@halu886
Copy link

halu886 commented Dec 30, 2019

If you run yarn build you'll see the error. It's because the config file name isn't correct. There should be no leading ..

Nevertheless, there's a bug in Vue CLI that we forgot to process the webpack failed hook in the serve command.

hello,I`m trying to fix the bug by the hint you gived

And add fail hook handler when compiler failed

in vue-cli/packages/@vue/cli-service/lib/commands/serve.js#L161

add code as follows

    compiler.hooks.failed.tap('failHandler', error => {
      console.error(error)
      process.exit(1)
    })

but when I start this demo,the handler not catch this error
this make me confused.
please help,thx:)

@joe223
Copy link
Author

joe223 commented Dec 30, 2019

@halu886 You'd better keep the CLI running, exiting program when compiler's failed event occured is not a good experience

@jeneser
Copy link
Contributor

jeneser commented Jun 1, 2020

There should be no leading .

stylelint uses cosmiconfig to search and load configurations. stylelint.config.js is the default searchPlaces.

In this case, we got webpack-related issues: misconfiguration (stylelint.config.js). The error is not compilation error. Vue CLI forgot to process the webpack failed hook. We need to output the error stack and terminate the process.

compiler.hooks.failed.tap('vue-cli-service serve', (msg) => {
  error(msg)
  process.exit(1)
})

Then we will got the expected output.

➜  stylelint-webpack-plugin-block-WDS-launch git:(master) ✗ npm run dev

> stylelint-webpack-plugin-vue@0.1.0 dev /Users/lanyue/workspace-github/stylelint-webpack-plugin-block-WDS-launch
> vue-cli-service serve

 INFO  Starting development server...
 ERROR  Error: No configuration provided for /Users/lanyue/workspace-github/stylelint-webpack-plugin-block-WDS-launch/src/App.vue
Error: No configuration provided for /Users/lanyue/workspace-github/stylelint-webpack-plugin-block-WDS-launch/src/App.vue
    at module.exports (/Users/lanyue/workspace-github/stylelint-webpack-plugin-block-WDS-launch/node_modules/stylelint/lib/utils/configurationError.js:11:27)
    at /Users/lanyue/workspace-github/stylelint-webpack-plugin-block-WDS-launch/node_modules/stylelint/lib/getConfigForFile.js:64:11
    at async Promise.all (index 0)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! stylelint-webpack-plugin-vue@0.1.0 dev: `vue-cli-service serve`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the stylelint-webpack-plugin-vue@0.1.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/lanyue/.npm/_logs/2020-06-01T11_45_15_631Z-debug.log

I send a PR, @sodatea Do you have any suggestions?

@sodatea sodatea closed this as completed in 36f961e Jun 2, 2020
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

4 participants