Skip to content

React tutorial does not work #12918

@benjaminblack

Description

@benjaminblack

Which part? Which one?

https://docs.sentry.io/product/sentry-basics/integrate-frontend/initialize-sentry-sdk/

Description

The code in this tutorial simply does not work.

After step 2, Webpack errors with a SyntaxError when attempting to bundle index.js. The output is:

ERROR in ./src/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: /Users/bb/src/frontend-tutorial/src/index.js: Unexpected token, expected "," (20:5)

  18 |     replaysSessionSampleRate: 0.1,
  19 |     replaysOnErrorSampleRate: 1.0,
> 20 |     ${<Sentry.Include name="code-comments/javascript/trace-sample-rate" />}
     |      ^
  21 | });
  22 |

This is using Node 22 (LTS), so the troubleshooting tip does not apply.

Also, step 1 has us install @sentry/react, but that is already installed in package.json so it seems pointless.

Also, upgrading the package.json dependencies to their latest versions breaks the tutorial.

Suggested Solution

Review and update your tutorial

Metadata

Metadata

Assignees

Labels

Projects

Status

Waiting for: Support

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions