Skip to content

Commit

Permalink
Merge pull request #5953 from pnvnd/patch-1
Browse files Browse the repository at this point in the history
fix(parser error message): Added another place to escape `@` for JS snippet
  • Loading branch information
zuluecho9 committed Feb 3, 2022
2 parents 0a1173b + 1d2da50 commit e425e17
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,19 @@ These troubleshooting steps apply to problems when New Relic's browser monitorin
```
Parser Error Message: "").pop().split("" is not valid at the start of a code block. Only identifiers, keywords, comments, "(" and "{" are valid.
```

```
error CS0103: The name 'nr' does not exist in the current context
```

The error is caused by an `@` symbol in theJavaScript snippet for browser monitoring . The `@` symbol represents the beginning of a code block in Razor. The line that causes the problem is:
The error is caused by an `@` symbol in the JavaScript snippet for browser monitoring . The `@` symbol represents the beginning of a code block in Razor. The line that causes the problem is:

```
.split("@").pop().split(":")
```
```
"@nr="
```

To fix this issue, use **one** of these workarounds:

Expand All @@ -274,6 +281,9 @@ These troubleshooting steps apply to problems when New Relic's browser monitorin
```
.split("@@").pop().split(":")
```
```
"@@nr="
```

Use only one of the workarounds. Using both will break the code again.
</Collapser>
Expand Down

0 comments on commit e425e17

Please sign in to comment.