question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Infinite loop / cycle when running "vue-cli-service build" with --watch and --dest options together

See original GitHub issue

Version

3.5.5

Reproduction link

https://github.com/aberonni/vue-cli-reproduce-infinite-loop

Environment info

➜ vue info

Environment Info:

  System:
    OS: macOS 10.14.4
    CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
  Binaries:
    Node: 11.6.0 - /usr/local/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.5.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 73.0.3683.103
    Firefox: 59.0.2
    Safari: 12.1
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0-beta.3 
    @vue/babel-plugin-transform-vue-jsx:  1.0.0-beta.3 
    @vue/babel-preset-app:  3.5.5 
    @vue/babel-preset-jsx:  1.0.0-beta.3 
    @vue/babel-sugar-functional-vue:  1.0.0-beta.3 
    @vue/babel-sugar-inject-h:  1.0.0-beta.3 
    @vue/babel-sugar-v-model:  1.0.0-beta.3 
    @vue/babel-sugar-v-on:  1.0.0-beta.3 
    @vue/cli-overlay:  3.5.1 
    @vue/cli-plugin-babel: ^3.5.0 => 3.5.5 
    @vue/cli-plugin-eslint: ^3.5.0 => 3.5.1 
    @vue/cli-service: ^3.5.0 => 3.5.3 
    @vue/cli-shared-utils:  3.5.1 
    @vue/component-compiler-utils:  2.6.0 
    @vue/preload-webpack-plugin:  1.1.0 
    @vue/web-component-wrapper:  1.2.0 
    eslint-plugin-vue: ^5.0.0 => 5.2.2 
    vue: ^2.6.6 => 2.6.10 
    vue-eslint-parser:  5.0.0 
    vue-hot-reload-api:  2.3.3 
    vue-loader:  15.7.0 
    vue-style-loader:  4.1.2 
    vue-template-compiler: ^2.5.21 => 2.6.10 
    vue-template-es2015-compiler:  1.9.1 
  npmGlobalPackages:
    @vue/cli: Not Found

Steps to reproduce

  • create new project with defaults
  • change the serve command to the following: vue-cli-service build --watch --dest public/build
  • run yarn serve

What is expected?

rebuild when file changes

What is actually happening?

it rebuilds in an infinite loop and creates infinite build folders inside public/build

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
LinusBorgcommented, Apr 9, 2019

Would you be interested in a PR that adds this as a configuration option?

Sorry but no. We aim to provide consistent project layouts with Vue ClI, so static assets should always go into /public. Users are free to change it on their own if they must.

1reaction
aberonnicommented, Apr 9, 2019

Managed to solve it with the following, big thanks to @LinusBorg for the advice:

// vue.config.js
module.exports = {
    chainWebpack: config => {
        if (config.plugins.has('copy')) {
            config.plugins.delete('copy')
        }
    }
}

This assumes (as in my specific case) that you don’t need the statics in the public folder

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't install vue-cli because infinite loop of npm issues
Brand new to VueJS and am trying to install vue-cli as it is my understanding that it is the minimal requirement to build...
Read more >
CLI Service - Vue CLI
Inside a Vue CLI project, @vue/cli-service installs a binary named vue-cli-service . You can access the binary directly as vue-cli-service in ...
Read more >
Node.js v19.3.0 Documentation
Using console.log() or similar asynchronous operations inside an AsyncHook callback function will cause an infinite recursion. An easy solution to this when ...
Read more >
Using While Loops and Do...While Loops in JavaScript
A common infinite loop occurs when the condition of the while statement is set to true . Below is an example of code...
Read more >
netlify support
The c-argument tells the CLI to build in Release configuration. ... People Repo info like an infinite loop. ... Unite every service into...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found