[GH-ISSUE #1422] [BUG]: Cannot start frontend via dev containers on local #909

Closed
opened 2026-02-22 18:22:08 -05:00 by yindo · 3 comments
Owner

Originally created by @jazelly on GitHub (May 16, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1422

How are you running AnythingLLM?

Docker (local)

What happened?

It worked before. I don't know what's changed, maybe due to recent commits, but now I got this when yarn dev or start in dev containers

Executing task: cd /workspaces/anything-llm/frontend/ && yarn dev 

yarn run v1.22.19
$ NODE_ENV=development vite --debug --host=0.0.0.0
failed to load config from /workspaces/anything-llm/frontend/vite.config.js
error when starting dev server:
Error: 
You installed esbuild for another platform than the one you're currently using.
This won't work because esbuild is written with native code and needs to
install a platform-specific binary executable.

Specifically the "@esbuild/darwin-arm64" package is present but this platform
needs the "@esbuild/linux-arm64" package instead. People often get into this
situation by installing esbuild on Windows or macOS and copying "node_modules"
into a Docker image that runs Linux, or by copying "node_modules" between
Windows and WSL environments.

If you are installing with npm, you can try not copying the "node_modules"
directory when you copy the files over, and running "npm ci" or "npm install"
on the destination platform after the copy. Or you could consider using yarn
instead of npm which has built-in support for installing a package on multiple
platforms simultaneously.

If you are installing with yarn, you can try listing both this platform and the
other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
Keep in mind that this means multiple copies of esbuild will be present.

Another alternative is to use the "esbuild-wasm" package instead, which works
the same way on all platforms. But it comes with a heavy performance cost and
can sometimes be 10x slower than the "esbuild" package, so you may also not
want to do that.

    at generateBinPath (/workspaces/anything-llm/frontend/node_modules/esbuild/lib/main.js:1888:17)
    at esbuildCommandAndArgs (/workspaces/anything-llm/frontend/node_modules/esbuild/lib/main.js:1969:33)
    at ensureServiceIsRunning (/workspaces/anything-llm/frontend/node_modules/esbuild/lib/main.js:2133:25)
    at build (/workspaces/anything-llm/frontend/node_modules/esbuild/lib/main.js:2025:26)
    at bundleConfigFile (file:///workspaces/anything-llm/frontend/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:66194:26)
    at loadConfigFromFile (file:///workspaces/anything-llm/frontend/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:66170:31)
    at resolveConfig (file:///workspaces/anything-llm/frontend/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:65767:34)
    at _createServer (file:///workspaces/anything-llm/frontend/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:65044:26)
    at createServer (file:///workspaces/anything-llm/frontend/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:65041:12)
    at CAC.<anonymous> (file:///workspaces/anything-llm/frontend/node_modules/vite/dist/node/cli.js:763:30)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I'm running on mac m1, and so far I have tried yarn install --force.

The above error message makes sense, and thus when I run it via yarn dev, it worked. However, clearly in the docker container yarn got confused with which esbuild package to use.

Are there known steps to reproduce?

No response

Originally created by @jazelly on GitHub (May 16, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1422 ### How are you running AnythingLLM? Docker (local) ### What happened? It worked before. I don't know what's changed, maybe due to recent commits, but now I got this when `yarn dev` or start in dev containers ``` Executing task: cd /workspaces/anything-llm/frontend/ && yarn dev yarn run v1.22.19 $ NODE_ENV=development vite --debug --host=0.0.0.0 failed to load config from /workspaces/anything-llm/frontend/vite.config.js error when starting dev server: Error: You installed esbuild for another platform than the one you're currently using. This won't work because esbuild is written with native code and needs to install a platform-specific binary executable. Specifically the "@esbuild/darwin-arm64" package is present but this platform needs the "@esbuild/linux-arm64" package instead. People often get into this situation by installing esbuild on Windows or macOS and copying "node_modules" into a Docker image that runs Linux, or by copying "node_modules" between Windows and WSL environments. If you are installing with npm, you can try not copying the "node_modules" directory when you copy the files over, and running "npm ci" or "npm install" on the destination platform after the copy. Or you could consider using yarn instead of npm which has built-in support for installing a package on multiple platforms simultaneously. If you are installing with yarn, you can try listing both this platform and the other platform in your ".yarnrc.yml" file using the "supportedArchitectures" feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures Keep in mind that this means multiple copies of esbuild will be present. Another alternative is to use the "esbuild-wasm" package instead, which works the same way on all platforms. But it comes with a heavy performance cost and can sometimes be 10x slower than the "esbuild" package, so you may also not want to do that. at generateBinPath (/workspaces/anything-llm/frontend/node_modules/esbuild/lib/main.js:1888:17) at esbuildCommandAndArgs (/workspaces/anything-llm/frontend/node_modules/esbuild/lib/main.js:1969:33) at ensureServiceIsRunning (/workspaces/anything-llm/frontend/node_modules/esbuild/lib/main.js:2133:25) at build (/workspaces/anything-llm/frontend/node_modules/esbuild/lib/main.js:2025:26) at bundleConfigFile (file:///workspaces/anything-llm/frontend/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:66194:26) at loadConfigFromFile (file:///workspaces/anything-llm/frontend/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:66170:31) at resolveConfig (file:///workspaces/anything-llm/frontend/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:65767:34) at _createServer (file:///workspaces/anything-llm/frontend/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:65044:26) at createServer (file:///workspaces/anything-llm/frontend/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:65041:12) at CAC.<anonymous> (file:///workspaces/anything-llm/frontend/node_modules/vite/dist/node/cli.js:763:30) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. ``` I'm running on mac m1, and so far I have tried `yarn install --force`. The above error message makes sense, and thus when I run it via `yarn dev`, it worked. However, clearly in the docker container `yarn` got confused with which esbuild package to use. ### Are there known steps to reproduce? _No response_
yindo added the Docker label 2026-02-22 18:22:08 -05:00
yindo closed this issue 2026-02-22 18:22:08 -05:00
Author
Owner

@timothycarambat commented on GitHub (May 16, 2024):

Hm, im a bit confused on the use case. We usually develop outside of a dev container so we I not sure how to advise on this otherwise, but it appears that the node_modules on the host is the same node_modules in the container which would explain that issue.

Usually for container dev we just would use github codespaces

@timothycarambat commented on GitHub (May 16, 2024): Hm, im a bit confused on the use case. We usually develop outside of a dev container so we I not sure how to advise on this otherwise, but it appears that the node_modules on the host is the same node_modules in the container which would explain that issue. Usually for container dev we just would use github codespaces
Author
Owner

@jazelly commented on GitHub (May 16, 2024):

I use the dev container on local since it's so easy to get your server and collector running.

Now I'm in a situation that the frontend at dev container basically cannot start anymore, as it's trying to use the node_modules in my local. Is there a way to tell dev container to do yarn install? I tried deleted my node_modules and restart, it doesn't attempt to install deps.

@jazelly commented on GitHub (May 16, 2024): I use the dev container on local since it's so easy to get your server and collector running. Now I'm in a situation that the frontend at dev container basically cannot start anymore, as it's trying to use the `node_modules` in my local. Is there a way to tell dev container to do `yarn install`? I tried deleted my `node_modules` and restart, it doesn't attempt to install deps.
Author
Owner

@jazelly commented on GitHub (May 16, 2024):

Ah, I get it now. I was doing yarn inside the devcontainer, which was treated as an Linux and wouldn't install the darwin_arm64 package. The other day I installed deps outside container, which depleted the linux_arm64 package. All good now. All I need to do is to reinstall deps under devcontainer.

@jazelly commented on GitHub (May 16, 2024): Ah, I get it now. I was doing `yarn` inside the `devcontainer`, which was treated as an Linux and wouldn't install the `darwin_arm64` package. The other day I installed deps outside container, which depleted the `linux_arm64` package. All good now. All I need to do is to reinstall deps under `devcontainer`.
yindo changed title from [BUG]: Cannot start frontend via dev containers on local to [GH-ISSUE #1422] [BUG]: Cannot start frontend via dev containers on local 2026-06-05 14:37:52 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#909