Closed kztao closed 4 years ago
require.resolve('worker-loader') 试一下?
试过了,一样
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
遇到了同样的问题: umi dev 的时候,出现错误提示: ERROR Failed to compile with 0 errors. @kztao 请问你解决这个问题了么?
遇到了同样的问题: umi dev 的时候,出现错误提示: ERROR Failed to compile with 0 errors. @kztao 请问你解决这个问题了么?
没有...
遇到了同样的问题: umi dev 的时候,出现错误提示: ERROR Failed to compile with 0 errors. @kztao 请问你解决这个问题了么?
没有...
我也遇到了...请问解决了吗
workerDemo
问题复现步骤:
yarn create umi yarn add worker-loader --dev yarn yarn start
修改.umirc.js,加入以下配置: chainWebpack: function (config) {
},
task.worker.js:
self.onmessage = function(event){ console.log(event); }
self.postMessage({data:'haha'});
taskQueue.js://只有有下面两行,就报错:
import TaskWorker from './task.worker'; console.log(TaskWorker);
Repo: https://github.com/kztao/workerDemo.git
E:\Projects\workerDemo>yarn create umi yarn create v1.15.2 [1/4] Resolving packages... [2/4] Fetching packages... info fsevents@1.2.8: The platform "win32" is incompatible with this module. info "fsevents@1.2.8" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... warning " > electron-webpack@2.7.4" has unmet peer dependency "webpack@^4.35.3". warning "electron-webpack > css-loader@3.2.0" has unmet peer dependency "webpack@^4.0.0". warning "electron-webpack > file-loader@4.2.0" has unmet peer dependency "webpack@^4.0.0". warning "electron-webpack > html-loader@1.0.0-alpha.0" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0". warning "electron-webpack > html-webpack-plugin@3.2.0" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0". warning "electron-webpack > mini-css-extract-plugin@0.7.0" has unmet peer dependency "webpack@^4.4.0". warning "electron-webpack > terser-webpack-plugin@1.4.1" has unmet peer dependency "webpack@^4.0.0". warning "electron-webpack > url-loader@2.1.0" has unmet peer dependency "webpack@^4.0.0". warning "electron-webpack > webpack-cli@3.3.7" has unmet peer dependency "webpack@4.x.x". warning "electron-webpack > webpack-dev-server@3.8.0" has unmet peer dependency "webpack@^4.0.0". warning "electron-webpack > electron-webpack-js > babel-loader@8.0.6" has unmet peer dependency "webpack@>=2". warning "electron-webpack > webpack-dev-server > webpack-dev-middleware@3.7.0" has unmet peer dependency "webpack@^4.0.0". warning "umi > react-loadable@5.5.0" has unmet peer dependency "react@*". warning "umi > umi-build-dev > af-webpack > eslint-config-umi > eslint-config-react-app@3.0.8" has unmet peer dependency "babel-eslint@9.x". [4/4] Building fresh packages... success Installed "create-umi@0.16.2" with binaries:
E:\Projects\workerDemo>yarn yarn install v1.15.2 info No lockfile found. [1/5] Validating package.json... [2/5] Resolving packages... warning dva > dva-core > flatten@1.0.2: I wrote this module a very long time ago; you should use something else. warning antd > rc-tree-select > rc-trigger > rc-animate > fbjs > core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2. warning umi-plugin-react > umi-plugin-dva > dva > dva-core > flatten@1.0.2: I wrote this module a very long time ago; you should use something else. warning umi-plugin-react > umi-plugin-polyfills > core-js@2.6.0: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2. warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi@11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). warning umi-plugin-react > umi-plugin-locale > react-intl > intl-relativeformat@2.2.0: This package has been deprecated, please see migration guide at 'https://github.com/formatjs/formatjs/tree/master/packages/intl-relativeformat#migration-guide' warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi > hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi > topo@2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi > topo > hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). [3/5] Fetching packages... info fsevents@2.0.7: The platform "win32" is incompatible with this module. info "fsevents@2.0.7" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.9: The platform "win32" is incompatible with this module. info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation. [4/5] Linking dependencies... warning "dva > connected-react-router@6.5.2" has unmet peer dependency "react-router@^4.3.1 || ^5.0.0". warning " > eslint-config-umi@1.5.0" has incorrect peer dependency "eslint-plugin-jsx-a11y@6.x". warning " > eslint-config-umi@1.5.0" has unmet peer dependency "eslint-plugin-react-hooks@1.5.0". warning "eslint-config-umi > eslint-config-react-app@4.0.1" has unmet peer dependency "@typescript-eslint/eslint-plugin@1.x". warning "eslint-config-umi > eslint-config-react-app@4.0.1" has unmet peer dependency "@typescript-eslint/parser@1.x". warning "eslint-config-umi > eslint-config-react-app@4.0.1" has incorrect peer dependency "babel-eslint@10.x". warning "eslint-config-umi > eslint-config-react-app@4.0.1" has incorrect peer dependency "eslint-plugin-jsx-a11y@6.x". warning "eslint-config-umi > eslint-config-react-app@4.0.1" has unmet peer dependency "eslint-plugin-react-hooks@1.x". warning " > eslint-plugin-jsx-a11y@5.1.1" has incorrect peer dependency "eslint@^2.10.2 || ^3 || ^4". warning "umi > umi-build-dev > af-webpack > eslint-config-umi@1.6.0-beta.1" has incorrect peer dependency "eslint-plugin-react-hooks@1.5.0". warning "umi > umi-build-dev > sylvanas > @umijs/fabric > @typescript-eslint/eslint-plugin@1.13.0" has incorrect peer dependency "@typescript-eslint/parser@^1.9.0". warning "umi > umi-build-dev > sylvanas > @umijs/fabric > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta". warning "umi > umi-build-dev > umi-plugin-ui > umi-ui-tasks > react-sizeme@2.6.7" has unmet peer dependency "prop-types@^15.0.0-0". warning "umi > umi-build-dev > umi-plugin-ui > umi-ui-tasks > xterm-addon-web-links@0.1.0" has unmet peer dependency "xterm@^3.14.0". warning "umi-plugin-react > umi-plugin-dva > dva@2.6.0-beta.6" has incorrect peer dependency "react@^16.18.4". warning "umi-plugin-react > umi-plugin-dva > dva@2.6.0-beta.6" has incorrect peer dependency "react-dom@^16.18.4". warning "umi-plugin-react > umi-plugin-dva > babel-plugin-dva-hmr@0.4.2" has unmet peer dependency "redbox-react@1.x". warning "umi-plugin-react > umi-plugin-dva > dva-loading@3.0.6" has unmet peer dependency "dva-core@^1.1.0 | ^1.5.0-0 | ^1.6.0-0". [5/5] Building fresh packages... success Saved lockfile. Done in 307.39s.
E:\Projects\workerDemo>yarn add worker-loader --dev yarn add v1.15.2 [1/5] Validating package.json... [2/5] Resolving packages... [3/5] Fetching packages... info fsevents@2.0.7: The platform "win32" is incompatible with this module. info "fsevents@2.0.7" is an optional dependency and failed compatibility check. Excluding it from installation. info fsevents@1.2.9: The platform "win32" is incompatible with this module. info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation. [4/5] Linking dependencies... warning "dva > connected-react-router@6.5.2" has unmet peer dependency "react-router@^4.3.1 || ^5.0.0". warning " > eslint-config-umi@1.5.0" has incorrect peer dependency "eslint-plugin-jsx-a11y@6.x". warning " > eslint-config-umi@1.5.0" has unmet peer dependency "eslint-plugin-react-hooks@1.5.0". warning "eslint-config-umi > eslint-config-react-app@4.0.1" has unmet peer dependency "@typescript-eslint/eslint-plugin@1.x". warning "eslint-config-umi > eslint-config-react-app@4.0.1" has unmet peer dependency "@typescript-eslint/parser@1.x". warning "eslint-config-umi > eslint-config-react-app@4.0.1" has incorrect peer dependency "babel-eslint@10.x". warning "eslint-config-umi > eslint-config-react-app@4.0.1" has incorrect peer dependency "eslint-plugin-jsx-a11y@6.x". warning "eslint-config-umi > eslint-config-react-app@4.0.1" has unmet peer dependency "eslint-plugin-react-hooks@1.x". warning " > eslint-plugin-jsx-a11y@5.1.1" has incorrect peer dependency "eslint@^2.10.2 || ^3 || ^4". warning "umi > umi-build-dev > af-webpack > eslint-config-umi@1.6.0-beta.1" has incorrect peer dependency "eslint-plugin-react-hooks@1.5.0". warning "umi > umi-build-dev > sylvanas > @umijs/fabric > @typescript-eslint/eslint-plugin@1.13.0" has incorrect peer dependency "@typescript-eslint/parser@^1.9.0". warning "umi > umi-build-dev > umi-plugin-ui > umi-ui-tasks > react-sizeme@2.6.7" has unmet peer dependency "prop-types@^15.0.0-0". warning "umi > umi-build-dev > umi-plugin-ui > umi-ui-tasks > xterm-addon-web-links@0.1.0" has unmet peer dependency "xterm@^3.14.0". warning "umi > umi-build-dev > sylvanas > @umijs/fabric > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta". warning "umi-plugin-react > umi-plugin-dva > babel-plugin-dva-hmr@0.4.2" has unmet peer dependency "redbox-react@1.x". warning "umi-plugin-react > umi-plugin-dva > dva@2.6.0-beta.6" has incorrect peer dependency "react@^16.18.4". warning "umi-plugin-react > umi-plugin-dva > dva@2.6.0-beta.6" has incorrect peer dependency "react-dom@^16.18.4". warning "umi-plugin-react > umi-plugin-dva > dva-loading@3.0.6" has unmet peer dependency "dva-core@^1.1.0 | ^1.5.0-0 | ^1.6.0-0". warning " > worker-loader@2.0.0" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0-alpha.0 || ^4.0.0". [5/5] Building fresh packages... success Saved lockfile. success Saved 1 new dependency. info Direct dependencies └─ worker-loader@2.0.0 info All dependencies └─ worker-loader@2.0.0 Done in 25.66s.
E:\Projects\workerDemo> E:\Projects\workerDemo> E:\Projects\workerDemo>yarn start yarn run v1.15.2 $ umi dev [umi-plugin-dll] File list is equal, don't generate the dll file. Starting the development server...
Build completed in 4.721s
ERROR Failed to compile with 0 errors 10:23:03