diff --git a/docs/platforms/javascript/guides/react-router/index.mdx b/docs/platforms/javascript/guides/react-router/index.mdx index 21937c914a97b0..09a0c9d2c970aa 100644 --- a/docs/platforms/javascript/guides/react-router/index.mdx +++ b/docs/platforms/javascript/guides/react-router/index.mdx @@ -308,6 +308,8 @@ export const handleError: HandleErrorFunction = (error, { request }) => { Since React Router is running in ESM mode, you need to use the `--import` command line options to load our server-side instrumentation module before the application starts. Update the `start` and `dev` script to include the instrumentation file: + + ```json {filename: package.json} "scripts": { "dev": "NODE_OPTIONS='--import ./instrument.server.mjs' react-router dev", diff --git a/platform-includes/node-options-windows/javascript.react-router.mdx b/platform-includes/node-options-windows/javascript.react-router.mdx new file mode 100644 index 00000000000000..2c2e0def986847 --- /dev/null +++ b/platform-includes/node-options-windows/javascript.react-router.mdx @@ -0,0 +1,15 @@ + + +If you're on Windows, set the `NODE_OPTIONS` environment variable manually before running your app. + +```bash {tabTitle:cmd} +set NODE_OPTIONS=--import ./instrument.server.mjs +``` + +```powershell {tabTitle:PowerShell} +$env:NODE_OPTIONS="--import ./instrument.server.mjs" +``` + +Read more about [environment variables](https://learn.microsoft.com/en-us/windows/win32/procthread/environment-variables). + + \ No newline at end of file