-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
Does not work with Vue CLI v5 / Webpack 5 #1625
Comments
So we use vue-cli 5 on our app. I think I tested it for the latest version of the CLI so it did work for our case.
I have it on a specific version for Tailwind V3 but it should work I believe. |
Ok, thanks for the feedback. interesting to know it works for others. I'd love to get it working and complete migration too. I work on open-source project so it should be easy to reproduce, here would be the steps:
The latest commit just runs Here are quick links for my configs: |
@undergroundwires I don't know if this helps but I was able to run your project with I got it from here btw: https://stackoverflow.com/questions/68016372/webpack-ts-loader-error-loadercontext-getoptions-is-not-a-function Just ran |
I love you @megasanjay ❤️ It worked great. So happy to be able to complete the migration without waiting for webpack 5.0 release. Thanks a lot for your help, time and indirectly contributing to my project as well (also happy new year!) 🎉. I was curious why it worked and tested all other newer versions as well. I see that it works up to So my problem is solved with the workaround from @megasanjay, but I'm keeping the issue open because webpack 4 used by this plugin is still the root cause of the problem. |
See #1326 (comment) |
Upgrade to v5.x using `vue upgrade --next`. Update `vue.config.js` to import and use `defineConfig`, because it provides type safety and created by Vue CLI 5 as default. Vue CLI 5.x upgrades from webpack 4 to 5. It causes some issues that this commit attemps to fix: 1. Fail due to webpack resolving of Ace. Third-party dependency (code editor) Ace uses legacy `file-loader` for webpack resolving. It's not supported in webpack 5. So change it with manual imports. Refs: ajaxorg/ace-builds#211, ajaxorg/ace-builds#221. 2. Wehpack drops polyfilling node core modules (`path`, `fs`, etc.). Webpack does not polyfill those modules by default anymore. This is good because they did not need browser polyfilling as they are used in desktop version only and resolved already by Electron. To resolve errors (using webpack recommendations): - Add typeof check around `process` variable. - Tell webpack explicitly to ignore used node modules. 3. Fail due to legacy dependency of vue-cli-plugin-electron-builder. This plugin is used for electron builds and development. It still uses webpack 4 that leads to failed builds. Downgrading `ts-loader` to latest version which has support for `loader-utils` solves the problem (TypeStrong/ts-loader#1288). Related issue: nklayman/vue-cli-plugin-electron-builder#1625 4. Compilation fails due to webpack loading of `fsevents` on macOS. This happens only when running `vue-cli-service test:unit` command (used in integration tests and unit tests). Other builds work fine. Refs: yan-foto/electron-reload#71, nklayman/vue-cli-plugin-electron-builder#712, nklayman/vue-cli-plugin-electron-builder#1333
Upgrade to v5.x using `vue upgrade --next`. Update `vue.config.js` to import and use `defineConfig`, because it provides type safety and created by Vue CLI 5 as default. Vue CLI 5.x upgrades from webpack 4 to 5. It causes some issues that this commit attemps to fix: 1. Fail due to webpack resolving of Ace. Third-party dependency (code editor) Ace uses legacy `file-loader` for webpack resolving. It's not supported in webpack 5. So change it with manual imports. Refs: ajaxorg/ace-builds#211, ajaxorg/ace-builds#221. 2. Wehpack drops polyfilling node core modules (`path`, `fs`, etc.). Webpack does not polyfill those modules by default anymore. This is good because they did not need browser polyfilling as they are used in desktop version only and resolved already by Electron. To resolve errors (using webpack recommendations): - Add typeof check around `process` variable. - Tell webpack explicitly to ignore used node modules. 3. Fail due to legacy dependency of vue-cli-plugin-electron-builder. This plugin is used for electron builds and development. It still uses webpack 4 that leads to failed builds. Downgrading `ts-loader` to latest version which has support for `loader-utils` solves the problem (TypeStrong/ts-loader#1288). Related issue: nklayman/vue-cli-plugin-electron-builder#1625 4. Compilation fails due to webpack loading of `fsevents` on macOS. This happens only when running `vue-cli-service test:unit` command (used in integration tests and unit tests). Other builds work fine. Refs: yan-foto/electron-reload#71, nklayman/vue-cli-plugin-electron-builder#712, nklayman/vue-cli-plugin-electron-builder#1333
Vue CLI 5.0 uses webpack 5. It's not possible to use it due to
vue-cli-plugin-electron-builder
dependency.npm run electron:serve
ornpm run electron:build
throws:vue-cli-plugin-electron-builder depends on older webpack 4.
Is there anyway we can use this project along with Vue CLI 5?
The text was updated successfully, but these errors were encountered: