Skip to content

Commit 2660b24

Browse files
authored
Fixing broken 404 Links for Supabase and Lambda docs (#15434)
1 parent 31703a1 commit 2660b24

File tree

10 files changed

+44
-16
lines changed

10 files changed

+44
-16
lines changed

docs/organization/integrations/cloud-monitoring/aws-lambda/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Currently, there's no way of using the [latest layer plugin](https://www.npmjs.c
165165

166166
If you use Node functions in [SST](https://serverless-stack.com) and you want to use this integration, you'll need to:
167167

168-
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).
168+
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).
169169
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.
170170

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

docs/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ In this guide you will learn how to set up the `@sentry/aws-serverless` SDK for
1111
We recommend starting the SDK automatically via environment variables so that you only have to make minimal code changes to your lambda function.
1212
If you need more control over the SDK setup, you can also [initialize the SDK in in code](#alternative-initialize-the-sdk-in-code).
1313

14-
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.
14+
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.
1515

1616
## 1. Prerequisites
1717

docs/platforms/javascript/guides/aws-lambda/install/index__v9.x.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ Note that TypeScript can also be configured to output ESM, in which case you sho
1818

1919
### My Lambda function uses `require`
2020

21-
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).
21+
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).
2222

2323
### My Lambda function uses `import`
2424

25-
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).
25+
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).
2626

2727
### Can I use the Lambda layer for ESM functions?
2828

docs/platforms/javascript/guides/aws-lambda/install/layer__v8.x.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ noindex: true
88
og_image: /og-images/platforms-javascript-guides-aws-lambda-install-layer__v8.x.png
99
---
1010

11-
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).
11+
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).
1212
If you follow this guide, you don't have to worry about deploying Sentry dependencies alongside your function code.
1313
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.
1414

1515
<Alert>
1616

17-
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).
17+
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).
1818

1919
</Alert>
2020

docs/platforms/javascript/guides/aws-lambda/install/layer__v9.x.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ sidebar_order: 1
77
og_image: /og-images/platforms-javascript-guides-aws-lambda-install-layer__v9.x.png
88
---
99

10-
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).
10+
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).
1111
If you follow this guide, you don't have to worry about deploying Sentry dependencies alongside your function code.
1212
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.
1313

1414
<Alert>
1515

16-
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).
16+
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).
1717

1818
</Alert>
1919

docs/platforms/javascript/guides/aws-lambda/install/npm.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ In this guide you will learn how to set up the `@sentry/aws-serverless` SDK for
1111
We recommend starting the SDK automatically via environment variables so that you only have to make minimal code changes to your lambda function.
1212
If you need more control over the SDK setup, you can also [initialize the SDK in code](#option-b-manual-setup).
1313

14-
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.
14+
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.
1515

1616
## 1. Prerequisites
1717

docs/platforms/javascript/guides/aws-lambda/install/npm__v9.x.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ Based on whether your Lambda function runs in CommonJS or ESM, you need to follo
88

99
## My Lambda function is written in TypeScript
1010

11-
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).
12-
Note that TypeScript can also be configured to output ESM, in which case you should follow the [ESM instructions](./esm-npm__v9.x.mdx).
11+
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).
12+
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).
1313

1414
## My Lambda function uses `require`
1515

16-
If you are using `require()` in your function, follow the [CommonJS instructions](./cjs-npm__v9.x.mdx).
16+
If you are using `require()` in your function, follow the [CommonJS instructions](/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x).
1717

1818
## My Lambda function uses `import`
1919

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

docs/platforms/react-native/integrations/plugin.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,4 @@ Sentry.init({
126126
});
127127
```
128128

129-
For more information, please refer to [the Supabase integration documentation for the JavaScript SDK](javascript/guides/node/configuration/integrations/supabase/).
129+
For more information, please refer to [the Supabase integration documentation for the JavaScript SDK](/platforms/javascript/guides/node/configuration/integrations/supabase/).

redirects.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,22 @@ const userDocsRedirects = [
271271
source: '/organization/integrations/launchdarkly/',
272272
destination: '/organization/integrations/feature-flag/launchdarkly/',
273273
},
274+
{
275+
source: '/platforms/javascript/guides/aws-lambda/layer__v9.x/',
276+
destination: '/platforms/javascript/guides/aws-lambda/install/layer__v9.x/',
277+
},
278+
{
279+
source: '/platforms/javascript/guides/aws-lambda/npm__v9.x/',
280+
destination: '/platforms/javascript/guides/aws-lambda/install/npm__v9.x/',
281+
},
282+
{
283+
source: '/platforms/javascript/guides/aws-lambda/esm-npm__v9.x/',
284+
destination: '/platforms/javascript/guides/aws-lambda/install/esm-npm__v9.x/',
285+
},
286+
{
287+
source: '/platforms/javascript/guides/aws-lambda/cjs-npm__v9.x/',
288+
destination: '/platforms/javascript/guides/aws-lambda/install/cjs-npm__v9.x/',
289+
},
274290
{
275291
source: '/platforms/javascript/guides/nextjs/sourcemaps/uploading/',
276292
destination: '/platforms/javascript/guides/nextjs/sourcemaps/',

scripts/lint-404s/main.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ const ignoreListFile = path.join(dirname(import.meta.url), './ignore-list.txt');
1414

1515
const showProgress = process.argv.includes('--progress');
1616

17+
// Get the path filter if specified
18+
const pathFilterIndex = process.argv.indexOf('--path');
19+
const pathFilter =
20+
pathFilterIndex !== -1 && process.argv[pathFilterIndex + 1]
21+
? trimSlashes(process.argv[pathFilterIndex + 1])
22+
: null;
23+
1724
// Paths to skip
1825
const ignoreList: string[] = readFileSync(fileURLToPath(ignoreListFile), 'utf8')
1926
.split('\n')
@@ -34,10 +41,15 @@ async function main() {
3441
const slugs = [...sitemap.matchAll(/<loc>([^<]*)<\/loc>/g)]
3542
.map(l => l[1])
3643
.map(url => trimSlashes(new URL(url).pathname))
37-
.filter(Boolean);
44+
.filter(Boolean)
45+
.filter(slug => (pathFilter ? slug.startsWith(pathFilter) : true));
3846
const allSlugsSet = new Set(slugs);
3947

40-
console.log('Checking 404s on %d pages', slugs.length);
48+
if (pathFilter) {
49+
console.log('Checking 404s on %d pages in /%s', slugs.length, pathFilter);
50+
} else {
51+
console.log('Checking 404s on %d pages', slugs.length);
52+
}
4153

4254
const all404s: {page404s: Link[]; slug: string}[] = [];
4355

0 commit comments

Comments
 (0)