Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion snippets/server-core/node/faqs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,36 @@
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**

<Accordion title="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:**

Check warning on line 35 in snippets/server-core/node/faqs.mdx

View check run for this annotation

Mintlify / Mintlify Validation (statsig-4b2ff144) - vale-spellcheck

snippets/server-core/node/faqs.mdx#L35

Did you really mean '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.

</Accordion>

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.

Expand Down