Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions docs/platforms/javascript/guides/react-router/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<PlatformContent includePath="node-options-windows" />

```json {filename: package.json}
"scripts": {
"dev": "NODE_OPTIONS='--import ./instrument.server.mjs' react-router dev",
Expand Down
15 changes: 15 additions & 0 deletions platform-includes/node-options-windows/javascript.react-router.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Expandable title="Are you using Windows?">

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).

</Expandable>
Loading