Unable to deploy docker image on internal network -- "failed to install cjs-module-lexer"
Problem
I'm attempting to deploy the v136 Docker image on an intranet k8s cluster.
We restrict incoming and outgoing traffic, so it isn't able reach out to GitHub to clone and build the "esm-dev/cjs-module-lexer" repository once running. This prevents us from deploying a working esm.sh server, despite having an internal npm repo.
Requested solution
Build this ahead of time and include it inside the image so that it will still work regardless of the ability to reach GitHub.
Edit:
I should also note that v135_7 works fine because it doesn't attempt to reach out to GitHub.
so you don't use '/gh/repo/PATH' pattern right?
Sorry, not familiar with that pattern, so I'd have to say no.
@ije Sorry for the ping, just wanting to follow up on this. Is there a possibility of getting the pre-built cjs-module-lexer into the official container?
Otherwise, could you let me know where in the container the compiled version should go so that I can build it myself?
you can find the pre-built cjs-module-lexer in https://github.com/esm-dev/cjs-module-lexer/releases based on your arch.
and you need to rename the binary file to /esm/bin/cjs-module-lexer after downloading
here is how the server download the binary dynamically:
https://github.com/esm-dev/esm.sh/blob/fe6d4e1758a085aaad957e32926b3aef7ee3e273/server/cjs_module_lexer.go#L153-L230