Skip to content

Commit

Permalink
Fix module trace error messages to not include queries (#41738)
Browse files Browse the repository at this point in the history
This improves errors like this:

```
One of these is marked as a client entry with "use client":
  app/page2/page.tsx?__edge_ssr_entry__
```

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
shuding and kodiakhq[bot] committed Oct 24, 2022
1 parent 5223d66 commit ef62bf3
Showing 1 changed file with 3 additions and 1 deletion.
Expand Up @@ -89,7 +89,9 @@ export function getRscError(
formattedError[1] +
moduleTrace
.map((m) =>
m.resource ? ' ' + relative(compiler.context, m.resource) : ''
m.resource
? ' ' + relative(compiler.context, m.resource).replace(/\?.+$/, '')
: ''
)
.filter(Boolean)
.join('\n')
Expand Down

0 comments on commit ef62bf3

Please sign in to comment.