I’m following the instructions mentioned in https://www.npmjs.com/package/@newrelic/browser-agent#new-relic-browser-agent; unfortunately, when my application reaches the import statement, it fails.
import { BrowserAgent } from '@newrelic/browser-agent/loaders/browser-agent'
const options = {
init: { distributed_tracing: { enabled: true }, privacy: { cookies_enabled: true }, ajax: { deny_list: ["bam.nr-data.net"] } },
info: { beacon: "bam.nr-data.net", errorBeacon: "bam.nr-data.net", licenseKey: "xxx", applicationID: "xxx", sa: 1 },
loader_config: { accountID: "xxx", trustKey: "xxx", agentID: "xx", licenseKey: "xx", applicationID: "xx" }
}
new BrowserAgent(options)
The exception I receive is
./src/App.tsx
Module not found: Can’t resolve ‘@newrelic/browser-agent/loaders/browser-agent’ in ‘~/code/clients/web/ClientApp/src’
I assumed it’s because project isn’t set up for using @
references, would have to update tsconfig.json
; so I added the following to the tsconfig
{
"compilerOptions": {
"paths": {
"@/*": [
"./*"
],
}
}
}
Every time I execute npm start
; somehow my changes in the tsconfig
are overwritten. How can I keep those changes? or make sure the app is importing the correct module?
3