From 01c4f90654253307ffb84ea99fd81a20178ca37a Mon Sep 17 00:00:00 2001 From: Cody De Arkland Date: Sat, 8 Nov 2025 10:42:21 -0800 Subject: [PATCH 1/4] Update AWS Lambda documentation links and add redirects for versioned guides --- .../cloud-monitoring/aws-lambda/index.mdx | 2 +- .../guides/aws-lambda/install/cjs-npm__v9.x.mdx | 2 +- .../guides/aws-lambda/install/index__v9.x.mdx | 4 ++-- .../guides/aws-lambda/install/layer__v8.x.mdx | 4 ++-- .../guides/aws-lambda/install/layer__v9.x.mdx | 4 ++-- .../javascript/guides/aws-lambda/install/npm.mdx | 2 +- .../guides/aws-lambda/install/npm__v9.x.mdx | 8 ++++---- .../react-native/integrations/plugin.mdx | 2 +- redirects.js | 16 ++++++++++++++++ 9 files changed, 30 insertions(+), 14 deletions(-) diff --git a/docs/organization/integrations/cloud-monitoring/aws-lambda/index.mdx b/docs/organization/integrations/cloud-monitoring/aws-lambda/index.mdx index c2aaa4e90c22a..a6bb9ad18f43b 100644 --- a/docs/organization/integrations/cloud-monitoring/aws-lambda/index.mdx +++ b/docs/organization/integrations/cloud-monitoring/aws-lambda/index.mdx @@ -165,7 +165,7 @@ Currently, there's no way of using the [latest layer plugin](https://www.npmjs.c If you use Node functions in [SST](https://serverless-stack.com) and you want to use this integration, you'll need to: -1. Import the [Lambda layer](/platforms/javascript/guides/aws-lambda/layer/) using the [`LayerVersion`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.LayerVersion.html) construct and set it by calling [`addDefaultFunctionLayers`](https://docs.serverless-stack.com/constructs/Stack#adddefaultfunctionlayers). +1. Import the [Lambda layer](/platforms/javascript/guides/aws-lambda/install/layer/) using the [`LayerVersion`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.LayerVersion.html) construct and set it by calling [`addDefaultFunctionLayers`](https://docs.serverless-stack.com/constructs/Stack#adddefaultfunctionlayers). 2. Then set the `NODE_OPTIONS`, `SENTRY_DSN`, and `SENTRY_TRACES_SAMPLE_RATE` environment variables with the [`addDefaultFunctionEnv`](https://docs.serverless-stack.com/constructs/Stack#adddefaultfunctionenv) method. Read [how this integration works](/organization/integrations/cloud-monitoring/aws-lambda/how-it-works/) and [the SST docs](https://docs.serverless-stack.com/monitoring-your-app-in-prod#sentry) for more information. diff --git a/docs/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x.mdx b/docs/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x.mdx index 1418e777f7d9d..10b3beff0a552 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x.mdx @@ -11,7 +11,7 @@ In this guide you will learn how to set up the `@sentry/aws-serverless` SDK for We recommend starting the SDK automatically via environment variables so that you only have to make minimal code changes to your lambda function. If you need more control over the SDK setup, you can also [initialize the SDK in in code](#alternative-initialize-the-sdk-in-code). -However, you need to modify your code and deploy the Sentry dependencies alongside your function code. If you're looking for the most simple way to set up Sentry, you might want to use the [Lambda Layer](./layer__v9.x.mdx) instead. +However, you need to modify your code and deploy the Sentry dependencies alongside your function code. If you're looking for the most simple way to set up Sentry, you might want to use the [Lambda Layer](./layer__v9.x) instead. ## 1. Prerequisites diff --git a/docs/platforms/javascript/guides/aws-lambda/install/index__v9.x.mdx b/docs/platforms/javascript/guides/aws-lambda/install/index__v9.x.mdx index 27303bf92530b..cd9f4ec6976d9 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/index__v9.x.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/index__v9.x.mdx @@ -18,11 +18,11 @@ Note that TypeScript can also be configured to output ESM, in which case you sho ### My Lambda function uses `require` -If you are using `require()` in your function, follow the CommonJS instructions. Choose between [using our Lambda Layer (recommended)](./install/layer__v9.x.mdx) or [installing the Sentry AWS NPM package](./install/npm__v9.x.mdx). +If you are using `require()` in your function, follow the CommonJS instructions. Choose between [using our Lambda Layer (recommended)](./layer__v9.x) or [installing the Sentry AWS NPM package](./npm__v9.x). ### My Lambda function uses `import` -If you're using `import` syntax in your function and you're _not_ transpiling the code to CommonJS, follow the [ESM instructions](./install/esm-npm__v9.x.mdx). +If you're using `import` syntax in your function and you're _not_ transpiling the code to CommonJS, follow the [ESM instructions](./esm-npm__v9.x). ### Can I use the Lambda layer for ESM functions? diff --git a/docs/platforms/javascript/guides/aws-lambda/install/layer__v8.x.mdx b/docs/platforms/javascript/guides/aws-lambda/install/layer__v8.x.mdx index ab5246299ff56..fb5d19fd67302 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/layer__v8.x.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/layer__v8.x.mdx @@ -8,13 +8,13 @@ noindex: true og_image: /og-images/platforms-javascript-guides-aws-lambda-install-layer__v8.x.png --- -The easiest way to get started with Sentry is to use the Sentry [Lambda Layer](https://docs.aws.amazon.com/Lambda/latest/dg/configuration-layers.html) instead of adding `@sentry/aws-serverless` with `npm` or `yarn` [manually](../install/npm.mdx). +The easiest way to get started with Sentry is to use the Sentry [Lambda Layer](https://docs.aws.amazon.com/Lambda/latest/dg/configuration-layers.html) instead of adding `@sentry/aws-serverless` with `npm` or `yarn` [manually](./npm). If you follow this guide, you don't have to worry about deploying Sentry dependencies alongside your function code. To actually start the SDK, you can decide between setting up the SDK using environment variables or in your Lambda function code. We recommend using environment variables as it's the easiest way to get started. [Initializing the SDK in code](#alternative-initialize-the-sdk-in-code) instead of setting environment variables gives you more control over the SDK setup if you need it. -This installation method **does not** work with Lambda functions running in EcmaScript Modules (ESM) mode, using `import` syntax. If you're running your function in ESM, follow the [ESM guide](../install/npm.mdx). +This installation method **does not** work with Lambda functions running in EcmaScript Modules (ESM) mode, using `import` syntax. If you're running your function in ESM, follow the [ESM guide](./npm). diff --git a/docs/platforms/javascript/guides/aws-lambda/install/layer__v9.x.mdx b/docs/platforms/javascript/guides/aws-lambda/install/layer__v9.x.mdx index 56b72c91a802c..bf7b9d8fa047f 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/layer__v9.x.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/layer__v9.x.mdx @@ -7,13 +7,13 @@ sidebar_order: 1 og_image: /og-images/platforms-javascript-guides-aws-lambda-install-layer__v9.x.png --- -The easiest way to get started with Sentry is to use the Sentry [Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/adding-layers.html) instead of adding `@sentry/aws-serverless` with `npm` or `yarn` [manually](./npm__v9.x.mdx). +The easiest way to get started with Sentry is to use the Sentry [Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/adding-layers.html) instead of adding `@sentry/aws-serverless` with `npm` or `yarn` [manually](./npm__v9.x). If you follow this guide, you don't have to worry about deploying Sentry dependencies alongside your function code. To actually start the SDK, you can decide between setting up the SDK using environment variables or in your Lambda function code. We recommend using environment variables as it's the easiest way to get started. [Initializing the SDK in code](#alternative-initialize-the-sdk-in-code) instead of setting environment variables gives you more control over the SDK setup if you need it. -This installation method **does not** work with Lambda functions running in EcmaScript Modules (ESM) mode, using `import` syntax. If you're running your function in ESM, follow the [ESM guide](../npm__v9.x.mdx). +This installation method **does not** work with Lambda functions running in EcmaScript Modules (ESM) mode, using `import` syntax. If you're running your function in ESM, follow the [ESM guide](./esm-npm__v9.x). diff --git a/docs/platforms/javascript/guides/aws-lambda/install/npm.mdx b/docs/platforms/javascript/guides/aws-lambda/install/npm.mdx index 6e4faeca5a935..1b836b46cc7e9 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/npm.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/npm.mdx @@ -11,7 +11,7 @@ In this guide you will learn how to set up the `@sentry/aws-serverless` SDK for We recommend starting the SDK automatically via environment variables so that you only have to make minimal code changes to your lambda function. If you need more control over the SDK setup, you can also [initialize the SDK in code](#option-b-manual-setup). -However, you need to modify your code and deploy the Sentry dependencies alongside your function code. If you're looking for the most simple way to set up Sentry, use the [Lambda Layer](../layer) instead. +However, you need to modify your code and deploy the Sentry dependencies alongside your function code. If you're looking for the most simple way to set up Sentry, use the [Lambda Layer](./layer) instead. ## 1. Prerequisites diff --git a/docs/platforms/javascript/guides/aws-lambda/install/npm__v9.x.mdx b/docs/platforms/javascript/guides/aws-lambda/install/npm__v9.x.mdx index ecbc8c578957c..b6fec3a516705 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/npm__v9.x.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/npm__v9.x.mdx @@ -8,13 +8,13 @@ Based on whether your Lambda function runs in CommonJS or ESM, you need to follo ## My Lambda function is written in TypeScript -If you're using TypeScript, your lambda function is likely transpiled to CommonJS before running it. In this case, follow the [CommonJS instructions](./cjs-npm__v9.x.mdx). -Note that TypeScript can also be configured to output ESM, in which case you should follow the [ESM instructions](./esm-npm__v9.x.mdx). +If you're using TypeScript, your lambda function is likely transpiled to CommonJS before running it. In this case, follow the [CommonJS instructions](./cjs-npm__v9.x). +Note that TypeScript can also be configured to output ESM, in which case you should follow the [ESM instructions](./esm-npm__v9.x). ## My Lambda function uses `require` -If you are using `require()` in your function, follow the [CommonJS instructions](./cjs-npm__v9.x.mdx). +If you are using `require()` in your function, follow the [CommonJS instructions](./cjs-npm__v9.x). ## My Lambda function uses `import` -If you're using `import` syntax in your function and you're _not_ transpiling the code to CommonJS, follow the [ESM instructions](./esm-npm__v9.x.mdx). +If you're using `import` syntax in your function and you're _not_ transpiling the code to CommonJS, follow the [ESM instructions](./esm-npm__v9.x). diff --git a/docs/platforms/react-native/integrations/plugin.mdx b/docs/platforms/react-native/integrations/plugin.mdx index 2336c1e029212..8042d40e0649f 100644 --- a/docs/platforms/react-native/integrations/plugin.mdx +++ b/docs/platforms/react-native/integrations/plugin.mdx @@ -126,4 +126,4 @@ Sentry.init({ }); ``` -For more information, please refer to [the Supabase integration documentation for the JavaScript SDK](javascript/guides/node/configuration/integrations/supabase/). +For more information, please refer to [the Supabase integration documentation for the JavaScript SDK](/platforms/javascript/guides/node/configuration/integrations/supabase/). diff --git a/redirects.js b/redirects.js index d29d422c3601d..f15543a715e1e 100644 --- a/redirects.js +++ b/redirects.js @@ -271,6 +271,22 @@ const userDocsRedirects = [ source: '/organization/integrations/launchdarkly/', destination: '/organization/integrations/feature-flag/launchdarkly/', }, + { + source: '/platforms/javascript/guides/aws-lambda/layer__v9.x', + destination: '/platforms/javascript/guides/aws-lambda/install/layer__v9.x', + }, + { + source: '/platforms/javascript/guides/aws-lambda/npm__v9.x', + destination: '/platforms/javascript/guides/aws-lambda/install/npm__v9.x', + }, + { + source: '/platforms/javascript/guides/aws-lambda/esm-npm__v9.x', + destination: '/platforms/javascript/guides/aws-lambda/install/esm-npm__v9.x', + }, + { + source: '/platforms/javascript/guides/aws-lambda/cjs-npm__v9.x', + destination: '/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x', + }, { source: '/platforms/javascript/guides/nextjs/sourcemaps/uploading/', destination: '/platforms/javascript/guides/nextjs/sourcemaps/', From e869c3fdd08bb6e4fdcd70a8a5a977a29b009184 Mon Sep 17 00:00:00 2001 From: Cody De Arkland Date: Sat, 8 Nov 2025 11:04:42 -0800 Subject: [PATCH 2/4] fix: Add trailing slashes to AWS Lambda redirects to match Next.js config --- redirects.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/redirects.js b/redirects.js index f15543a715e1e..1b551ce15b746 100644 --- a/redirects.js +++ b/redirects.js @@ -272,20 +272,20 @@ const userDocsRedirects = [ destination: '/organization/integrations/feature-flag/launchdarkly/', }, { - source: '/platforms/javascript/guides/aws-lambda/layer__v9.x', - destination: '/platforms/javascript/guides/aws-lambda/install/layer__v9.x', + source: '/platforms/javascript/guides/aws-lambda/layer__v9.x/', + destination: '/platforms/javascript/guides/aws-lambda/install/layer__v9.x/', }, { - source: '/platforms/javascript/guides/aws-lambda/npm__v9.x', - destination: '/platforms/javascript/guides/aws-lambda/install/npm__v9.x', + source: '/platforms/javascript/guides/aws-lambda/npm__v9.x/', + destination: '/platforms/javascript/guides/aws-lambda/install/npm__v9.x/', }, { - source: '/platforms/javascript/guides/aws-lambda/esm-npm__v9.x', - destination: '/platforms/javascript/guides/aws-lambda/install/esm-npm__v9.x', + source: '/platforms/javascript/guides/aws-lambda/esm-npm__v9.x/', + destination: '/platforms/javascript/guides/aws-lambda/install/esm-npm__v9.x/', }, { - source: '/platforms/javascript/guides/aws-lambda/cjs-npm__v9.x', - destination: '/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x', + source: '/platforms/javascript/guides/aws-lambda/cjs-npm__v9.x/', + destination: '/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x/', }, { source: '/platforms/javascript/guides/nextjs/sourcemaps/uploading/', From ee129ae1630dde04abfe193ef796804845a4cc7b Mon Sep 17 00:00:00 2001 From: Cody De Arkland Date: Sat, 8 Nov 2025 13:16:53 -0800 Subject: [PATCH 3/4] Fixing aws lambda 404 links --- .../guides/aws-lambda/install/cjs-npm__v9.x.mdx | 2 +- .../javascript/guides/aws-lambda/install/index__v9.x.mdx | 4 ++-- .../javascript/guides/aws-lambda/install/layer__v8.x.mdx | 4 ++-- .../javascript/guides/aws-lambda/install/layer__v9.x.mdx | 4 ++-- .../javascript/guides/aws-lambda/install/npm.mdx | 2 +- .../javascript/guides/aws-lambda/install/npm__v9.x.mdx | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x.mdx b/docs/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x.mdx index 10b3beff0a552..45816932d6b28 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x.mdx @@ -11,7 +11,7 @@ In this guide you will learn how to set up the `@sentry/aws-serverless` SDK for We recommend starting the SDK automatically via environment variables so that you only have to make minimal code changes to your lambda function. If you need more control over the SDK setup, you can also [initialize the SDK in in code](#alternative-initialize-the-sdk-in-code). -However, you need to modify your code and deploy the Sentry dependencies alongside your function code. If you're looking for the most simple way to set up Sentry, you might want to use the [Lambda Layer](./layer__v9.x) instead. +However, you need to modify your code and deploy the Sentry dependencies alongside your function code. If you're looking for the most simple way to set up Sentry, you might want to use the [Lambda Layer](/platforms/javascript/guides/aws-lambda/install/layer__v9.x) instead. ## 1. Prerequisites diff --git a/docs/platforms/javascript/guides/aws-lambda/install/index__v9.x.mdx b/docs/platforms/javascript/guides/aws-lambda/install/index__v9.x.mdx index cd9f4ec6976d9..55ed8e3a708f7 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/index__v9.x.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/index__v9.x.mdx @@ -18,11 +18,11 @@ Note that TypeScript can also be configured to output ESM, in which case you sho ### My Lambda function uses `require` -If you are using `require()` in your function, follow the CommonJS instructions. Choose between [using our Lambda Layer (recommended)](./layer__v9.x) or [installing the Sentry AWS NPM package](./npm__v9.x). +If you are using `require()` in your function, follow the CommonJS instructions. Choose between [using our Lambda Layer (recommended)](/platforms/javascript/guides/aws-lambda/install/layer__v9.x) or [installing the Sentry AWS NPM package](/platforms/javascript/guides/aws-lambda/install/npm__v9.x). ### My Lambda function uses `import` -If you're using `import` syntax in your function and you're _not_ transpiling the code to CommonJS, follow the [ESM instructions](./esm-npm__v9.x). +If you're using `import` syntax in your function and you're _not_ transpiling the code to CommonJS, follow the [ESM instructions](/platforms/javascript/guides/aws-lambda/install/esm-npm__v9.x). ### Can I use the Lambda layer for ESM functions? diff --git a/docs/platforms/javascript/guides/aws-lambda/install/layer__v8.x.mdx b/docs/platforms/javascript/guides/aws-lambda/install/layer__v8.x.mdx index fb5d19fd67302..61e109a9aa73e 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/layer__v8.x.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/layer__v8.x.mdx @@ -8,13 +8,13 @@ noindex: true og_image: /og-images/platforms-javascript-guides-aws-lambda-install-layer__v8.x.png --- -The easiest way to get started with Sentry is to use the Sentry [Lambda Layer](https://docs.aws.amazon.com/Lambda/latest/dg/configuration-layers.html) instead of adding `@sentry/aws-serverless` with `npm` or `yarn` [manually](./npm). +The easiest way to get started with Sentry is to use the Sentry [Lambda Layer](https://docs.aws.amazon.com/Lambda/latest/dg/configuration-layers.html) instead of adding `@sentry/aws-serverless` with `npm` or `yarn` [manually](/platforms/javascript/guides/aws-lambda/install/npm). If you follow this guide, you don't have to worry about deploying Sentry dependencies alongside your function code. To actually start the SDK, you can decide between setting up the SDK using environment variables or in your Lambda function code. We recommend using environment variables as it's the easiest way to get started. [Initializing the SDK in code](#alternative-initialize-the-sdk-in-code) instead of setting environment variables gives you more control over the SDK setup if you need it. -This installation method **does not** work with Lambda functions running in EcmaScript Modules (ESM) mode, using `import` syntax. If you're running your function in ESM, follow the [ESM guide](./npm). +This installation method **does not** work with Lambda functions running in EcmaScript Modules (ESM) mode, using `import` syntax. If you're running your function in ESM, follow the [ESM guide](/platforms/javascript/guides/aws-lambda/install/npm). diff --git a/docs/platforms/javascript/guides/aws-lambda/install/layer__v9.x.mdx b/docs/platforms/javascript/guides/aws-lambda/install/layer__v9.x.mdx index bf7b9d8fa047f..df7119716f17b 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/layer__v9.x.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/layer__v9.x.mdx @@ -7,13 +7,13 @@ sidebar_order: 1 og_image: /og-images/platforms-javascript-guides-aws-lambda-install-layer__v9.x.png --- -The easiest way to get started with Sentry is to use the Sentry [Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/adding-layers.html) instead of adding `@sentry/aws-serverless` with `npm` or `yarn` [manually](./npm__v9.x). +The easiest way to get started with Sentry is to use the Sentry [Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/adding-layers.html) instead of adding `@sentry/aws-serverless` with `npm` or `yarn` [manually](/platforms/javascript/guides/aws-lambda/install/npm__v9.x). If you follow this guide, you don't have to worry about deploying Sentry dependencies alongside your function code. To actually start the SDK, you can decide between setting up the SDK using environment variables or in your Lambda function code. We recommend using environment variables as it's the easiest way to get started. [Initializing the SDK in code](#alternative-initialize-the-sdk-in-code) instead of setting environment variables gives you more control over the SDK setup if you need it. -This installation method **does not** work with Lambda functions running in EcmaScript Modules (ESM) mode, using `import` syntax. If you're running your function in ESM, follow the [ESM guide](./esm-npm__v9.x). +This installation method **does not** work with Lambda functions running in EcmaScript Modules (ESM) mode, using `import` syntax. If you're running your function in ESM, follow the [ESM guide](/platforms/javascript/guides/aws-lambda/install/esm-npm__v9.x). diff --git a/docs/platforms/javascript/guides/aws-lambda/install/npm.mdx b/docs/platforms/javascript/guides/aws-lambda/install/npm.mdx index 1b836b46cc7e9..9f8e538eeb844 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/npm.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/npm.mdx @@ -11,7 +11,7 @@ In this guide you will learn how to set up the `@sentry/aws-serverless` SDK for We recommend starting the SDK automatically via environment variables so that you only have to make minimal code changes to your lambda function. If you need more control over the SDK setup, you can also [initialize the SDK in code](#option-b-manual-setup). -However, you need to modify your code and deploy the Sentry dependencies alongside your function code. If you're looking for the most simple way to set up Sentry, use the [Lambda Layer](./layer) instead. +However, you need to modify your code and deploy the Sentry dependencies alongside your function code. If you're looking for the most simple way to set up Sentry, use the [Lambda Layer](/platforms/javascript/guides/aws-lambda/install/layer) instead. ## 1. Prerequisites diff --git a/docs/platforms/javascript/guides/aws-lambda/install/npm__v9.x.mdx b/docs/platforms/javascript/guides/aws-lambda/install/npm__v9.x.mdx index b6fec3a516705..5dda8bf772fd9 100644 --- a/docs/platforms/javascript/guides/aws-lambda/install/npm__v9.x.mdx +++ b/docs/platforms/javascript/guides/aws-lambda/install/npm__v9.x.mdx @@ -8,13 +8,13 @@ Based on whether your Lambda function runs in CommonJS or ESM, you need to follo ## My Lambda function is written in TypeScript -If you're using TypeScript, your lambda function is likely transpiled to CommonJS before running it. In this case, follow the [CommonJS instructions](./cjs-npm__v9.x). -Note that TypeScript can also be configured to output ESM, in which case you should follow the [ESM instructions](./esm-npm__v9.x). +If you're using TypeScript, your lambda function is likely transpiled to CommonJS before running it. In this case, follow the [CommonJS instructions](/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x). +Note that TypeScript can also be configured to output ESM, in which case you should follow the [ESM instructions](/platforms/javascript/guides/aws-lambda/install/esm-npm__v9.x). ## My Lambda function uses `require` -If you are using `require()` in your function, follow the [CommonJS instructions](./cjs-npm__v9.x). +If you are using `require()` in your function, follow the [CommonJS instructions](/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x). ## My Lambda function uses `import` -If you're using `import` syntax in your function and you're _not_ transpiling the code to CommonJS, follow the [ESM instructions](./esm-npm__v9.x). +If you're using `import` syntax in your function and you're _not_ transpiling the code to CommonJS, follow the [ESM instructions](/platforms/javascript/guides/aws-lambda/install/esm-npm__v9.x). From 3c69a37926ca0aae47b071e1a61abe24bf37dfcd Mon Sep 17 00:00:00 2001 From: Cody De Arkland Date: Sat, 8 Nov 2025 13:17:11 -0800 Subject: [PATCH 4/4] adding switch to 404 check script to let you filter to specific directories for testing --- scripts/lint-404s/main.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/lint-404s/main.ts b/scripts/lint-404s/main.ts index 8470a8526055c..706d42ff2f238 100644 --- a/scripts/lint-404s/main.ts +++ b/scripts/lint-404s/main.ts @@ -14,6 +14,13 @@ const ignoreListFile = path.join(dirname(import.meta.url), './ignore-list.txt'); const showProgress = process.argv.includes('--progress'); +// Get the path filter if specified +const pathFilterIndex = process.argv.indexOf('--path'); +const pathFilter = + pathFilterIndex !== -1 && process.argv[pathFilterIndex + 1] + ? trimSlashes(process.argv[pathFilterIndex + 1]) + : null; + // Paths to skip const ignoreList: string[] = readFileSync(fileURLToPath(ignoreListFile), 'utf8') .split('\n') @@ -34,10 +41,15 @@ async function main() { const slugs = [...sitemap.matchAll(/([^<]*)<\/loc>/g)] .map(l => l[1]) .map(url => trimSlashes(new URL(url).pathname)) - .filter(Boolean); + .filter(Boolean) + .filter(slug => (pathFilter ? slug.startsWith(pathFilter) : true)); const allSlugsSet = new Set(slugs); - console.log('Checking 404s on %d pages', slugs.length); + if (pathFilter) { + console.log('Checking 404s on %d pages in /%s', slugs.length, pathFilter); + } else { + console.log('Checking 404s on %d pages', slugs.length); + } const all404s: {page404s: Link[]; slug: string}[] = [];