Skip to content

Frontend Error Monitoring Tutorial error: browserTracingIntegration is not a constructor #11751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
13013SwagR opened this issue Nov 6, 2024 · 4 comments · Fixed by #11801
Closed
Assignees

Comments

@13013SwagR
Copy link

SDK

Android SDK

Description

Following this doc https://docs.sentry.io/product/sentry-basics/integrate-frontend/initialize-sentry-sdk/#2-add-the-sentry-react-sdk
this line new Sentry.browserTracingIntegration(),
throws this error:

Uncaught TypeError: _sentry_react__WEBPACK_IMPORTED_MODULE_5__.browserTracingIntegration is not a constructor

Here is my package.json

{
  "name": "frontend-tutorial-2",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "build": "webpack",
    "start": "webpack serve --mode development",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@babel/core": "^7.22.5",
    "@babel/preset-env": "^7.22.5",
    "@babel/preset-react": "^7.22.5",
    "babel-loader": "^9.1.2",
    "css-loader": "^6.8.1",
    "html-webpack-plugin": "^5.5.3",
    "style-loader": "^3.3.3",
    "webpack": "^5.87.0",
    "webpack-cli": "^5.1.4",
    "webpack-dev-server": "^4.15.1"
  },
  "dependencies": {
    "@sentry/react": "^8.37.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0"
  }
}


### Suggested Solution

Using `Sentry.browserTracingIntegration(),`  seems to work
@getsantry
Copy link
Contributor

getsantry bot commented Nov 6, 2024

Assigning to @getsentry/support for routing ⏲️

@coolguyzone
Copy link
Contributor

coolguyzone commented Nov 12, 2024

Interesting, thanks for flagging this @13013SwagR! It seems to be a result of the new keyword here, I'm not sure why we are using the constructor on some of these integrations. My hunch is that the constructor form of these integrations is deprecated, I will bring this up with some of our JS engineers and confirm.

@coolguyzone
Copy link
Contributor

I've confirmed with our JS engineers that the constructor functions are deprecated here and don't work in the latest js sdks. Have a PR to update here: #11801

@github-project-automation github-project-automation bot moved this from Needs Discussion to Done in Mobile SDKs Nov 12, 2024
@13013SwagR
Copy link
Author

Thanks for the quick resolution!

@github-actions github-actions bot locked and limited conversation to collaborators Nov 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants