minht11 / local-music-pwa

Lightweight on device music player PWA.
https://snaeplayer.com/
MIT License
154 stars 20 forks source link

Error on build #11

Closed raphaeldealmeida closed 2 years ago

raphaeldealmeida commented 2 years ago
➜  local-music-pwa git:(main) npm run build

> snae_music_player@1.0.4 build
> vite build

vite v2.4.2 building for production...
transforming (292) node_modules/music-metadata/lib/common/CaseInsensitiveTagMap.jsUse of eval is strongly discouraged, as it poses security risks and may cause issues with minification
✓ 297 modules transformed.
✓ 191 modules transformed.
rendering chunks (4)...warnings when minifying css:
Invalid property name 'var(--_1bpcpo70)' at 757:2. Ignoring.
[mangle-css-class-names] file.code.replaceAll is not a function
error during build:
TypeError: file.code.replaceAll is not a function
    at Object.generateBundle (/home/raphael/projects/labs/local-music-pwa/vite.config.ts:136:33)
    at /home/raphael/projects/labs/local-music-pwa/node_modules/rollup/dist/shared/rollup.js:20008:25
npm ERR! code 1
npm ERR! path /home/raphael/projects/labs/local-music-pwa
npm ERR! command failed
npm ERR! command sh -c vite build

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/raphael/.npm/_logs/2021-09-20T22_01_44_759Z-debug.log
minht11 commented 2 years ago

replaceAll is relatively new method supported in node 15.0. Update your node.

I should probably require minimum node version for this project. I am not sure if that's possible though.

raphaeldealmeida commented 2 years ago

I installed 16.9.1 version through nvm and it works. Is possible to check the minimum version on package.json https://docs.npmjs.com/cli/v7/configuring-npm/package-json#engines

Thank you.