From 78b283f97c54ff1f42091bb9b16b43d5033b57d9 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Fri, 24 Oct 2025 23:02:37 +0000 Subject: [PATCH] Update snippets/server-core/node/faqs.mdx --- snippets/server-core/node/faqs.mdx | 31 +++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/snippets/server-core/node/faqs.mdx b/snippets/server-core/node/faqs.mdx index 17ec8f019..5c73620e0 100644 --- a/snippets/server-core/node/faqs.mdx +++ b/snippets/server-core/node/faqs.mdx @@ -15,7 +15,36 @@ Right now the binary files will look at certain versions of SSL. apt-get update && apt-get install libcurl4-openssl-dev -y && rm -rf /var/lib/apt/lists/* ``` -2. **Docker build failing with platform-specific dependencies** +2. **Usage with Next.js/Webpack/esbuild** + + + +The Node Core SDK uses native binary files (`.node` files) that need to be handled properly by bundlers. + +**For Next.js/Webpack:** + +Add the following to your `next.config.js` or webpack configuration: + +```javascript +webpack: (config) => { + config.externals.push('@statsig/statsig-node-core'); + return config; +} +``` + +**For esbuild:** + +Add the `--packages=external` flag to your build script: + +```shell +esbuild --packages=external +``` + +This tells the bundler to treat the package as external and not try to bundle the native `.node` files. + + + +3. **Docker build failing with platform-specific dependencies** When building in Docker (Linux environment), the build may fail if your local `package-lock.json` or `yarn.lock` contains platform-specific dependencies for macOS. This happens because `npm install` locally on Mac pulls down Apple-specific variants, but Docker tries to use those same locked dependencies on Linux.