0

This is my main.ts file

import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { enableProdMode } from "@angular/core";
import { AppModule } from './app/app.module';
import * as Sentry from '@sentry/angular-ivy'
import { BrowserTracing } from '@sentry/angular-ivy';

Sentry.init({
  dsn: "I gave the correct dsn in my code just modified here for security purpose",
  integrations: [
    new Sentry.BrowserTracing({
      routingInstrumentation: Sentry.routingInstrumentation,
    }),
    new Sentry.Replay(),
  ],

  tracesSampleRate: 1.0,
  tracePropagationTargets: ["http://localhost:4200/"],

  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
});
enableProdMode();

platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.error(err));

When an error occurs, I receive it in my sentry project but the source mapping is not working Sentry Issue Log

This is the error I got in my browser inspect CORS error

I tried to overcome the CORS error by disabling the Ad-Blocker in my browser but still the error persists

NIKIL S
  • 11
  • 3
  • Looks like a problem with the Sentry API. There's a closed, but apparently un-fixed big ticket at https://github.com/getsentry/sentry/issues/49535. You're going to have to take it up with them. – GreyBeardedGeek Jul 17 '23 at 11:54

1 Answers1

0

The CORS contract is controlled by the server, not the browser. If the server does not provide the correct headers, then there is nothing that you can do to overcome the error from the browser side.

You are going to have to fix this at the server.

For some more info, see Response for preflight does not have HTTP ok status in angular

GreyBeardedGeek
  • 29,460
  • 2
  • 47
  • 67