Failed to load SWC binary error when using Node v22 in local Docker container #83629
-
SummaryWe upgraded our version of node from 18 to the latest 22 LTS due to v18 no longer being supported. Everything seems to work fine EXCEPT when attempting to run the site in a Docker container for local development. For the Docker container, we're using a windows nanoserver base image (mcr.microsoft.com/windows/nanoserver:1809), downloading a Node zip package to it (v22.18.0), and copying the Node files to c:\node on the containter. (as well as adding c:\node in the PATH) It works fine with Node v18, but as soon as we use Node v20 or Node v22 in the image, we get an error, and the container shuts down. warn - Attempted to load @next/swc-win32-x64-gnu, but it was not installed warn - Attempted to load @next/swc-win32-x64-msvc, but an error occurred: The specified module could not be found. \?\C:\app\node_modules\next\node_modules@next\swc-win32-x64-msvc\next-swc.win32-x64-msvc.node error - Failed to load SWC binary for win32/x64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc node:events:496 throw er; // Unhandled 'error' event ^ Error: spawn taskkill ENOENT We've tried pretty much everything detailed in this article to no avail: https://nextjs.org/docs/messages/failed-loading-swc
Has anyone else ran into this? We're running out of ideas to try and would any insight anyone may have. Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
UPDATE Seems like the fix for us ended up being installing specific versions of the @next/swc-wasm-nodejs and @next/swc-wasm-web modules coinciding with our version of Next.js (v12.2.4 at this time) |
Beta Was this translation helpful? Give feedback.
UPDATE
Seems like the fix for us ended up being installing specific versions of the @next/swc-wasm-nodejs and @next/swc-wasm-web modules coinciding with our version of Next.js (v12.2.4 at this time)