Skip to content

Commit d9dcba0

Browse files
Luca Forstnerimatwawana
andauthored
Move multiple origins page into source maps troubleshooting page (#5786)
Co-authored-by: Isabel <[email protected]>
1 parent f364200 commit d9dcba0

File tree

5 files changed

+36
-32
lines changed

5 files changed

+36
-32
lines changed

src/platform-includes/sourcemaps/upload/cli/javascript.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Upload Source Maps Using [`sentry-cli`](/product/cli/)
22

33
When using [`sentry-cli`](/product/cli/) to upload source maps, you need to set up your build system to both create a release and upload the various source files corresponding to that release. For Sentry to demangle your stack traces, provide both:
4+
45
- The deployed files (in other words, the results of your transpilation/minification/bundling process; for example, `app.min.js`)
56
- The corresponding source maps
67

@@ -42,11 +43,10 @@ sentry-cli releases finalize <release_name>
4243

4344
For convenience, you can pass the `--finalize` flag to the `new` command, which will immediately finalize the release.
4445

45-
4646
For more information, see our [`sentry-cli` docs](/product/cli/releases/#managing-release-artifacts).
4747

4848
<PlatformSection notSupported={["node"]} >
4949

50-
Its not uncommon for a web application to be accessible at multiple origins. See our documentation on [multiple origins](../../uploading/multiple-origins/) to learn how to handle this.
50+
It's not uncommon for a web application to be accessible at multiple origins. See our documentation on <PlatformLink to="/sourcemaps/troubleshooting_js/#multiple-origins">multiple origins</PlatformLink> to learn how to handle this.
5151

5252
</PlatformSection>

src/platform-includes/sourcemaps/upload/multiple-origins/javascript.mdx

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/platforms/javascript/common/sourcemaps/troubleshooting_js.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,32 @@ The `~` is used in Sentry to replace the scheme and domain. It is not a glob!
114114

115115
but will NOT match `~/script.js`.
116116

117+
## Multiple Origins
118+
119+
It's not uncommon for a web application to be accessible at multiple origins. For example:
120+
121+
- Website is operable over both `https` and `http`
122+
- Geolocated web addresses: such as `https://us.example.com`, `https://eu.example.com`
123+
- Multiple static CDNs: such as `https://static1.example.com`, `https://static2.example.com`
124+
- Customer-specific domains/subdomains
125+
126+
In this situation, **identical** JavaScript and source map files may be located at two or more distinct origins. In this situation we recommend using our special tilde (`~`) prefix on paths.
127+
128+
So for example, if you have the following:
129+
130+
- https://static1.example.com/js/app.js
131+
- https://static2.example.com/js/app.js
132+
133+
You can upload using the URL of `~/js/app.js`. This will tell Sentry to ignore the domain and use the artifact for any origin.
134+
135+
Additionally you can also upload the same file under multiple names. Under the hood Sentry will deduplicate these.
136+
137+
<Note>
138+
139+
The ~ prefix tells Sentry that for a given URL, **any** combination of protocol and hostname whose path is `/js/app.js` should use this artifact. Use this method **only** if your source/source map files are identical at all possible protocol/hostname combinations. **Sentry will prioritize full URLs over tilde prefixed paths**, if found.
140+
141+
</Note>
142+
117143
## Verify artifact names match `sourceMappingURL` value
118144

119145
The `sourceMappingURL` comment on the last line of your bundled or minified JavaScript file tells Sentry (or the browser) where to locate the corresponding source map. This can either be a fully qualified URL, a relative path, or the filename itself. When uploading artifacts to Sentry, you must name your source map files with the value the file resolves to.

src/platforms/javascript/common/sourcemaps/uploading/multiple-origins.mdx

Lines changed: 0 additions & 7 deletions
This file was deleted.

vercel.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,14 @@
375375
{
376376
"source": "/platforms/node/guides/connect/event-processors/",
377377
"destination": "/platforms/node/enriching-events/event-processors/"
378+
},
379+
{
380+
"source": "/platforms/javascript/sourcemaps/uploading/multiple-origins/",
381+
"destination": "/platforms/javascript/sourcemaps/troubleshooting_js/#multiple-origins"
382+
},
383+
{
384+
"source": "/platforms/javascript/guides/([^/]*)/sourcemaps/uploading/multiple-origins/",
385+
"destination": "/platforms/javascript/guides/$1/sourcemaps/troubleshooting_js/#multiple-origins"
378386
}
379387
]
380388
}

0 commit comments

Comments
 (0)