Skip to content

@swc/core threw an error when attempting to validate swc compiler options in Docker, works outside of docker. #4600

Answered by nparoski
nparoski asked this question in Help
Discussion options

You must be logged in to vote

I've found a fix, apparently what happens (not sure why) is node_modules/@swc/core installs wrong optional packages within docker container.

Heres the fix:

  1. Open docker image and find your WORKDIR
  2. Remove core-darwin-x64 or core-win-32-x64-msvc or similar from node_modules/@swc/core.
  3. There should be core-linux-x64-gnu and core-linux-x64-muscl (if your docker image is linux)
  4. Run npm install from within docker container (this time you should see correct packages in @swc/core under node_modules/)

My understanding is that when you pull project and do npm install on host machine which is macOS or Windows, swc installs right packages for your host system.

I'm not sure why it skips installing co…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@freddneos
Comment options

@nparoski
Comment options

Answer selected by nparoski
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants