Просмотр исходного кода

fix(onboarding): Modify error code snippet (#73175)

Fixes the error code snippet (previous snippet needed the react
integration).
Adds a comment to the Astro test as the conditionals around tracing and
replay have a special behavior.
Sigrid Huemer 8 месяцев назад
Родитель
Сommit
3e38f96197

+ 1 - 0
static/app/gettingStartedDocs/javascript/astro.spec.tsx

@@ -24,6 +24,7 @@ describe('javascript-astro onboarding docs', function () {
     ).toBeInTheDocument();
   });
 
+  /* The Astro SDK adds `browserTrackingIntegration` per default - it does not have to be explicitly added. */
   it("doesn't display any sample rates by default", () => {
     renderWithOnboardingLayout(docs, {
       selectedProducts: [

+ 9 - 3
static/app/gettingStartedDocs/javascript/astro.tsx

@@ -53,9 +53,15 @@ export default defineConfig({
 
 const getVerifyAstroSnippet = () => `
 <!-- your-page.astro -->
-<button onclick="throw new Error('This is a test error')">
-  Throw test error
-</button>
+---
+---
+<button id="error-button">Throw test error</button>
+<script>
+  function handleClick () {
+    throw new Error('This is a test error');
+  }
+  document.querySelector("#error-button").addEventListener("click", handleClick);
+</script>
 `;
 
 const getInstallConfig = () => [