rsnext/test/development/acceptance
Hannes Bornö 9e86fd1d58
Fix "use client" in pages dir errors (#46191)
When in the pages dir, the compiler errors where the `"use client"` directive is used incorrectly should tell the user how to fix the error - not just say:
```
You have tried to use the "use client" directive which is not supported in the pages/ directory.
```

This removes those cases and instead displays the same error as in the app dir. However, if you try to import something that requires it to be a Server Component, the pages error is still:
```
That only works in a Server Component which is not supported in the pages/ directory.
````

ref: [slack](https://vercel.slack.com/archives/C035J346QQL/p1676983422753729)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/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`
- [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) 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`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-02-21 14:07:41 +00:00
..
__snapshots__ Update turbopack to 230209.02 (#45776)Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> 2023-02-10 17:40:19 +01:00
helpers.ts Ensure next.url is used instead of next.appPort (#44163) 2022-12-19 13:29:50 -08:00
ReactRefresh.test.ts Update test set-up to leverage playwright when able to (#28634) 2021-09-13 14:36:25 +02:00
ReactRefreshLogBox-app-doc.test.ts Update some flakey acceptance tests (#44984) 2023-01-17 13:14:43 -08:00
ReactRefreshLogBox-builtins.test.ts test(snapshot): allow snapshot test not invalidate with --turbo (#43545) 2023-01-13 12:02:44 -08:00
ReactRefreshLogBox-scss.test.ts Update some flakey acceptance tests (#44984) 2023-01-17 13:14:43 -08:00
ReactRefreshLogBox.test.ts Fix error overlay links in parenthesis (#45155) 2023-01-23 20:09:11 -08:00
ReactRefreshLogBoxMisc.test.ts Update some flakey acceptance tests (#44984) 2023-01-17 13:14:43 -08:00
ReactRefreshModule.test.ts Update some flakey acceptance tests (#44984) 2023-01-17 13:14:43 -08:00
ReactRefreshRegression.test.ts Update some flakey acceptance tests (#44984) 2023-01-17 13:14:43 -08:00
ReactRefreshRequire.test.ts Update test set-up to leverage playwright when able to (#28634) 2021-09-13 14:36:25 +02:00
server-component-compiler-errors-in-pages.test.ts Fix "use client" in pages dir errors (#46191) 2023-02-21 14:07:41 +00:00