Невозможно загрузить куски в Webpack

Я пытаюсь запустить некоторые модульные тесты для моего приложения Vue 2, используя Mocha-webpack v1.0.1, узел v6.10.3.

Хотя тесты проходят успешно, через несколько минут я получаю следующее сообщение об ошибке:

Error: Loading chunk 3 failed.
    at Timeout.onScriptComplete (/path/to/.tmp/mocha-webpack/1515701616898/bundle.js:94:33)
    at ontimeout (timers.js:386:14)
    at tryOnTimeout (timers.js:250:5)
    at Timer.listOnTimeout (timers.js:214:5)
[vue-router] Failed to resolve async component default: Error: Loading chunk 3 failed.
(node:18281) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): SyntaxError: Could not resolve the given string "/" relative to the base URL "about:blank"

Я запускаю свои тесты, как описано в package.json с помощью:

"unit": "BABEL_ENV=test mocha-webpack --webpack-config build/webpack.test.conf.js --require test/unit/.setup src/**/*.spec.js --watch"

Вот моя сборка /webpack.test.conf.js

output.publicPath решает:

dev: {
    env: env,
    port: 8080,
    autoOpenBrowser: false,
    assetsSubDirectory: 'static',
    assetsPublicPath: '/',
    proxyTable: {},
    productionSourceMap: true,
    // CSS Sourcemaps off by default because relative paths are "buggy"
    // with this option, according to the CSS-Loader README
    // (https://github.com/webpack/css-loader#sourcemaps)
    // In our experience, they generally work as expected,
    // just be aware of this issue when enabling this option.
    cssSourceMap: true
  },

Вот мой .babelrc Конфиг, если это применимо

{
  "presets": [
    ["env", { "modules": false }],
    "stage-2"
  ],
  "plugins": ["transform-runtime", "transform-export-extensions", "transform-class-properties", "transform-decorators-legacy"],
  "comments": false,
  "env": {
    "test": {
      "presets": ["env", "stage-2", "es2015"],
      "plugins": ["transform-runtime", "transform-export-extensions", "transform-class-properties", "transform-decorators-legacy"]
    }
  }
}

0 ответов

Другие вопросы по тегам