Skip to content

Conversation

@phryneas
Copy link
Contributor

Disclaimer: I swear that this is not AI slop or any other kind of spam, but a real problem I encountered by following the current docs, which lead me to dig into the source code.
I just want to correct the example so others have an easier time following the docs.


event.detail in the logger example could either be CompilerErrorDetail or CompilerDiagnostic, yet the example only handled the simpler (but deprecated) CompilerErrorDetail.
In reality, I've seen both of these show up in the logger function.

This adds a call to primaryLocation (if present) to account for the different structure of CompilerDiagnostic - loc is not present there.

…rError.details`

`event.detail` in the logger example could either be `CompilerErrorDetail` or `CompilerDiagnostic`, yet the example only handled the simpler (but deprecated) `CompilerErrorDetail`.

This adds a call to `primaryLocation` (if present) to account for the different structure of `CompilerDiagnostic` - `loc` is not present there.
@github-actions
Copy link

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant