bastienwirtz / homer

A very simple static homepage for your server.
https://homer-demo.netlify.app/
Apache License 2.0
9.25k stars 781 forks source link

Struggle at building legacy bundle #431

Closed n-e-t-d-i-v-e-r closed 2 years ago

n-e-t-d-i-v-e-r commented 2 years ago

I tried to install homer on my raspibolt, but it struggles now on «Building legacy bundle for production» with following allert:

`npm run build

homer@21.9.1 build /home/homer/homer vue-cli-service build

⠙ Building legacy bundle for production...(node:33160) UnhandledPromiseRejectionWarning: Error: Compiling RuleSet failed: Unexpected property test in condition (at ruleSet[1].rules[1].resource.test: resource => { currentResource = resource return true }) at RuleSetCompiler.error (/home/homer/homer/node_modules/@vue/cli-service/node_modules/webpack/lib/rules/RuleSetCompiler.js:373:10) at RuleSetCompiler.compileCondition (/home/homer/homer/node_modules/@vue/cli-service/node_modules/webpack/lib/rules/RuleSetCompiler.js:309:17) at /home/homer/homer/node_modules/@vue/cli-service/node_modules/webpack/lib/rules/BasicMatcherRulePlugin.js:29:40 at Hook.eval [as call] (eval at create (/home/homer/homer/node_modules/@vue/cli-service/node_modules/tapable/lib/HookCodeFactory.js:19:10), :19:1) at RuleSetCompiler.compileRule (/home/homer/homer/node_modules/@vue/cli-service/node_modules/webpack/lib/rules/RuleSetCompiler.js:177:19) at /home/homer/homer/node_modules/@vue/cli-service/node_modules/webpack/lib/rules/RuleSetCompiler.js:154:9 at Array.map () at RuleSetCompiler.compileRules (/home/homer/homer/node_modules/@vue/cli-service/node_modules/webpack/lib/rules/RuleSetCompiler.js:153:16) at RuleSetCompiler.compileRule (/home/homer/homer/node_modules/@vue/cli-service/node_modules/webpack/lib/rules/RuleSetCompiler.js:184:30) at /home/homer/homer/node_modules/@vue/cli-service/node_modules/webpack/lib/rules/RuleSetCompiler.js:154:9 at Array.map () at RuleSetCompiler.compileRules (/home/homer/homer/node_modules/@vue/cli-service/node_modules/webpack/lib/rules/RuleSetCompiler.js:153:16) at RuleSetCompiler.compile (/home/homer/homer/node_modules/@vue/cli-service/node_modules/webpack/lib/rules/RuleSetCompiler.js:68:22) at new NormalModuleFactory (/home/homer/homer/node_modules/@vue/cli-service/node_modules/webpack/lib/NormalModuleFactory.js:237:34) at Compiler.createNormalModuleFactory (/home/homer/homer/node_modules/@vue/cli-service/node_modules/webpack/lib/Compiler.js:1128:31) at Compiler.newCompilationParams (/home/homer/homer/node_modules/@vue/cli-service/node_modules/webpack/lib/Compiler.js:1149:30) (Use node --trace-warnings ... to show where the warning was created) (node:33160) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:33160) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. ⠹ Building legacy bundle for production...⠸ Building legacy bu⠼ Building legacy bundle for produc⠴ Building legacy bundle ⠦ Building legacy bundle for prod⠧ Building legacy bundle for production⠇ ⠧ Building legacy bundle fo⠇ Building leg⠏ Building legac⠋ Building legacy b⠙ Bui⠹ B⠸ Building leg⠼ Buildin⠴⠦⠧⠇ ⠏ Buil⠦`

any idea, why the installation from that point is broken? I followed the whole installation guide on raspibolt.org

Roundaround commented 2 years ago

I'm not sure where the legacy aspect of it is coming from to be honest. Perhaps it has something to do with the Pi's architecture or the version of node you're using?

What do you get when you run the following commands?

which node
node --version
npm --version
n-e-t-d-i-v-e-r commented 2 years ago

thx for your quick response. looks like I’m on the actual versions: node --version: v17.8.0 npm --version: 8.7.0

Roundaround commented 2 years ago

Hm, I found a similar-looking issue on some other Vue-based repo: https://github.com/laravel-mix/laravel-mix/issues/2613

Could you try running npm install vue-loader --save and then try building again?

n-e-t-d-i-v-e-r commented 2 years ago

now it looks like this ...

`> homer@21.9.1 build /home/homer/homer

vue-cli-service build

⠴ Building legacy bundle for production...

ERROR Failed to compile with 2 errors 16:42:18

ESLint is not a constructor

You may use special comments to disable some warnings. Use // eslint-disable-next-line to ignore the next line. Use / eslint-disable / to ignore all warnings in a file. Error: Child compilation failed: ESLint is not a constructor

npm ERR! A complete log of this run can be found in: npm ERR! /home/homer/.npm/_logs/2022-04-27T15_42_19_120Z-debug.log`

Roundaround commented 2 years ago

Since you used npm instead of yarn, do you have a package-lock.json? If so could you paste the contents into a Gist for me? From the other thread it seems like it boiled down to a version mismatch for them.

In the same vein I can't actually find any definitive answer whether npm will read dependency versions from yarn.lock, so it might be worth trying to delete the node_modules folder and package-lock.json file and instead installing the dependencies/building with yarn:

rm -rf node_modules
rm package-lock.json
yarn install
yarn build
n-e-t-d-i-v-e-r commented 2 years ago

because it gets a little to technical for an grafic designer like me, i’m not sure if it’s this what you asked for? meanwhile I found this package-lock.json in the homer-folder but I don’t know how to copy the file or it’s content into Gist

bastienwirtz commented 2 years ago

Hello,

The project build config moved quite a bit since the VueJS 3 upgrade, this issue should not be possible anymore. I'm closing this, but feel free to reopen if necessary.