vux-loader icon indicating copy to clipboard operation
vux-loader copied to clipboard

[Bug Report] 用vue-cli 3.0时,无法结束进程

Open dingyi1993 opened this issue 5 years ago • 4 comments

vux-loader version

1.2.9

OS/Browsers version

linux 64

Vue version

2.5.16

Code

  ...
  configureWebpack: config => {
    const vuxLoaderConfig = {
      options: {},
      plugins: [
        {
          name: 'vux-ui'
        },
        {
          name: 'less-theme',
          path: 'src/assets/less/theme.less' // 相对项目根目录路径
        }
      ]
    }
    if (process.env.NODE_ENV === 'production') {
      vuxLoaderConfig.plugins.concat({
        name: 'duplicate-style'
      })
    }
    require('vux-loader').merge(config, vuxLoaderConfig)
  },
  ...

Steps to reproduce

用@vue/cli 3.0,在 vue.config.js 中添加上面的配置,运行 yarn vue-cli-service inspect > output.js,会导致进程无法结束,运行yarn vue-cli-service build有小概率不结束进程,定位发现是上报使用情况的定时器在某些情况下未清除(这是代码位置)。

What is Expected?

@vue/cli 3.0中,能正常结束进程。

What is actually happening?

并没有结束进程。

dingyi1993 avatar Nov 28 '18 02:11 dingyi1993

遇到了同样的问题 请问有解决办法吗

lx307697527 avatar Mar 15 '19 02:03 lx307697527

遇到了同样的问题 请问有解决办法吗

fork出来一份,自己解决。

是下面这句上报的引用中,写了个很长时间的定时器导致。

https://github.com/airyland/vux-loader/blob/780e3aaf30124667f39e005c69a9dbb1f32d4c04/src/index.js#L242

dingyi1993 avatar Mar 21 '19 01:03 dingyi1993

可以直接把这句 global.reportInterval = setInterval(report, 1200000) 注释掉,然后发到公司自己的npm源上替换现在有问题的包.

lx307697527 avatar Mar 25 '19 06:03 lx307697527

同问题 头都大了 先是配置问题,不能配置externals ,配了会有问题,去掉externals就好了 然后现在能编译正确,但是无法结束进程

要不是老项目要维护真的不想搞

xuqihua avatar Sep 10 '21 06:09 xuqihua