Repository navigation
Replies: 42 comments 73 replies
|
|
|
If i try yarn rollup fixing but esbuild giving error :D |
|
Hi- Has anyone started working on this issue? |
|
@Lymah123 You can change package manager to yarn and this line add to package.json and for vite.config.js you can try this Can you confirm is works or not for you? |
Hi @BeycanDeveloper, sorry for the late response. I will check it out and let you know. |
|
This is happening because you are mounting the local node_modules (containing the Windows binaries) on the container. You need to use the node_modules inside the Docker image or run For example, use a named volume and run version: '3'
services:
node:
build:
context: .
ports:
- "3035:3000"
volumes:
- ./:/usr/src/app
- node_modules:/usr/src/app/node_modules
volumes:
node_modules: |
|
Add the code as below to |
I executed following command to install mentioned package as optional dependency for NPM and it solved the issue on my Ubuntu Linux local and Docker Image using Github Actions as well. I was facing this issue on latest Vite v5.1.3.
|
|
this is weird, I don't have this issue on my another project, but
thankyou @viral-antuit |
|
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 docker compose run [service-name] npm i && \
docker compose down && \
rm -rf node_modules && \
docker compose up --build |
|
For me I am using SvelteKit and I had to reinstall my adapter. then J |
|
In my setup, similar issue got fixed by downgrading Vite to |
|
if you are using yarn install, add |
|
I ran into this problem and none of the above works for me. Is there any other way to fix this? |
|
It doesn't makes any sense. The deployment was even working until last month, and now it doesn't work anymore. I had to use the rollup plugin as optional dependency. |
|
I had this problem using docker because the package is necessary only in Linux (I use windows but docker linux)
By mounting - /usr/app/frontend/node_modules in Docker Compose, you instructed Docker to treat node_modules as a container-specific directory, keeping it independent from your host environment. |
|
My solution is not related to Docker, but this is the first result on Google for the error message so this might help others. This error occurred for me in runtime logs of Vercel for an Astro website. It was because I was using loadEnv from vite in my project files to check the value of an environment variable. I removed loadEnv from my project files except the astro config file (you need to use loadEnv here rather than import.meta.env) and it fixed the issue. No need for optional dependencies or installing the missing rollup package. I did also delete package-lock.json and the node_modules folder and run npm install but not sure I needed to in hindsight. Also make sure Vercel is not using a build cache. |
|
I've had the same issue when using CircleCI. Can confirm adding the optionalDependencies as per #15532 (comment) works :) |
|
For me the solution was to remove the |
|
Here is a bug that can cause this: npm/cli#4828 The work around is
|
|
I also had to add the following. |
|
I was experiencing this same issue in a project built with Astro using the Vercel adapter. Here's how I managed to work around it: ✅ Steps to fix the issue (at least for the majority of my projects):
"dependencies": {},
"devDependencies": {},
"optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "<YOUR_VERSION>"
},
"overrides": {
"vite": {
"rollup": "npm:@rollup/wasm-node"
}
}
Until a definitive fix is released, this seems to be a reliable workaround — especially by setting the Hope this helps! |
|
The npm bug seems to have been fixed in (Though this wasn't on docker but on cloudflare, but I was getting the same errors.) |
|
You need to delete the |
|
What do you do when deleting Either this issue in Our team is at our wits end with this. We've been dealing with this nuisance for months and are even considering putting |
|
This config works well to run vite in docker Dockerfile: docker-compose.yml package.json Also deleted node_modules + package-lock.json locally |
|
Slightly related... I had this issue with my own repository and I did copy my repository from server to my other server to get this issue. I use:
|
|
Hey! Super common issue. The problem: npm downloads platform-specific Rollup binaries on your local machine (Windows/Mac), then copying node_modules to Docker (Linux) breaks because wrong binaries. Solution 1: Install inside container (Best) FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run buildKey: run npm install INSIDE container, dont copy local node_modules. Solution 2: Named volume for development services:
app:
volumes:
- .:/app
- node_modules:/app/node_modules
volumes:
node_modules:Then: Solution 3: Quick fix "optionalDependencies": {
"@rollup/rollup-linux-x64-gnu": "4.9.5"
}Main point: Native deps must be installed where they run. Dont mix Windows/Mac binaries with Linux containers. |
|
I was getting this on CI, I noticed we were doing |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
I researched and tried on the sites below and on many different platforms, but I could not find a solution. I am using node:lts and also I cannot download this module in my docker container due to system incompatibility.
So I honestly don't know what to do right now.
#15120
rollup/rollup#5194
#15167
Reproduction
https://stackblitz.com/edit/vite-yxshfw?file=docker-compose.yml,package.json
Steps to reproduce
No response
System Info
Used Package Manager
npm
Logs
Validations
All reactions