-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESBuild architecture mismatch on arm64 mac #80
Comments
Thanks for checking this out! Glad to know it's helping people out there 🙂 As for your issue, not quite if this is mac-specific (or localized to your machine) but can you try installing the dependencies on your host machine using the latest version of
I'm on Windows and using WSL to develop so mine's running fine but I'm curious about this issue and would like to know what's causing this exactly as I've never encountered it 🤔 |
I should have mentioned this, but I had originally tried the install on the host with NPM instead of PNPM, but I was using Node 20 and NVM. Just did a clean clone and attempted setup with only PNPM on the host. Got the same output, pasted the full version of it to a gist so it's a bit easier to parse. https://gist.github.com/Connorelsea/4f2d4762c25faf79e40ff16103a24f9e Edit: Also seems like esbuild is a dependency of tsx but I could be interpreting that incorrectly |
Can you try this:
Let me know if you get a different result this time 🤞 |
Just tested that approach and am getting the same result. It was a fresh git clone of the project so only the |
I see. The idea was for your machine to generate the lockfile and see if it'd work. Let's try a different approach and isolate the docker container. Do these file changes:
|
Thanks so much for the detailed help! That worked and the API is able to run locally with all the services running in the container. Got the following when running the API on host.
Definitely will be continuing to think about how this could be happening though, will update if I discover anything new. |
Neat! The idea now is that the Node application is running on the host machine so the other cli instructions in the README about getting inside the Anyhow, I might have to rethink developing inside a docker container when P.S. You're also correct on your guess that |
I think I may have found a solution! I have the API working now inside the container and no need for host to install dependencies anymore to run the container. After reading a lot on the topic I came across a strategy to move node_modules up a directory in the container so you can do both local and in-container development with two different sets of node_modules. And ensuring the node_modules being used in the container are being installed there on build rather than being copied over. I have some code for this that I can post momentarily and we can discuss. But it likely needs to be cleaned up since I was doing a lot of testing of different approaches, and make sure there are no dire drawbacks to this approach. I also need to look into the production build process and see if this approach needs to be taken there or if the new dev-time build approach breaks anything about the prod build process. I found this solution here, listed as solution B, and modified it to fit this use case: https://www.docker.com/blog/keep-nodejs-rockin-in-docker/ New Dockerfile.dev
New docker-compose.yml
|
Interesting find 🤔 This seems similar to the Windows issue with the note I left there on the Have you tried not touching anything on the Docker files ( It should have the same effect of isolating the |
Weird. I'll be getting a Mac machine sooner or later so I'll take a closer look on this once that comes but do kindly continue sharing your findings. Will this keep this issue open until I can agree on a solution (or tradeoff worst-case scenario) that works across these platforms. Just throwing in ideas but maybe one of the other Node image variants (e.g. |
Thanks for creating this project! It seems really useful and well-organized. I started digging through it and trying to get it running locally and ran into some issues with ESBuild.
TLDR: arm64 mac and arm64 linux docker image mismatch esbuild dependency architecture, not sure how node_modules are shared
After following the setup instructions, and then trying to run
docker-compose up
, many of the services start successfully. The API service fails with the following error.I researched this and many have similar problems in different projects, but the solutions I have found don't work so far. I have tried entering the docker container bash, deleting node modules, and re-running the install in hopes that the correct architecture of esbuild would be installed at that location. But that did not work. I also attempted switching the build process to use yarn and the
supportedArchitectures
yarnrc feature but this introduced breaking errors about the async iterator symbol TSC problems during docker build that I could not find a fix for.I am not that familiar with docker so I have been trying to slowly decipher the process that takes place here, and at what points the node_modules are shared and what could be done to prevent that or force reinstall inside the container. Any further insight into the process here or ideas about how to resolve this?
Thanks again! Even if I can't get this working it's giving me a lot of good ideas about how to structure a project like this.
The text was updated successfully, but these errors were encountered: