Closed wynkenstein closed 4 months ago
I'm guessing you got the override from this issue? Try removing the npm:
prefix:
"overrides": {
"spotify-web-api-node": {
"superagent": "$superagent"
},
"rollup": "@rollup/wasm-node"
}
Thanks for replying. I already tried that, with the same result.
Ah I think I may have given you the wrong structure for overrides there. We need to tell npm to override a depedency of vite, not rollup itself.
First...try this one:
{
"overrides": {
"spotify-web-api-node": {
"superagent": "$superagent"
},
"vite": {
"rollup": "@rollup/wasm-node"
}
}
}
If that doesn't work then try this:
{
"devDependencies": {
"@rollup/wasm-node": "^4.9.6"
// ...
},
"overrides": {
"spotify-web-api-node": {
"superagent": "$superagent"
},
"vite": {
"rollup": "$@rollup/wasm-node"
}
}
}
In both cases try to do an update first: npm update && npm install
If neither of those work you could also try using pnpm and the solution given in that issue. Maybe pnpm has additional functionality for overrides that npm does not.
P.S. the reason this is breaking now is due to changing from CRA to Vite in the last release.
I tried all possible solutions (both with npm and pnpm) but it still doesn't work. The last error (trying the second solution with pnpm) reads:
> multi-scrobbler@0.6.4 build /usr/home/stuff/installs/multi-scrobbler
> APP_VERSION=$npm_package_version vite build
/usr/home/stuff/installs/multi-scrobbler/node_modules/.pnpm/rollup@4.9.6/node_modules/rollup/dist/native.js:38
throw new Error(
^
Error: Your current platform "freebsd" and architecture "x64" combination is not yet supported by the native Rollup build. Please use the WASM build "@rollup/wasm-node" instead.
The following platform-architecture combinations are supported:
android-arm
android-arm64
darwin-arm64
darwin-x64
linux-arm
linux-arm64
linux-arm64 (musl)
linux-riscv64
linux-x64
linux-x64 (musl)
win32-arm64
win32-ia32
win32-x64
If this is important to you, please consider supporting Rollup to make a native build for your platform and architecture available.
at Object.<anonymous> (/usr/home/stuff/installs/multi-scrobbler/node_modules/.pnpm/rollup@4.9.6/node_modules/rollup/dist/native.js:38:8)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at cjsLoader (node:internal/modules/esm/translators:345:17)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:294:7)
at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
Node.js v20.10.0
ELIFECYCLE Command failed with exit code 1.
Maybe this comment will help? The version of vite MS uses specifies rollup^4.2.0
so try specifying a higher version?
"overrides": {
"vite": {
"rollup": "npm:@rollup/wasm-node@^4.9.6"
}
}
EDIT: this seems to work for me! Using the above overrides and then npm update
then shows that node_modules/rollup/package.json
is @rollup/wasm-node
Nice find, thank you! I cleared everything and did a fresh install and build with npm, only adding the vite override with specific version and now it works.
> multi-scrobbler@0.6.4 build
> APP_VERSION=$npm_package_version vite build
vite v5.0.12 building for production...
There are some "Deprecation Warning" in the process like for example:
src/client/components/player/trackInfo.scss 64:8 root stylesheet
Deprecation Warning: Using / for division outside of calc() is deprecated and will be removed in Dart Sass 2.0.0.
Recommendation: math.div($spacing, 2) or calc($spacing / 2)
More info and automated migrator: https://sass-lang.com/d/slash-div
but I guess it's fine for now.
The deprecation warnings are normal and unrelated to rollup -- just some things i need to fix in the css being built. Glad its working! I'm going to try to get some more information on rollup/wasm-node
to see if I can officially replace rollup with it or if it should only be a stopgap: https://github.com/rollup/rollup/discussions/5378
I had to use below code in package.json file and remove node_modules folder and run npm install.
"overrides": {
"vite": {
"rollup": "npm:@rollup/wasm-node"
}
}
I had to run below commands for dockerized app where npm i
should run inside container.
docker compose run reusebin-ui npm i && \
docker compose down && \
rm -rf node_modules && \
docker compose up --build
Hi there,
after trying to install latest build (0.6.4) on FreeBSD i got the following error when running npm run build :
my attempted solution was changing a part of the package.json at the overrides section to:
"overrides": { "spotify-web-api-node": { "superagent": "$superagent" }, "rollup": "npm:@rollup/wasm-node" }
but still no luck. Now the error message for npm run build reads: