Commit graph

13534 commits

Author SHA1 Message Date
Balázs Orbán
b0aa73b4cf chore: disable auto-labeling 2022-11-30 17:53:53 +01:00
Balázs Orbán
7bd170387f chore: don't comment twice 2022-11-30 15:59:39 +01:00
Thai Pangsakulyanont
860390167a
Clarify that publicRuntimeConfig and serverRuntimeConfig do not work with Output File Tracing (#43443)
The **Output File Tracing** page mentioned that `publicRuntimeConfig`
and `serverRuntimeConfig` are now legacy and does not work with Output
File Tracing (they are _inlined at build-time_ instead of being set at
runtime, the way it is supposed to work).

<img width="710" alt="image"
src="https://user-images.githubusercontent.com/193136/204200235-e7570c64-b760-48a8-bd72-46ed27e82363.png">

However, the Runtime Config page itself does not mention this at all.
This led me into a wrong path for a while.

## 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)

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
2022-11-30 09:41:07 -05:00
Aaron Yarborough
55e35c5144
chore(examples): reference main prop in README.md in Firebase example (#43434)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-11-30 12:47:39 +01:00
Balázs Orbán
81aebe953b chore: fix issue verifier 2022-11-30 12:43:18 +01:00
Max Proske
faaba0f8ec
Simplify and convert with-vercel-fetch example to TypeScript (#43403)
Simplified the example to just the specific feature, and converted to TypeScript.

- `node-fetch@2` is either polyfilled by Next.js or a peerDep of `@vercel/fetch`, I can't quite tell, but either way it can be removed from the dependencies.

## Documentation / Examples

- [X] Make sure the linting passes by running `pnpm build && pnpm lint`
- [X] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-30 11:41:14 +00:00
Balázs Orbán
396f9cc60a Merge branch 'canary' of https://github.com/vercel/next.js into canary 2022-11-30 12:15:39 +01:00
Balázs Orbán
5003de7b2d chore: fix issue verifier issues 2022-11-30 12:15:35 +01:00
Jiachi Liu
00836ad950
rsc: bundle legacy head as client component (#43425)
Related to the build failure from #41931 

We need to bundle `next/head` so that it can appear in the
flight-client-manifest, so we changed the behavior to not treat it as
non externals.

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
2022-11-29 17:09:43 -08:00
Shu Ding
b304a18362
Fix matchers in middleware manifest (#43549)
Currently the generated matcher will be `"regexp": "^\(group\)/group$"` for groups which doesn't match the correct route. This is somehow related to #43458, but it only fixes the problem partially. Some other changes need to be made in the build process.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] 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)
2022-11-29 23:55:13 +00:00
Balázs Orbán
ef20244851
chore: add area dropdown to bug report template (#43228)
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-29 19:34:15 +01:00
Balázs Orbán
cd02e5cf18 chore: hardcode path for issue validator 2022-11-29 19:15:06 +01:00
Balázs Orbán
fa26819340 chore: move comments of issue validator 2022-11-29 19:06:23 +01:00
Balázs Orbán
0d2f92a27e chore: fix issue validator 2022-11-29 19:04:08 +01:00
Matthew Heath
79f081994b
Add yarn berry dependency upgrade example for Next 12 to 13 upgrade documentation. (#43472)
This PR adds an example `yarn up` command to bump the relevant dependencies when using yarn berry for the Next 12 to Next 13 upgrade. One thing to possibly note is that `yarn up` is not scoped to a single workspace like `yarn upgrade` in classic - to get around this when in multiple workspaces, the `-i/--interactive` flag can be passed.

**Update** - can upgrade dependencies in both yarn classic/berry using `yarn add ...@latest`, this may be more straight forward than having two separate commands.

## Documentation / Examples

- [X] Make sure the linting passes by running `pnpm build && pnpm lint`
- [X] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-29 17:46:44 +00:00
Balázs Orbán
f0625662f4
chore: update issue verifier (#43339)
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-29 18:39:41 +01:00
Max
f15b5d0af7
chore(examples): fix CLI commands for MobX examples (#43534)
Fixes https://github.com/vercel/next.js/issues/43512
2022-11-29 18:10:33 +01:00
Alan Toa
524f99221d
docs: update known Safari bug (#43513)
# Why 
hey, teams!  
since Safari `v16` is supported [resolution media
query](https://developer.apple.com/documentation/safari-release-notes/safari-16-release-notes),
so this before docs the `@media not all and (min-resolution: 0.001dpcm)`
media query will not work on Safari latest version.


![image](https://user-images.githubusercontent.com/37520667/204539236-a6206146-3519-45ab-b05e-dfb5481551ec.png)

so I update the docs for `next/image` [Known Browser
Bugs](https://nextjs.org/docs/api-reference/next/image#known-browser-bugs),
hope this can help developers.

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`

Co-authored-by: Steven <steven@ceriously.com>
2022-11-29 11:21:49 -05:00
Shu Ding
e816e45677
Fix missing cleanup process in flight plugin globals (#43297)
This PR adds proper cleanup step for ~`edgeServerModuleIds`,
`serverModuleIds` and~ `flightCSSManifest`, which was previously
missing. Otherwise it will grow indefinitely during development.

## 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)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-29 17:03:38 +01:00
Hannes Bornö
fdff88bb62
Catch errors when calculating avg font width (#43503)
When calculating the avg width it's possible for `fontkit` to throw if it can't get the width of the glyphs for a font file. In that case skip the `size-adjust` property and use the other overrides.

https://github.com/vercel/next.js/discussions/41745#discussioncomment-4245120 here's an example of an error thrown by fontkit.

## 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)
2022-11-29 11:15:27 +00:00
Lee Robinson
9159a6e737
Add link back to font video in Font docs. (#43440)
This has been working well in the beta docs, testing on stable docs before we consider doing this with more pages in a more structured way.
2022-11-29 10:17:25 +00:00
JJ Kasper
ae626c5628
v13.0.6-canary.2 2022-11-28 22:09:41 -08:00
Wyatt Johnson
9e098da091
Upgrade compiled undici (#43481)
Updates the compiled undici to 5.13.0.
2022-11-28 22:16:27 +00:00
Hannes Bornö
cd8a1a4be5
Remove stack trace from full reload warning (#43453)
Adds a new error link with possible ways to fix the cause of the full reload. Removes the stack trace and adds the file causing the error to the message.

Before
![image](https://user-images.githubusercontent.com/25056922/204278894-dd773e6d-9d79-459a-abc4-243c1b22b206.png)

After:
![image](https://user-images.githubusercontent.com/25056922/204278538-5e26a174-bae4-457f-aac4-f239398227f8.png)

Fixes #43448

## 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)
2022-11-28 13:18:26 +00:00
Shu Ding
b418a88757
Make sure the TS plugin works for src/app (#43412)
Reported [here](https://twitter.com/iShiibi/status/1596515959397027843).

## 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)
2022-11-28 13:14:20 +01:00
Shu Ding
59466f8a15
Add gSP and gSSP checks for both server and client layers in the SWC transform (#43391)
We currently have these as a build runtime check. This PR ensures that
it happens during the SWC compilation time, and applies to both server
and client entries.

Also adds link to the docs:

<img width="768" alt="CleanShot 2022-11-25 at 18 14 54@2x"
src="https://user-images.githubusercontent.com/3676859/204031972-51447236-77f3-4c78-8e53-a7708aa3952a.png">

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] 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)
2022-11-27 16:15:56 -08:00
Max Proske
d5c922b3ec
Fix with-docker-compose example (#43419)
1. Fixes example unable to build with the latest version of Next.
- Next.js 13 bumped the minimum React version to [18.2.0](https://nextjs.org/docs/upgrading), but this example seems to have gotten missed.

2. Fixes example unable to run by default on Linux. 
- Reverts #39372 
- Fixes @balazsorban44 comment https://github.com/vercel/next.js/pull/39372#issuecomment-1208012860
- Added a comment to the README to prevent this issue from being re-introduced. 

3. Build and start Next.js based on the preferred package manager.

4. Allow dependencies to install without lockfile present. 
- Outputs a warning instead of exiting.  
- Keeps the example faithful to the README "Develop locally without Node.js or TypeScript installed".

5. Added `next.config.js` types that got missed.

6. Updated README links now that output standalone is stable.

## Documentation / Examples

- [X] Make sure the linting passes by running `pnpm build && pnpm lint`
- [X] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-28 00:13:22 +00:00
Rishabh Poddar
08e6ceb594
updates with-supertokens example (#43379)
Prevents infinite redirect loop if someone is logged in and visits a
route like `/auth/random`
2022-11-27 16:04:43 -08:00
Colin
013844c017
Fix "apply() is only allowed in ready status (state: idle)" HMR errors (#43242)
This is a follow-up to https://github.com/vercel/next.js/pull/43145 that
fixes [this
issue](https://github.com/vercel/next.js/pull/43145#issuecomment-1323782302):

```
warn  - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
Error: apply() is only allowed in ready status (state: idle)
    at https://app.airplane.so:5000/_next/static/chunks/webpack.js?ts=1669127927262:615:21
```

## Bug

- [X] Related issues linked using `fixes #number` - n/a
- [X] Integration tests added - n/a
- [X] Errors have a helpful link attached, see `contributing.md` - n/a
2022-11-26 23:40:05 -08:00
Hannes Bornö
2085dac926
Update @next/font/google fonts (#43385)
Add new fonts and font variations.

## 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)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-11-26 12:47:20 +01:00
Ngô Đức Anh
758990dc06
fix output: "standalone" returning 500 error on certain pages when built without pages/ (#43336)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## 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)

This reverts a part of the changes made in [PR
43268](https://github.com/vercel/next.js/pull/43268), which is checking
whether pagesDir exists in the root/src dir before copying the output in
.next/server to .next/standalone/.next/server as this causes certain
pages to cause the script to log `Error: Cannot find module
'.next/server/pages/_document.js'` and return a `Internal Server Error`
page since Next today still depends on pages/ dir for 404 and 500 pages
and as such needs that dir in .next/standalone/.next/server.
2022-11-25 16:44:51 -08:00
Hannes Bornö
93613d5509
dynamic = 'error' should only throw if page didn't get exported (#43377)
`export const dynamic = "error"` should only throw if the page actually
didn't get exported during `next build`. Test already exist to make sure
it throws:
`test/integration/app-dynamic-error/app/dynamic-error/page.js`

Fixes #43059

## 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)
2022-11-25 16:39:30 -08:00
Jiachi Liu
eaaa193751
Always transform styled-jsx for rsc and error with client-only condition (#43386)
Previously we stopped transform css-in-js libraries for RSC server layer because it's not encouraged to use them in server components but client components for saving the bytes of RSC payload.
We can detect styled-jsx usage on RSC server layer and error with `client-only` condition, but since it was not transformed properly so it's not erroring properly.

In the future, once styled-components and emotion have `client-only` depepdency integrated so we can re-enable the transform for them on server layer

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)
2022-11-26 00:36:18 +00:00
Jan Kaifer
c4b6bb8521
Add ref forwarding for next/image (#43193)
Add ref forwarding for next/image with integration test


- fixes https://github.com/vercel/next.js/discussions/42885
- fixes https://github.com/vercel/next.js/issues/18398 (this one was closed with `onLoadingComplete`)

## Feature

- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Documentation added


Co-authored-by: Steven <229881+styfle@users.noreply.github.com>
2022-11-25 15:08:50 +00:00
Hannes Bornö
0f195f0270
App directory next/link dynamic href dev error (#43074)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Fixes https://github.com/vercel/next.js/issues/42715
2022-11-25 15:03:00 +01:00
Tim Neutkens
c16d4be4c6 v13.0.6-canary.1 2022-11-25 13:31:08 +01:00
Tim Neutkens
d40ecb7f3f
Resolve RSC / HTML rendering errors in error overlay (#43332) 2022-11-25 13:06:42 +01:00
Jan Kaifer
1dd34620fd
Add example commands for creating reproductions (#43375)
To reduce friction when creating reproductions. It allso allows me to link to this file when I'm asking people to create reproductions



## 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

- [x] 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)
2022-11-25 12:01:39 +00:00
Jan Kaifer
9519431ec1
Add .pnpm-store to .gitignore (#43366)
pnpm creates this folder in the root of the project
when running this repo in a docker (because it needs to create this on the same device and the project is mounted into the container as a new device)

This is a follow-up on https://github.com/vercel/next.js/pull/43138

I added this into my personal `.git/info/exclude` and forgot to include this change with that PR.



## 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)
2022-11-25 10:24:56 +00:00
Hannes Bornö
e8fd18a505
Get correct chunks in flight-manifest on Windows (#43334)
On Windows `cunkGroup.name` is `app\layout` rather than `app/layout`. This causes it to get the wrong chunks in `flight-manifest.json` for `next/script` in this case:
```json
"chunks": ["webpack:webpack", "amp:amp"],
```
After checking for backslash:
```json
"chunks":["app\\layout:app\\layout"],
```

fixes #42519

## 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)
2022-11-25 08:36:26 +00:00
Shu Ding
e650047d4b
Fix package resolution issue in app dir (#43349)
The server and client compilers have different external dependency resolution logic. The server prefers CJS while the client prefers ESM by default. This causes an issue when that dependency is a client component entry. We get the module reference during RSC render, which is the CJS file path. And that module reference can't be located in the flight manifest as it was generated via the client compiler (has the ESM path).

This PR changes the entry creation logic to use resolved requests, instead of the raw requests. So both SSR and client will have the same resolved import paths to ensure the module reference consistency.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] 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)
2022-11-25 01:19:21 +00:00
changyoungoh
bcb0e28201
fix: apply default export interop to pages/_app (#43335)
Fixes https://github.com/vercel/next.js/issues/43330
2022-11-24 18:10:45 +01:00
Shu Uesugi
a746597430
chore(examples): Deprecate cms-strapi (#43325)
Co-authored-by: Balázs Orbán <info@balazsorban.com>
2022-11-24 12:01:10 +01:00
JJ Kasper
29a913467f
v13.0.6-canary.0 2022-11-23 19:16:49 -08:00
Ngô Đức Anh
f4610c31b0
Fix outputting un-necessary trace files for edge functions (#43304)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Bug

- [x] 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)

fixes #39275 and related issues like #39858 and hopefully #41395 (can't
test because `pnpm next-with-deps build ./dev-app` keeps crashing on
`Collecting page data...` - `useContext` seems to be null, and even
without the changes it still crashes).

This works by checking if the file is an edge function in Next.js's
Webpack plugin `TraceEntryPointsPlugin`, if true then output the nft
file to the output path, if not move up a folder like previously. I
tried changing Webpack config's output.path from `path: !dev &&
isNodeServer ? path.join(outputPath, 'chunks') : outputPath` to `path:
!dev && (isNodeServer || isEdgeServer) ? path.join(outputPath, 'chunks')
: outputPath`, but it just causes the build script to crash because
files like middleware-manifest.json are output to outputPath/chunks
instead of the expected outputPath. So I find this to be the better
solution.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-11-23 18:56:11 -08:00
Ngô Đức Anh
2eaa3ae146
fix appDir returning 404 in production with "output": "standalone" (#43268)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

Fixes: https://github.com/vercel/next.js/issues/42812
Fixes: https://github.com/vercel/next.js/issues/43037

## Bug

- [x] Related issues linked using `fixes #number`
- [x] 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)

This PR fixes the issue in which urls from appDir will always not be
found in production when built with `"output": "standalone"` by copying
.next/server/app and .next/server/app-paths-manifest.json into
.next/standalone/server.

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-11-23 18:45:19 -08:00
Shu Ding
60d5c9615c
Improve RSC plugin to provide better errors (#42435)
This PR improves the RSC plugin for SWC to throw an error when the `"use
client"` directive is in the top level, but not before other statements
/ expressions. For example:

Code:

```js
import 'react'

'use client'
```

Error:

```
The "use client" directive must be placed before other expressions. Move it to the top of the file to resolve this issue.

   ,----
 3 | 'use client'
   : ^^^^^^^^^^^^
   `----
```

## 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`
- [x] 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 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)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-11-23 17:26:38 -08:00
Hannes Bornö
5788f602a4
Improve @next/font error handling (#43298)
Use `WellKnownErrorsPlugin` when formatting `@next/font` errors.

The error handling is different for expected errors (like validation
errors) and unknown ones. If the error is expected it just displays the
formatted error message. If it's an unknown error it will also display
the stacktrace, and in case the versions of `@next/font` and `next` are
different it will encourage you to try to update them both.

Removes the usage of `error-loader` when importing from
`pages/_document.js`, handle that case with `WellKnownErrorsPlugin` as
well.

The current warning when using different versions is removed. If the
versions are incompatible you'll get an error in the overlay instead.

## 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)
2022-11-23 16:08:28 -08:00
JJ Kasper
ec7609e288
Avoid turbo cache miss on root package change (#43309)
Since the `next-swc` package doesn't rely on any of the root
dependencies this normalizes the `package.json` to avoid cache misses
when the file changes.

x-ref:
https://github.com/vercel/next.js/actions/runs/3535337836/jobs/5933336967
x-ref:
https://github.com/vercel/next.js/actions/runs/3535337836/jobs/5933338363
x-ref: [slack
thread](https://vercel.slack.com/archives/C02HEJASXGD/p1669236151437999)
2022-11-23 15:32:35 -08:00
JJ Kasper
538c11021b
Ensure loaderFile is included in webpack cache key (#43315)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## 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)
2022-11-23 15:31:31 -08:00