status
stringclasses 1
value | repo_name
stringclasses 13
values | repo_url
stringclasses 13
values | issue_id
int64 1
104k
| updated_files
stringlengths 11
1.76k
| title
stringlengths 4
369
| body
stringlengths 0
254k
⌀ | issue_url
stringlengths 38
55
| pull_url
stringlengths 38
53
| before_fix_sha
stringlengths 40
40
| after_fix_sha
stringlengths 40
40
| report_datetime
unknown | language
stringclasses 5
values | commit_datetime
unknown |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
closed | vercel/next.js | https://github.com/vercel/next.js | 48,004 | ["packages/next/src/client/components/layout-router.tsx", "packages/next/src/client/components/router-reducer/create-router-cache-key.ts", "test/e2e/app-dir/search-params-react-key/app/client-component.js", "test/e2e/app-dir/search-params-react-key/app/layout.tsx", "test/e2e/app-dir/search-params-react-key/app/page.tsx", "test/e2e/app-dir/search-params-react-key/layout-params.test.ts", "test/e2e/app-dir/search-params-react-key/next.config.js"] | Whole page component re-renders (unmounts) when route changes in 13.2.5-canary.32 - 13.3.0 | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 20.6.0: Tue Apr 19 21:04:45 PDT 2022; root:xnu-7195.141.29~1/RELEASE_X86_64
Binaries:
Node: 16.15.0
npm: 8.5.5
Yarn: 1.22.19
pnpm: 8.0.0
Relevant packages:
next: 13.2.5-canary.32
eslint-config-next: 13.2.5-canary.32
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
-
### To Reproduce
It's clear from video how dom behaves. Layout component is preserved but page component re-renders completlly not partially
### Describe the Bug
The whole page component is re-rendered (unmounted-mounted) when route, search params change. As a result all react state are lost and etc.
### Expected Behavior
Filter panel should stay opened when filters are applied. As it worsk in next.js 13.2.4
https://user-images.githubusercontent.com/2890580/230296737-7f05b8b0-807d-4ac9-82a1-ecb9c2100b56.mov
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/48004 | https://github.com/vercel/next.js/pull/49047 | 905cb5a56b06bf59f7d8a5957e249e03bb0d779b | 25ba8a74b7544dfb6b30d1b67c47b9cb5360cb4e | "2023-04-06T07:02:20Z" | javascript | "2023-05-01T18:57:45Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,970 | ["packages/next/src/build/index.ts", "packages/next/src/client/components/app-router.tsx", "packages/next/src/server/app-render/app-render.tsx", "test/e2e/app-dir/app-css/app/not-found.js", "test/e2e/app-dir/app-css/app/style.css", "test/e2e/app-dir/app-css/index.test.ts"] | Tailwind CSS styles are broken on not-found page | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: linux
Arch: x64
Version: Ubuntu 20.04.0 LTS Wed Apr 05 2023 17:42:03 GMT+0200 (Central European Summer Time)
Binaries:
Node: 16.14.2
npm: 7.17.0
Yarn: 1.22.19
pnpm: 7.13.6
Relevant packages:
next: 13.2.5-canary.30
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-brvnkq?file=tailwind.config.js,app%2Fglobal.css,app%2Fpage.tsx,app%2Flayout.tsx,app%2Fnot-found.tsx
### To Reproduce
- open the reproduction example
- click the link or - visit a page that triggers the not-found component
- verify the code and see that Tailwind CSS is broken
Home Page

Not Found Page

### Describe the Bug
since [13.2.5-canary.22](https://www.npmjs.com/package/next/v/13.2.5-canary.22) Tailwind CSS stop working in not-found page. It is hard to really say what the reason is, and I haven't found any workaround until now.
[example repo for canary-21 that is working as expected](https://stackblitz.com/edit/vercel-next-js-rppczb?file=tailwind.config.js,app%2Fglobal.css,app%2Fpage.tsx,app%2Flayout.tsx,package.json)
### Expected Behavior
Tailwind CSS should work on the not-found page
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
| https://github.com/vercel/next.js/issues/47970 | https://github.com/vercel/next.js/pull/47992 | 9b0af0464946ba9c11d97e5c4fa87aa64d0fe1ed | e4e5c1674aa2ce203042b512d31cabbc5e69b576 | "2023-04-05T15:47:17Z" | javascript | "2023-04-06T11:37:55Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,858 | ["packages/next/src/lib/typescript/writeConfigurationDefaults.ts", "test/integration/tsconfig-verifier/test/index.test.js"] | [NEXT-1281] Support `moduleResolution` `bundler` in `tsconfig.json` | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101
Binaries:
Node: 18.4.0
npm: 8.12.1
Yarn: 1.22.19
pnpm: 7.2.1
Relevant packages:
next: 13.2.5-canary.28
eslint-config-next: 13.2.4
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
TypeScript
### Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/relaxed-tess-ylwq9s?file=%2Ftsconfig.json&selection=%5B%7B%22endColumn%22%3A55%2C%22endLineNumber%22%3A18%2C%22startColumn%22%3A55%2C%22startLineNumber%22%3A18%7D%5D
### To Reproduce
Set `compilerOptions.moduleResolution` to `bundler` in `tsconfig.json`
### Describe the Bug
When setting the `moduleResolution` to `bundler` in `tsconfig.json` it will be reset to `node` when running `next build`.
### Expected Behavior
It should allow `bundler` as it has been added in `typescript@5`
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-1281](https://linear.app/vercel/issue/NEXT-1281/support-moduleresolution-bundler-in-tsconfigjson)</sub> | https://github.com/vercel/next.js/issues/47858 | https://github.com/vercel/next.js/pull/51065 | 90ee9589d617e557b494bdbadc5dfdabcc951298 | 1a0b5d25c60f98d87b7703c7d03eba260a9dcbf0 | "2023-04-03T14:16:27Z" | javascript | "2023-06-09T21:48:13Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,805 | ["packages/next/src/server/async-storage/static-generation-async-storage-wrapper.ts", "test/production/standalone-mode/required-server-files/required-server-files-app.test.ts"] | Error: invariant: Expected pageData to be a string for app data request but received undefined. This is a bug in Next.js. | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 16.19.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.4
eslint-config-next: 13.0.0
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Data fetching (gS(S)P, getInitialProps), Middleware / Edge (API routes, runtime)
### Link to the code that reproduces this issue
I cannot reproduce it locally.
### To Reproduce
I don't know exactly how to reproduce it locally, it seems to happen only when deployed on Vercel.
### Describe the Bug
When executing a serverless function, I am getting the error `Error: invariant: Expected pageData to be a string for app data request but received undefined. This is a bug in Next.js.` approximately 50% of the times. This error seems to happen only when deployed on vercel. I see the error just by checking the logs.
It seems a bug in the cachedData, since this code is what is giving this error: https://github.com/vercel/next.js/pull/46204/files
Here is the Serverless execution success and fail chart by day, almost 50% fails due to this error.

Here is a full error example found in the "Logs":
```
2023-04-01T22:34:02.255Z undefined INFO info - Loaded env from /var/task/.env.production
Error: invariant: Expected pageData to be a string for app data request but received undefined. This is a bug in Next.js.
at NextNodeServer.renderToResponseWithComponentsImpl (/var/task/node_modules/next/dist/server/base-server.js:1013:27)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async NextNodeServer.renderPageComponent (/var/task/node_modules/next/dist/server/base-server.js:1072:24)
at async NextNodeServer.renderToResponseImpl (/var/task/node_modules/next/dist/server/base-server.js:1098:32) {
page: '/front-end-jobs-in-antwerp'
}
RequestId: 3193f9ce-3d2b-493d-b5f4-6d8c4c407b22 Error: Runtime exited with error: exit status 1
Runtime.ExitError
```
### Expected Behavior
I expect the cache to work as expected and to have no errors in the serveless function executions. My external backend service , where the serverless function gets the data, does not fail, so the expected behaviour is that the serveless function gets the data and cache it as expected.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-1391](https://linear.app/vercel/issue/NEXT-1391/error-invariant-expected-pagedata-to-be-a-string-for-app-data-request)</sub> | https://github.com/vercel/next.js/issues/47805 | https://github.com/vercel/next.js/pull/52581 | b9760b2910c720ee0b4700917cd02575f6bbd7d6 | 0600293b034b7bfedbaef3bc6044979bc3119bab | "2023-04-01T22:38:46Z" | javascript | "2023-07-12T06:39:50Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,704 | ["packages/next/src/build/webpack/loaders/next-flight-loader/index.ts"] | [NEXT-940] Unexpected token u in JSON because of "use client" | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: win64
Arch: x64
Version: Windows 11 Home
Binaries:
Node: 18.15.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.5-canary.21
eslint-config-next: 13.2.4
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
Static HTML Export (next export)
### Link to the code that reproduces this issue
https://github.com/thewbuk/nextjs13_error
### To Reproduce
`npm run build`
### Describe the Bug
When trying to build project, `SyntaxError: Unexpected token u in JSON at position 0` is thrown for every page that uses `"use client"` even though the latest release of the canary is supposed to fix this issue.
Using `App` directory
### Expected Behavior
Create static export
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-940](https://linear.app/vercel/issue/NEXT-940/unexpected-token-u-in-json-because-of-use-client)</sub> | https://github.com/vercel/next.js/issues/47704 | https://github.com/vercel/next.js/pull/48152 | 772f3e750975e4cd1d93e77d5f3d7a06957048e5 | 9c9fdabbd4f31dde5eef830bcb7bdf8bdd377449 | "2023-03-30T17:15:40Z" | javascript | "2023-04-10T17:01:20Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,661 | ["packages/next/src/client/get-domain-locale.ts", "test/integration/i18n-support/test/index.test.js"] | rendered Next link href differs in prerender from ISR | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 21.6.0: Sat Jun 18 17:07:25 PDT 2022; root:xnu-8020.140.41~1/RELEASE_X86_64
Binaries:
Node: 16.16.0
npm: 8.19.2
Yarn: 1.22.17
pnpm: N/A
Relevant packages:
next: 13.2.5-canary.20
eslint-config-next: 13.1.5
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
https://github.com/gijsbotje/reproduction-link-inconsistency
### To Reproduce
open your network tab in inspector and make sure `disable cache` is off.
open https://reproduction-link-inconsistency.vercel.app/
The link on the page has an href value of `https://www.link-demo.com/revalidate`
open https://reproduction-link-inconsistency.vercel.app/dynamic/alpha/
The links on the page have an href value of `https://www.link-demo.com/` and `https://www.link-demo.com/revalidate`
open https://reproduction-link-inconsistency.vercel.app/dynamic/kilo/
The links in the now have relative hrefs: `/` and `/revalidate/`
### Describe the Bug
Prerendered pages get resolved hrefs based on the locale domain and do not use the trailingSlash setting in the `next.config.js` file.
revalidated pages or newly generated dynamic pages get relative hrefs in next links.
### Expected Behavior
I would expect the href values to be the same in both situations and use the settings in next.config.js. Preferably, it should be relative.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
Vercel | https://github.com/vercel/next.js/issues/47661 | https://github.com/vercel/next.js/pull/52343 | 1045644655c8d29cdad9bd5ee0a3c73d6d7ad097 | f0fc83b40c7bf8d01e0d6c43943659bd210b2617 | "2023-03-29T14:27:34Z" | javascript | "2023-07-06T20:56:30Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,646 | ["packages/next/src/build/webpack/plugins/next-types-plugin.ts"] | Latest canary release adds unused import to compiled types | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000
Binaries:
Node: 16.14.0
npm: 8.3.1
Yarn: 1.22.17
pnpm: 7.29.1
Relevant packages:
next: 13.2.5-canary.20
eslint-config-next: 13.2.4
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), TypeScript
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-go5rfn?file=README.md
### To Reproduce
1. Create a [new StackBlitz](https://stackblitz.com/edit/vercel-next-js-go5rfn?file=README.md) with the new app repo
2. Build the example without changing anything (new terminal & `npm run build`)
3. Read out `cat .next/types/app/page.ts`
4. There's `NextRequest` imported there, unused in the file.
### Describe the Bug
Our TS configuration errors out on unused types/variables/... and since it's the default to also type-check the `.next/types` folder, this errors out during build.
This first appeared in `13.2.5-canary.19`, `13.2.5-canary.18` works fine.
### Expected Behavior
The `types` folder in the `.next` folder to not contain unused types.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/47646 | https://github.com/vercel/next.js/pull/47667 | e9085efe47a51005eb9c798fd1c6152e68a233a5 | ca56e4fb26d680072dcd6ead9f0e62b86059e44e | "2023-03-29T09:04:26Z" | javascript | "2023-03-30T00:21:52Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,585 | ["packages/next/src/client/components/layout-router.tsx", "packages/next/src/server/app-render/app-render.tsx", "test/e2e/app-dir/app-css/app/ordering/index.css", "test/e2e/app-dir/app-css/app/ordering/input.css", "test/e2e/app-dir/app-css/app/ordering/input.js", "test/e2e/app-dir/app-css/app/ordering/layout.js", "test/e2e/app-dir/app-css/app/ordering/page.js", "test/e2e/app-dir/app-css/index.test.ts"] | [NEXT-983] `app` router CSS handling seems incompatible with CSS Cascade Layers - no way to guarantee that CSS that defines layers can be loaded before any usage of the CSS layers | (I'm not 100% sure if this is a Next issue or a RSC/React core issue)
### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
See https://codesandbox.io/p/sandbox/next-js-css-cascade-layers-hkqesn
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/next-js-css-cascade-layers-hkqesn
### To Reproduce
1. Open the Codesandbox https://codesandbox.io/p/sandbox/next-js-css-cascade-layers-hkqesn
2. Note that the disabled buttons are not all grey, the 'theme' colour is being applied instead of the 'state' colour
3. Use devtools to re-order the CSS files in the `<head>` and note that the button background colours change. Now the 'state' styling has taken over the background colour – this is what we want!


### Describe the Bug
[CSS Cascade Layers](https://css-tricks.com/css-cascade-layers/) are an exciting feature in CSS with [strong browser support](https://caniuse.com/css-cascade-layers). An example use case would be to make sure that utility classes could always override component styles, or that local styles could override imported shared company-wide styles to allow modifications on a per-app basis.
The [order that the browser discovers layers is very important](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Cascade_layers#determining_the_precedence_based_on_the_order_of_layers). Users of CSS cascade layers and Next.js need a way to define their layers before any other CSS is encountered by the browser, or else the order of the layers that the browser picks may not be what the developer wanted.
This seems difficult at the moment as layout CSS appears in the DOM after per-page or per-component styles:

## Workarounds
To make sure it comes first I’ve had to add a new CSS file containing the layer definitions (e.g. `@layer default, theme, state;`) to my public directory, and import it with a `precedence` prop that isn’t in the types :( This is a shame as it's a non-standard way of doing things and the file now isn't processed in the same way as my other CSS files:

I am also considering undoing the above, but using https://github.com/ramonvictor/postcss-prepend-imports to import a CSS file that defines the layers into every CSS file, so it doesn't matter which one the browser encounters first. I'd rather not do this because of the unnecessary bytes.
### Expected Behavior
I'd love any of these:
* a way to control the 'weight' of a CSS import so that I could give my CSS layer defining import a weight of -100 and have it always come first
* an officially supported way to include a `<link>` element with a `precedence` prop value that will make it appear in the DOM order before any other `link type="stylesheet"` elements
* an officially supported way to include some inline CSS (`<style>@layer default, theme, state;</style>` ) that will appear in the DOM order before any `link type="stylesheet"` elements
### Which browser are you using? (if relevant)
N/A
### How are you deploying your application? (if relevant)
N/A
<sub>[NEXT-983](https://linear.app/vercel/issue/NEXT-983/app-router-css-handling-seems-incompatible-with-css-cascade-layers-no)</sub> | https://github.com/vercel/next.js/issues/47585 | https://github.com/vercel/next.js/pull/48244 | 3ac76585152c1cd50b29eafaa2cd1acebc576946 | 2a61253f72e629816b989acadf088e0e2ff5bd9c | "2023-03-27T23:10:06Z" | javascript | "2023-04-17T12:11:47Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,561 | ["packages/next/src/server/lib/render-server-standalone.ts", "packages/next/src/server/lib/render-server.ts", "packages/next/src/server/lib/server-ipc/index.ts", "packages/next/src/server/lib/start-server.ts", "packages/next/src/server/lib/worker-utils.ts", "packages/next/src/server/next-server.ts"] | "NODE_OPTIONS='--inspect' next dev" won't work correctly, debugging server-side not possiable | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Thu Jan 5 20:49:43 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T8103
Binaries:
Node: 17.9.1
npm: 8.11.0
Yarn: 1.22.10
pnpm: N/A
Relevant packages:
next: 13.2.5-canary.19
eslint-config-next: 13.2.4
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
Middleware / Edge (API routes, runtime)
### Link to the code that reproduces this issue
https://github.com/Dkogan90/next-bug
### To Reproduce
Starting next: `yarn run dev`
try to debugging `pages/api/hello.ts` with chrome node inspector
### Describe the Bug
Inspector is already running.
Unable to debug server-side code.
```
$ NODE_OPTIONS='--inspect' next dev
Debugger listening on ws://127.0.0.1:9229/9a701303-c48a-4785-9ee0-8bea5a0e4cff
For help, see: https://nodejs.org/en/docs/inspector
warn - the --inspect option was detected, the Next.js server should be inspected at port 9230.
Debugger listening on ws://127.0.0.1:9230/33c493f4-afba-4ac8-b7af-7c18e6e56b11
For help, see: https://nodejs.org/en/docs/inspector
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
Starting inspector on 127.0.0.1:9229 failed: address already in use
```
### Expected Behavior
Able to debug server side code with the node.js inspector via chrome
### Which browser are you using? (if relevant)
Chrome
### How are you deploying your application? (if relevant)
not relevant | https://github.com/vercel/next.js/issues/47561 | https://github.com/vercel/next.js/pull/48019 | ff070e530b239e89ed05ff8bfc0990a351e4c0a1 | 90331f38ccf49e0632e84688aae05beac9ac64a6 | "2023-03-27T11:49:04Z" | javascript | "2023-05-23T18:03:08Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,475 | ["packages/next/src/client/components/layout-router.tsx", "test/e2e/app-dir/parallel-routes-and-interception/app/parallel-scroll/@modal/nav/page.js", "test/e2e/app-dir/router-autoscroll/app/fixed-first-element/page.tsx", "test/e2e/app-dir/router-autoscroll/app/page.tsx", "test/e2e/app-dir/router-autoscroll/app/sticky-first-element/page.tsx", "test/e2e/app-dir/router-autoscroll/router-autoscroll.test.ts"] | Next-link scrolling layout.tsx "children" into view no matter what | ### Verify canary release
- [x] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64
Binaries:
Node: 19.7.0
npm: 9.5.0
Yarn: 1.22.10
pnpm: N/A
Relevant packages:
next: 13.2.5-canary.15
eslint-config-next: 13.2.4
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Routing (next/router, next/navigation, next/link)
### Link to the code that reproduces this issue
https://github.com/this-Cunningham/Next-link-scroll-bug-repro
### To Reproduce
- Anytime using next-link to navigate to a page within a `layout.tsx`... if the layout's rendered `{ children }` HTML container is below the viewport, the children are scrolled into view, all the way up to scroll position zero if there is enough content to scroll that far...
- if even a tiny, tiny sliver of the layout's rendered `{children}` container are above the viewport on initial navigation (even by 1px), there is no scrolling (desired behavior)....
in the provided repro repo -- you can play around with the viewport height and if you shrink the viewport height enough and start using the buttons to navigate you will notice this scrolling behavior
if you increase the viewport height enough so the content at the bottom is above the fold/in the initial view upon navigating... there is zero scrolling
### Describe the Bug
When using next-link to navigate to a page where a layout.tsx's `{children}` container is below the viewport/below the fold, the application scrolls until the "children" html container is at scroll position zero if possible, otherwise it is scrolled as high up as possible
### Expected Behavior
Expected behavior is for there to be zero scrolling when initially navigating to any page unless there is a `#` in the url.
### Which browser are you using? (if relevant)
Chrome - Version 111.0.5563.64 (Official Build) (x86_64) ... Safari - Version 16.3 (18614.4.6.1.6) and latest firefox
### How are you deploying your application? (if relevant)
Vercel
<sub>[NEXT-1393](https://linear.app/vercel/issue/NEXT-1393/next-link-scrolling-layouttsx-children-into-view-no-matter-what)</sub> | https://github.com/vercel/next.js/issues/47475 | https://github.com/vercel/next.js/pull/53873 | ec6d2c7825f2d8742ea1bb5743e819cb48913e9c | cb432eb42d31313aacf9301a4bdf1a80173df329 | "2023-03-24T04:15:27Z" | javascript | "2023-08-15T13:31:39Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,393 | ["examples/with-stripe-typescript/components/ClearCart.tsx"] | Stripe checkout return generates an error - destroy is not a function | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64
Binaries:
Node: 16.13.1
npm: 9.5.1
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.5-canary.12
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
```
### Which example does this report relate to?
with-stripe-typescript
### What browser are you using? (if relevant)
FireFox 111.0
### How are you deploying your application? (if relevant)
Running on local MacBook
### Describe the Bug
On completing the stripe test payment using the checkout form, the page returns the error .
Unhandled Runtime Error
TypeError: destroy is not a function
The browser log has:
`Uncaught TypeError: destroy is not a function
React 15
workLoop scheduler.development.js:266
flushWork scheduler.development.js:239
performWorkUntilDeadline scheduler.development.js:533
EventHandlerNonNull* scheduler.development.js:571
<anonymous> scheduler.development.js:633
NextJS 4
<anonymous> index.js:6
NextJS 4
React 2
NextJS 4
<anonymous> React
NextJS 4
<anonymous> React
NextJS 4
<anonymous> index.js:14
NextJS 4
<anonymous> next-dev.js:3
NextJS 7
[react-dom.development.js:22932](webpack://_N_E/node_modules/react-dom/cjs/react-dom.development.js?ac89)
The above error occurred in the <ClearCart> component:`
### Expected Behavior
I would expect the page to confirm payments and clear any cart
### To Reproduce
Download the example and setup as per the ReadMe document and then run with `npm run dev`.
Select the checkout example with the default payment of $1000 and complete the card information.
On press the pay button, the error is returned | https://github.com/vercel/next.js/issues/47393 | https://github.com/vercel/next.js/pull/47469 | a03db7545dc9a728efb0614c998943274bbcdabc | cb541006dceea3f3902bfc7017b17cd8faa93c3f | "2023-03-22T12:48:11Z" | javascript | "2023-03-24T15:02:39Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,334 | ["docs/api-reference/cli.md", "packages/next/src/server/next.ts", "test/integration/app-dir-export/test/index.test.ts", "test/integration/app-dir-export/test/start.test.ts"] | [NEXT-861] Link to "/" redirects to "/index.txt" when using `output: "export"` | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64
Binaries:
Node: 18.3.0
npm: 8.11.0
Yarn: 1.22.18
pnpm: N/A
Relevant packages:
next: 13.2.5-canary.10
eslint-config-next: 13.2.4
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://github.com/dqn/next-issue-reproduction-20230321
### To Reproduce
1. Run `yarn build`
2. Run `yarn start`
3. Open http://localhost:3000
4. Click link
5. Redirects /index.txt
### Describe the Bug
When using `output: "export"` on next.config.js, link to "/" redirects to "/index.txt".
Demo: https://next-issue-reproduction-20230321.vercel.app/
### Expected Behavior
Navigate to "/".
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-861](https://linear.app/vercel/issue/NEXT-861/link-to-redirects-to-indextxt-when-using-output-export)</sub> | https://github.com/vercel/next.js/issues/47334 | https://github.com/vercel/next.js/pull/47989 | 1e81af047d7bbd6324a4630e33d6200f2d086e4a | 690208b11fd5506d5d7eb842c0bec60bfddadce4 | "2023-03-21T03:03:50Z" | javascript | "2023-04-07T00:28:27Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,299 | ["packages/next/package.json", "packages/next/src/build/swc/jest-transformer.ts", "packages/next/src/compiled/jest-docblock/LICENSE", "packages/next/src/compiled/jest-docblock/index.js", "packages/next/src/compiled/jest-docblock/package.json", "packages/next/src/compiled/sass-loader/cjs.js", "packages/next/taskfile.js", "packages/next/types/misc.d.ts", "pnpm-lock.yaml", "test/production/jest/server-only.test.ts"] | [NEXT-863] Unable to test page components using metadata API with Jest | ### Verify canary release
* [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000
Binaries:
Node: 18.12.1
npm: 8.19.2
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 13.2.5-canary.8
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Jest (next/jest)
### Link to the code that reproduces this issue
[https://github.com/andremendonca/metadata-jest-error](https://github.com/andremendonca/metadata-jest-error)
### To Reproduce
git clone [https://github.com/andremendonca/metadata-jest-error.git](https://github.com/andremendonca/metadata-jest-error.git)
npm i
npm test
### Describe the Bug
in NextJs 13+ using the experimental App folder, I cannot test any server component that exports `metadata` or `generateMetadata` from [https://beta.nextjs.org/docs/api-reference/metadata](https://beta.nextjs.org/docs/api-reference/metadata)
Resulting in the following error:
```
× NEXT_RSC_ERR_CLIENT_METADATA_EXPORT: metadata
╭─[/metadata-jest-bug/app/page.tsx:1:1]
1 │ export const metadata = {
· ────────
2 │ title: 'My jest sample'
3 │ }
╰────
```
### Expected Behavior
I expected to be able to test Server Components present on app directory
### Which browser are you using? (if relevant)
*No response*
### How are you deploying your application? (if relevant)
*No response*
<sub>From [SyncLinear.com](https://synclinear.com) | [NEXT-863](https://linear.app/vercel/issue/NEXT-863/unable-to-test-page-components-using-metadata-api-with-jest)</sub> | https://github.com/vercel/next.js/issues/47299 | https://github.com/vercel/next.js/pull/53578 | 61e1858241edc8d46cea7a9c61a0bb33a119e2c0 | 77acd164d33b52bb4a46184f2d0c3d1dcb76f164 | "2023-03-19T19:29:50Z" | javascript | "2023-08-16T07:14:27Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,239 | ["docs/advanced-features/compiler.md", "packages/next-swc/Cargo.lock", "packages/next-swc/crates/core/Cargo.toml", "packages/next-swc/crates/core/src/lib.rs", "packages/next-swc/crates/core/src/relay.rs", "packages/next-swc/crates/core/tests/fixture.rs", "packages/next/src/server/config-shared.ts"] | [NEXT-883] Using compiler relay on graphql returns module (typescript) | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: linux
Arch: x64
Version: #22 SMP Tue Jan 10 18:39:00 UTC 2023
Binaries:
Node: 16.17.0
npm: 8.15.0
Yarn: 1.22.19
pnpm: 7.1.0
Relevant packages:
next: 13.2.5-canary.7
eslint-config-next: 12.1.5
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/misty-surf-1vh56k?file=%2Fpages%2Findex.tsx&selection=%5B%7B%22endColumn%22%3A30%2C%22endLineNumber%22%3A11%2C%22startColumn%22%3A1%2C%22startLineNumber%22%3A3%7D%5D
### To Reproduce
https://codesandbox.io/p/sandbox/misty-surf-1vh56k?file=%2Fpages%2Findex.tsx&selection=%5B%7B%22endColumn%22%3A16%2C%22endLineNumber%22%3A58%2C%22startColumn%22%3A16%2C%22startLineNumber%22%3A58%7D%5D
### Describe the Bug
Old issue was closed but the problem still exist: https://github.com/vercel/next.js/issues/36366#issuecomment-1472917683
Updated the codesandbox with latest versions and canary.
Problem described in short:
```ts
const pagesIndexQuery = graphql`
query pagesIndexQuery @preloadable {
TweetsMeta {
count
}
}
`;
console.log(pagesIndexQuery);
```
Should not output `Object [Module] { default: [Getter] }`.
### Expected Behavior
Should output:
```ts
{
fragment: {
argumentDefinitions: [],
kind: 'Fragment',
metadata: null,
name: 'pagesIndexQuery',
selections: [ [Object] ],
type: 'Query',
abstractKey: null
},
kind: 'Request',
operation: {
argumentDefinitions: [],
kind: 'Operation',
name: 'pagesIndexQuery',
selections: [ [Object] ]
},
params: {
cacheID: 'b78830457717f1f17ab62ff54204c588',
id: null,
metadata: {},
name: 'pagesIndexQuery',
operationKind: 'query',
text: 'query pagesIndexQuery {\n TweetsMeta {\n count\n }\n}\n'
},
hash: '9f6c9650cdd8f7d476d27d232b8308fe'
}
```
Might be a problem with SWC but I'm not sure. According to this it should be solved but the problem remains.
https://github.com/swc-project/plugins/issues/107#event-8738527380
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-883](https://linear.app/vercel/issue/NEXT-883/using-compiler-relay-on-graphql-returns-module-typescript)</sub> | https://github.com/vercel/next.js/issues/47239 | https://github.com/vercel/next.js/pull/47441 | 53bcdea01c963ecfb0746bd70ab73ba114aa32e8 | 688d8253da8586d3b6251aff42535245834c4456 | "2023-03-17T13:05:51Z" | javascript | "2023-03-27T07:34:09Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,224 | ["packages/next/src/build/webpack/loaders/metadata/resolve-route-data.test.ts", "packages/next/src/build/webpack/loaders/metadata/resolve-route-data.ts", "packages/next/src/lib/metadata/generate/utils.ts"] | [NEXT-905] Nextjs new dynamic robots routes generates the wrong output for Disallow and allow properties | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.4.0: Tue Feb 28 22:25:54 PST 2023; root:xnu-8796.100.772.505.2~2/RELEASE_ARM64_T8103
Binaries:
Node: 18.15.0
npm: 9.5.0
Yarn: 1.22.18
pnpm: 7.1.0
Relevant packages:
next: 13.2.5-canary.5
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
Metadata (metadata, generateMetadata, next/head, head.js)
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-femdq3?file=app%2Frobots.ts
### To Reproduce
1. Run the dev server
2. Go to `/robots.txt`
### Describe the Bug
When using the new `robots.ts` top level route for `robots.txt`, if you pass `disallow` or `allow` an array of strings it outputs a concatenated string with all the paths :
```ts
// app/robots.ts
export default function robots() {
return {
userAgent: '*',
disallow: ['/path-1', '/path-2'],
allow: [ '/path-3', '/path-4'],
}
}
```
```
User-Agent: *
Disallow: /path-1,/path-2
Allow: /path-3,/path-4
```
This is flat out incorrect as disallow should be in multiple instructions like this :
```
User-Agent: *
Disallow: /path-1
Disallow: /path-2
Allow: /path-3
Allow: /path-3
```
### Expected Behavior
It should give the correct output when passing using an array of string for `disallow` and `allow`
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-905](https://linear.app/vercel/issue/NEXT-905/nextjs-new-dynamic-robots-routes-generates-the-wrong-output-for)</sub> | https://github.com/vercel/next.js/issues/47224 | https://github.com/vercel/next.js/pull/47625 | 54fce53dd98d48216e5a8fff0c98a53cf3ae49dd | f6e6c2f01a28c5ea3e544bb4abf106a839a1faf4 | "2023-03-16T23:50:45Z" | javascript | "2023-03-28T21:22:37Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,189 | ["package.json", "pnpm-lock.yaml", "test/integration/edge-runtime-with-node.js-apis/lib/utils.js"] | [NEXT-833] Inconsistent behavior of @edge-runtime randomUID and native randomUID | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 19.8.1
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.5-canary.4
eslint-config-next: 13.2.4
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
Middleware / Edge (API routes, runtime)
### Link to the code that reproduces this issue
-
### To Reproduce
crypto.randomUUID() in middleware
### Describe the Bug
The crypto.randomUUID generation should contain 4 hyphens, like, 2ec3dd93-b1e2-42ff-87b3-fe41e52bce76.
But the randomUUID function in @edge-runtime only contains 3 hyphends, like 87f3fbce-ca3d-45a0-85fde91d7ffb954d
It's format is difference with native crypto.randomUUID.
https://github.com/vercel/next.js/blob/a3dff7c8da9a49e89f63f67785a75eb7cff90169/packages/next/src/compiled/%40edge-runtime/primitives/crypto.js#L6491,
### Expected Behavior
The randomUUID function in @edge-runtime should have same ouput format with native crypto.randomUUID
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-833](https://linear.app/vercel/issue/NEXT-833/inconsistent-behavior-of-edge-runtime-randomuid-and-native-randomuid)</sub> | https://github.com/vercel/next.js/issues/47189 | https://github.com/vercel/next.js/pull/46818 | 3efbb1a14f79c72ddc10d983b683cf83384df353 | 678c69753b4f1127b1ecf33819fc6064898df758 | "2023-03-16T02:31:16Z" | javascript | "2023-04-27T17:04:14Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,173 | ["packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts", "packages/next/src/client/app-index.tsx"] | [NEXT-847] ChunkLoadError only on deployement if using `next/dynamic` since Next `13.2.4` | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:39:35 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T8103
Binaries:
Node: 18.12.1
npm: 8.19.2
Yarn: 1.22.19
pnpm: 7.29.0
Relevant packages:
next: 13.2.5-canary.4
eslint-config-next: 13.2.4
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Dynamic imports (next/dynamic)
### To Reproduce
I'm working on trying to reproduce this bug with the reproduction-template, but haven't been able till now.
Maybe creating a exemple with multiple chunks will make it work?
### Describe the Bug
Since upgrading next from `13.2.3` to `13.2.4`, I have a chunkLoadError on my `/app` pages, which cause hydratation error.
This only occurs on Vercel deployment or after running `next build && next start`.
No errors/warning if using `next dev` or during the build.
Here is a screenshot of the errors:
<img width="990" alt="Capture d’écran 2023-03-15 à 19 03 01" src="https://user-images.githubusercontent.com/33151156/225402106-821ca75a-3413-4e6e-8fe7-0b73bf48df04.png">
After investigation, the issue seam to appear if using dynamic imports via next/dynamic(or React.lazy).
Dynamic import seem to break hydration when importing component with sub-components also used outside the import.
No issue with a simple 'Hello world' dynamic import, or if bypassing next/dynamic on these more complexe components.
Also, in the exemple showed via the screenshot, the file `3845-003ea1aae1221d6c.js` doesn't exist in the `/.next` folder. But `.next/static/chunks/3845.a2edb05c0b138330.js` does.
Apparently the same error occurred for jinojacob15 ([Comment-#46989](https://github.com/vercel/next.js/issues/46989#issuecomment-1463780608)) and SuttonJack ([Comment-#46989](https://github.com/vercel/next.js/issues/46989#issuecomment-1465077047)), which seems unrelated to the initial issue.
### Expected Behavior
No error on deployement, or at least printing an error on `next dev` or `next build`
<sub>[NEXT-847](https://linear.app/vercel/issue/NEXT-847/chunkloaderror-only-on-deployement-if-using-nextdynamic-since-next)</sub> | https://github.com/vercel/next.js/issues/47173 | https://github.com/vercel/next.js/pull/48583 | 9b3bd73bb570066489048f7e90a8345eafceb8d5 | 1827f36e5eb4ba9fe1c3b0bf02e889f192ff4808 | "2023-03-15T18:51:56Z" | javascript | "2023-04-19T18:11:47Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,151 | ["packages/next/src/build/webpack/plugins/next-types-plugin.ts"] | with appDir & typedRoutes enabled: next includes ANY directory starting with "app" in its name | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: linux
Arch: x64
Version: Ubuntu 20.04.0 LTS Wed Mar 15 2023 13:00:14 GMT+0100
Binaries:
Node: 16.14.2
npm: 7.17.0
Yarn: 1.22.19
pnpm: 7.13.6
Relevant packages:
next: 13.2.5-canary.4
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Routing (next/router, next/navigation, next/link), TypeScript
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-y5j7qv
### To Reproduce
1. open the stackblitz URL and go to app/page.tsx (https://stackblitz.com/edit/vercel-next-js-y5j7qv)
2. type in different urls in the `Link` components and check the completion provided
### Describe the Bug
next will include all ts file pathes from any other project directory that starts with `app`, in the given stackblitz example its the folder `appx`.
### Expected Behavior
next should not include the appx folder into the typed routes
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/47151 | https://github.com/vercel/next.js/pull/47184 | 9a89c4933dd35940b007e0a872ba3c529854a76b | a3dff7c8da9a49e89f63f67785a75eb7cff90169 | "2023-03-15T12:06:30Z" | javascript | "2023-03-16T00:58:33Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,113 | ["packages/next/src/server/base-server.ts", "packages/next/src/server/lib/trace/tracer.ts", "packages/next/src/server/next-server.ts", "packages/next/src/server/router.ts", "test/e2e/opentelemetry/opentelemetry.test.ts"] | [NEXT-820] OTEL: add `http.route` to `SERVER` spans | [Is there any way we could set ](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-server-semantic-conventions)`http.route` here?
Without this it's impossible to do aggregate analysis on paramaterized routes, since they would all have different URLs, which is something APM providers (like Sentry for example) would need!
*Originally posted by @AbhiPrasad in* [*https://github.com/vercel/next.js/pull/47066#discussion_r1135323331*](https://github.com/vercel/next.js/pull/47066#discussion_r1135323331)
<sub>From [SyncLinear.com](https://synclinear.com) | [NEXT-820](https://linear.app/vercel/issue/NEXT-820/otel-add-httproute-to-server-spans)</sub> | https://github.com/vercel/next.js/issues/47113 | https://github.com/vercel/next.js/pull/47392 | de8e4e999eaa6f847ed5815da04ac353868661e5 | adf8c7f6e7baaabb66eba36bc3a5c1e33b3e4e4f | "2023-03-14T10:48:14Z" | javascript | "2023-03-24T17:52:28Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 47,038 | ["errors/next-router-not-mounted.md"] | Docs: `appDir` specific guidance for `messages/next-router-not-mounted` | ### What is the improvement or update you wish to see?
If you import `useRouter` from `next/router` instead of `next/navigation` you're taken to https://nextjs.org/docs/messages/next-router-not-mounted
### Is there any context that might help us understand?
It would be helpful to include a specific pointer for appDir users to make sure they got the import right.
### Does the docs page already exist? Please link to it.
https://nextjs.org/docs/messages/next-router-not-mounted | https://github.com/vercel/next.js/issues/47038 | https://github.com/vercel/next.js/pull/50076 | f2cbfe31478b9bf160e2a297ec6244b3e4087f40 | 8811c1f3f678a9513ac06f7a643ffb9def326861 | "2023-03-12T03:23:44Z" | javascript | "2023-06-08T20:08:26Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,974 | ["packages/next/src/build/webpack/plugins/next-types-plugin.ts"] | Apps using `typedRoutes` and no dynamic routes leads to no type errors on href of Link components | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 21.6.0: Thu Sep 29 20:12:57 PDT 2022; root:xnu-8020.240.7~1/RELEASE_X86_64
Binaries:
Node: 18.15.0
npm: 9.5.0
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.4-canary.8
eslint-config-next: 13.2.4-canary.8
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), TypeScript
### Link to the code that reproduces this issue
https://github.com/mdrayer/nextjs-typed-routes-issue
### To Reproduce
1. Install packages
```bash
npm ci
```
1. Attempt to run a build to see the expected type error
```bash
npm run build
```
The type error:
```
./src/app/page.tsx:14:19
Type error: "/foo/bar" is not an existing route. If it is intentional, please type it explicitly with `as Route`.
12 | <li>
13 | {/* No defined page file, type error */}
> 14 | <Link href="/foo/bar">Bar</Link>
| ^
15 | </li>
16 | <li>
17 | {/* Has a defined page file (/[slug]/page.tsx), no type error */}
```
This type error is _expected_ as `/foo/bar` does not have an applicable page file.
1. Rename `/[slug]` to `/slug` to make it into a static path
```bash
mv src/app/\[slug\] src/app/slug
```
1. Rerun the build command
```bash
npm run build
```
No error will occur this time, even though the links to both `/foo/bar` and `/baz` should both produce errors. This is likely because `DynamicRoutes` is typed as a string when there are no dynamic paths:
```ts
type DynamicRoutes<T extends string = string> = string;
```
This means that any string put into the `href` of the `Link` component will be valid.
### Describe the Bug
When an app using the `typedRoutes` config has no dynamic paths in the app, any value put into `href` prop of the `Link` component becomes valid, leading to no type errors.
### Expected Behavior
Only applicable paths should be valid in `href` prop of the `Link` component when `typedRoutes` config is enabled, regardless if there are dynamic paths or not.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/46974 | https://github.com/vercel/next.js/pull/46980 | cbc511ba36aa311cb8161f7eafa482ef9129febb | 1c83bb868d9cde3271398b4f361a92fa0eccb552 | "2023-03-09T21:10:35Z" | javascript | "2023-03-14T00:54:59Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,948 | ["packages/next/src/cli/next-dev.ts"] | `NODE_OPTIONS=--inspect` won't work properly after version `13.2.0` | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
npx next info
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000
Binaries:
Node: 16.14.0
npm: 8.3.1
Yarn: 1.22.17
pnpm: 6.32.3
Relevant packages:
next: 13.2.4-canary.8
eslint-config-next: 13.2.3
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
https://github.com/seiry/inspect-bug
### To Reproduce
init a repo using `npx create-next-app`, and change script in `package.json` to use chrome inspect debugger `"dev": "NODE_OPTIONS=--inspect next dev",`, and run `npm run dev`
### Describe the Bug
the debugger wont work like before
<img width="1470" alt="image" src="https://user-images.githubusercontent.com/4397354/223912603-e840f4e9-3c08-4e82-a475-7e3a270d2bb0.png">
and error msg:
<img width="603" alt="image" src="https://user-images.githubusercontent.com/4397354/223911211-cc7869f8-137e-4e99-94a3-ac811004b96a.png">
maybe this pr caused the bug:
https://github.com/vercel/next.js/pull/45745
https://github.com/vercel/next.js/pull/45745/files#diff-ddadbe5e107283e1bda7713050b8dcc19065dc804ab082e55e148efac0ef0221R443
<img width="536" alt="image" src="https://user-images.githubusercontent.com/4397354/223913916-fa411b86-ca2d-45ac-a9f7-ec54784856b3.png">
for the --inspect flag is deprecated
### Expected Behavior
should be a node js server code debugger
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/46948 | https://github.com/vercel/next.js/pull/46757 | 9be98e4aecff4770117015f8c586278417570b13 | 9f08ef8daf28bd4e19894c617617f88ad9d1bdff | "2023-03-09T03:58:36Z" | javascript | "2023-03-09T22:12:54Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,893 | ["packages/next/src/lib/server-external-packages.json"] | Using dompurify with SSR or Server Component fails with webpack error | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: linux
Arch: x64
Version: #22 SMP Tue Jan 10 18:39:00 UTC 2023
Binaries:
Node: 16.17.0
npm: 8.15.0
Yarn: 1.22.19
pnpm: 7.1.0
Relevant packages:
next: 13.2.4-canary.5
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/angry-thunder-s7tvqk?file=%2Fapp%2Fpage.tsx
### To Reproduce
1. Open the CodeSandbox above, main code is this in `app/page.tsx`
```tsx
import DOMPurify from "dompurify";
export default function Home() {
return (
<div
dangerouslySetInnerHTML={{
// 💥 Error: dompurify__WEBPACK_IMPORTED_MODULE_1___default(...).sanitize is not a function
__html: DOMPurify.sanitize("<img src=x onerror=alert(1)//>"),
}}
/>
);
}
```
2. Observe the error message below
```
Error: dompurify__WEBPACK_IMPORTED_MODULE_1___default(...).sanitize is not a function
```

This kind of works in the `pages/` directory (the image appears in the browser), although still throws an error while rendering in SSR.
### Describe the Bug
It seems that the `dompurify` library does not support Node.js usage out of the box.
One recommendation from Stack Overflow is to [use `isomorphic-dompurify`](https://stackoverflow.com/a/66799141/1268612) (300k weekly downloads vs 3.5m for `dompurify`)
### Expected Behavior
`dompurify` works out of the box with Next.js and Node.js
### Related issues
- https://github.com/vercel/next.js/issues/2711
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/46893 | https://github.com/vercel/next.js/pull/46990 | c75c4e56c59fcae7a3f4698413f894e5ea094de5 | 84104af63e9a27e8c6053bcbb09a0dd8fd3d5943 | "2023-03-07T17:42:42Z" | javascript | "2023-03-10T19:27:41Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,838 | ["examples/with-jest-babel/__tests__/__snapshots__/snapshot.tsx.snap", "examples/with-jest/__tests__/__snapshots__/snapshot.tsx.snap"] | Provided snapshot test fails for with-jest example | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000
Binaries:
Node: 16.13.1
npm: 8.1.2
Yarn: 1.22.19
pnpm: 7.27.0
Relevant packages:
next: 13.2.4-canary.4
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
```
### Which example does this report relate to?
with-jest
### What browser are you using? (if relevant)
n/a
### How are you deploying your application? (if relevant)
n/a
### Describe the Bug
Running `npm test` on the with-jest example, without any alterations, produces this error:
```
FAIL __tests__/snapshot.tsx
● renders homepage unchanged
expect(received).toMatchSnapshot()
Snapshot name: `renders homepage unchanged 1`
- Snapshot - 22
+ Received + 10
@@ -81,32 +81,20 @@
Powered by
<span
class="logo"
>
- <span
- style="box-sizing: border-box; display: inline-block; overflow: hidden; background: none; opacity: 1; border: 0px; margin: 0px; padding: 0px; position: relative; max-width: 100%;"
- >
- <span
- style="box-sizing: border-box; display: block; background: none; opacity: 1; border: 0px; margin: 0px; padding: 0px; max-width: 100%;"
- >
- <img
- alt=""
- aria-hidden="true"
- src="data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%2772%27%20height=%2716%27/%3e"
- style="display: block; max-width: 100%; background: none; opacity: 1; border: 0px; margin: 0px; padding: 0px;"
- />
- </span>
- <img
- alt="Vercel Logo"
- data-nimg="intrinsic"
- decoding="async"
- src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
- style="position: absolute; top: 0px; left: 0px; bottom: 0px; right: 0px; box-sizing: border-box; padding: 0px; margin: auto; display: block; width: 0px; height: 0px; min-width: 100%; max-width: 100%; min-height: 100%; max-height: 100%;"
- />
- <noscript />
- </span>
+ <img
+ alt="Vercel Logo"
+ data-nimg="1"
+ decoding="async"
+ height="16"
+ loading="lazy"
+ src="/vercel.svg"
+ style="color: transparent;"
+ width="72"
+ />
</span>
</a>
</footer>
</div>
</div>
4 | it('renders homepage unchanged', () => {
5 | const { container } = render(<Home />)
> 6 | expect(container).toMatchSnapshot()
| ^
7 | })
8 |
at Object.toMatchSnapshot (__tests__/snapshot.tsx:6:21)
› 1 snapshot failed.
PASS __tests__/index.test.tsx
Snapshot Summary
› 1 snapshot failed from 1 test suite. Inspect your code changes or press `u` to update them.
Test Suites: 1 failed, 1 passed, 2 total
Tests: 1 failed, 1 passed, 2 total
Snapshots: 1 failed, 1 total
Time: 1.225 s
Ran all test suites related to changed files.
```
### Expected Behavior
All tests should pass
### To Reproduce
1. Create a next app with the with-jest example:
```
npx create-next-app@latest --example with-jest snapshots-fail
```
2. `cd snapshots-fail`
3. `npm test`
4. type `a` to run all tests | https://github.com/vercel/next.js/issues/46838 | https://github.com/vercel/next.js/pull/46885 | 105e5b0088b36cafd224aaf8d635e3fac7182df9 | 9a1798b69dd2e2b39f3af3fb488f9eef0048473f | "2023-03-06T16:29:42Z" | javascript | "2023-03-08T01:16:15Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,789 | ["examples/image-component/components/view-source.tsx"] | Docs: Image Component Examples page | ### What is the improvement or update you wish to see?
# Problem
Links to view sources on Github for the following examples pages are broken:
- https://image-component.nextjs.gallery/responsive
- https://image-component.nextjs.gallery/fill
- https://image-component.nextjs.gallery/placeholder
- https://image-component.nextjs.gallery/shimmer
- https://image-component.nextjs.gallery/color
- https://image-component.nextjs.gallery/background
The component is the same on every pages.
### Is there any context that might help us understand?
# How To Resolve
The source code is here: https://github.com/vercel/next.js/tree/canary/examples/image-component
The component is called `view-source`, replacing tree with `tree` with `blob` in the url can solve the problem
### Does the docs page already exist? Please link to it.
https://image-component.nextjs.gallery/ | https://github.com/vercel/next.js/issues/46789 | https://github.com/vercel/next.js/pull/46790 | 9dd24a593187dd4e177e542abd9ae3a7dd9474d3 | 605f7e0e0cd779170e009ae75467383ce498aaf4 | "2023-03-05T11:26:59Z" | javascript | "2023-03-05T17:47:15Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,626 | ["packages/next/src/server/config-schema.ts", "packages/next/src/server/config-shared.ts", "packages/next/taskfile.js", "test/integration/config-schema-check/next.config.js", "test/integration/config-schema-check/pages/index.js", "test/integration/config-schema-check/test/index.test.js"] | 13.2.2 changed build warnings to errors | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000
Binaries:
Node: 19.6.1
npm: 9.4.0
Yarn: 4.0.0-rc.39
pnpm: N/A
Relevant packages:
next: 13.2.3
eslint-config-next: 13.2.3
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
next build
### To Reproduce
Have warnings as described in this issue https://github.com/vercel/next.js/issues/39161
### Describe the Bug
13.2.1 had these issues as `warn`. Since 13.2.2 those are as `error` so the build fails.
### Expected Behavior
Warn but allow to build.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/46626 | https://github.com/vercel/next.js/pull/46656 | 5e112c062ee15fa9280b4cca9be23d3217e2df84 | c62791294e5e3e26752c63c8f4e4d54ba1f795c3 | "2023-03-01T13:48:29Z" | javascript | "2023-03-01T22:45:58Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,621 | ["packages/next/src/server/lib/patch-fetch.ts", "test/e2e/app-dir/app-static/app-static.test.ts", "test/e2e/app-dir/app-static/app/variable-revalidate/status-code/page.js"] | Fetch status code is always 200 except if performing a full page refresh without cache | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:06:26 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8112
Binaries:
Node: 18.12.1
npm: 8.19.2
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.2-canary.1
eslint-config-next: 13.2.1
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Data fetching (gS(S)P, getInitialProps)
### Link to the code that reproduces this issue
https://github.com/TCM-dev/nextjs-error-handling-bug
### To Reproduce
- Starts the project with npm run dev
- Go to the page `http://localhost:3000/`
- Server console logs `true`and `200`
- Refresh the page without cache
- Server console logs `false`and `404`
### Describe the Bug
Using fetch to retrieve data inside a page on server side, the response status code is incorrect when simply loading/reloading the page. It looks like nextjs is caching the response without taking into account the status code.
### Expected Behavior
The status code should be corresponding to the status code of the response and not return a 200 by default.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/46621 | https://github.com/vercel/next.js/pull/47096 | 2579ad7648a1c247ae2c99013b37cb2f24d2296f | 16131e2d4905dcf8f2e8629d1007b47112d80461 | "2023-03-01T12:43:53Z" | javascript | "2023-03-14T04:37:22Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,588 | ["packages/next/src/server/config.ts"] | Custom dev server get Error: TypeError: Cannot read properties of undefined (reading 'ProvidePlugin') | ### Verify canary release
- [x] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: MacOS
Arch: M1
Binaries:
Node: 16.4.2
npm: 7.17.0
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
https://stackblitz.com/edit/nextjs-n5mjba?file=package.json,server.js
### To Reproduce
1. Create a create-next-app
2. create a new `server.js` in root directory
3. Install package `webpack` and `express`
4. Use the code in stackbliz link in `server.js`, can pass any config into `next()`
5. `node server.js` start the server
### Describe the Bug
If I pass any next.config into `next({conf=${ANY_NEXT_CONFIG}})`, will get error:
```bash
TypeError: Cannot read properties of undefined (reading 'ProvidePlugin')
at Object.getBaseWebpackConfig [as default] (file:///home/projects/nextjs-n5mjba/node_modules/next/dist/build/webpack-config.js:1087:64)
at async Promise.all (index 0)
at async Span.traceAsyncFn (file:///home/projects/nextjs-n5mjba/node_modules/next/dist/trace/trace.js:79:20)
at async Span.traceAsyncFn (file:///home/projects/nextjs-n5mjba/node_modules/next/dist/trace/trace.js:79:20)
at async HotReloader.start (file:///home/projects/nextjs-n5mjba/node_modules/next/dist/server/dev/hot-reloader.js:387:30)
at async DevServer.prepare (file:///home/projects/nextjs-n5mjba/node_modules/next/dist/server/dev/next-dev-server.js:596:9)
```
### Expected Behavior
Dev server to spin up in localhost:3000.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/46588 | https://github.com/vercel/next.js/pull/48107 | 5ea70b85c1995c7c94970146d7025cb1b903bf17 | db7b3bdbcf342a6d87d053c0cdab8ad1120608ac | "2023-03-01T01:23:22Z" | javascript | "2023-04-07T22:24:59Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,573 | ["packages/next/src/server/typescript/rules/client-boundary.ts"] | [NEXT-732] The "error.tsx" code that I copy/pasted from the docs causes a linting error. | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
npx next info
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 16.17.1
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.2-canary.3
eslint-config-next: 13.2.1
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://github.com/jazzypants1989/nextjs-test
### To Reproduce
Copy and paste the error.tsx provided by the docs into the app directory.
### Describe the Bug

Why?
### Expected Behavior
I expect to be able to copy and paste examples from the docs without causing a linting error.
### Which browser are you using? (if relevant)
Doesn't matter
### How are you deploying your application? (if relevant)
Doesn't matter.
<sub>[NEXT-732](https://linear.app/vercel/issue/NEXT-732/the-errortsx-code-that-i-copypasted-from-the-docs-causes-a-linting)</sub> | https://github.com/vercel/next.js/issues/46573 | https://github.com/vercel/next.js/pull/46898 | 5dae98ea0ae173cea80e11d1610d880af0b766ec | abf7da32a47d0bb19af34db05e28d8ad8346ef9b | "2023-02-28T18:36:56Z" | javascript | "2023-03-07T20:07:44Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,561 | ["packages/next/src/server/app-render.tsx", "packages/next/src/server/node-web-streams-helper.ts"] | SSR sometimes breaks utf8 characters in component props into individual bytes | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP PREEMPT_DYNAMIC Mon Feb 6 11:26:13 UTC 2023
Binaries:
Node: 19.6.0
npm: 8.19.2
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 13.2.2-canary.3
eslint-config-next: 13.2.1
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
it reproduces randomly
### To Reproduce
Render a "use client" components with props containing utf8 characters.
Sometimes utf8 characters are broken like that:
> :I{\"id\":\"(app-client)/./src/app/[lang]/login/Login.tsx\",\"name\":\"Login\",\"chunks\":[\"app/[lang]/login/page:app/[lang]/login/page\"],\"async\":false}\n9:[\"$\",\"$La\",null,{\"lang\":\"ru\",\"translations\":{\"sign_in\":\"Увайсьці\",\"email_address\":\"Адрас e-mail\",\"password\":\"Пароль\",\"forgot_password\":\"Забыліся парoль?\",\"remember_me\":\".За�"])</script><script>self.__next_f.push([1,"�омніць мяне\"},\"children\":[\"$\",\"$Lb\",null,{}]}]\n"])</script>


Actually the broken string should be `Запомніць мяне`
### Describe the Bug
The bug is in the use of the function `decodeText` in `app-render.ts` file.
The function `decodeText` has the second argument which should fix utf8 characters support, but it's not used in `app-render.ts`.
To not break utf8 characters the second argument to `decodeText` should be always provided.
### Expected Behavior
Utf8 characters are not broken
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/46561 | https://github.com/vercel/next.js/pull/46564 | 4b705a5473320a9f047683abad80793c27f3eea5 | 11494c30024c010523bdc7c27b772695c4c37c54 | "2023-02-28T15:54:21Z" | javascript | "2023-02-28T22:20:36Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,549 | ["packages/eslint-plugin-next/src/rules/no-before-interactive-script-outside-document.ts", "test/unit/eslint-plugin-next/no-before-interactive-script-outside-document.test.ts"] | [NEXT-693] next/script with loading strategy inside rootLayout, causes error when it's not TypeScript | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 18.14.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.2-canary.3
eslint-config-next: 13.2.1
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
ESLint (eslint-config-next), Script optimization (next/script)
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-6bcyqf
### To Reproduce
Create a ``rootLayout`` with JavaScript:
```javascript
// app/layout.js
import Script from "next/script";
export default function RootLayout({ children }) {
return (
<html lang="en">
<body>{children}</body>
<Script src="http://1.1.1.1/test.js" strategy="beforeInteractive" />
</html>
);
}
```
You will get an error that you should not use ``next/script`` with a loading strategy outside of `pages/_document.js`, now create the same layout, but with TypeScript, you will get no error on the frontend.
```tsx
// app/layout.tsx
import Script from "next/script";
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
<Script src="http://1.1.1.1/test.js" strategy="beforeInteractive" />
</html>
);
}
```
`yarn lint` will fail on both cases.
### Describe the Bug
If you use ``next/script`` with a loading strategy inside a TypeScript ``rootLayout``, everything works fine, as described in the beta docs: https://beta.nextjs.org/docs/api-reference/components/script#beforeinteractive
When you try the same inside a ``rootLayout`` which is not TypeScript, you get following error:
> `next/script`'s `beforeInteractive` strategy should not be used outside of `pages/_document.js`. See: https://nextjs.org/docs/messages/no-before-interactive-script-outside-documenteslint[@next/next/no-before-interactive-script-outside-document](https://nextjs.org/docs/messages/no-before-interactive-script-outside-document)
When you run ``yarn lint`` you will get the error for both cases (`layout.js` and `layout.tsx`).
### Expected Behavior
Get no error at all, since the beta docs say it's okay, to use next/script with a straategy inside `rootLayout`.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-693](https://linear.app/vercel/issue/NEXT-693/nextscript-with-loading-strategy-inside-rootlayout-causes-error-when)</sub> | https://github.com/vercel/next.js/issues/46549 | https://github.com/vercel/next.js/pull/46609 | bfc3849b1fbca35ccdb9a3bd71c1bf5a457439ae | 8b50b80cdefd7bc4bd425d4becbec3de9e817fa2 | "2023-02-28T12:11:58Z" | javascript | "2023-03-08T10:28:52Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,509 | ["packages/next/src/lib/typescript/writeConfigurationDefaults.ts", "test/integration/tsconfig-verifier/test/index.test.js"] | [NEXT-689] `next dev` rewrites `isolatedModules` to true in tsconfig with typescript 5 option `verbatimModuleSyntax` set to true | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 18.9.1
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
CLI (create-next-app)
### Link to the code that reproduces this issue
https://github.com/m1tyya/next-typescript5-bug
### To Reproduce
1. Clone repo and install dependencies.
2. Run yarn dev and see changes in tsconfig.json.
### Describe the Bug
Typescript 5 has a new option `verbatimModuleSyntax` which makes `isolatedModules` redundant. However, starting a dev server sets `isolatedModules` to true.
### Expected Behavior
Not setting `isolatedModules` value.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-689](https://linear.app/vercel/issue/NEXT-689/next-dev-rewrites-isolatedmodules-to-true-in-tsconfig-with-typescript)</sub> | https://github.com/vercel/next.js/issues/46509 | https://github.com/vercel/next.js/pull/48018 | 558632b5f2bb9c78e4a234813a07c45ccaacbf0c | be960ccd0247923436106831d14db8c9ed8d3409 | "2023-02-27T18:45:17Z" | javascript | "2023-06-09T19:07:30Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,503 | ["packages/next/src/build/webpack/loaders/next-app-loader.ts", "packages/next/src/client/components/navigation.ts", "packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts", "packages/next/src/server/app-render/create-flight-router-state-from-loader-tree.ts", "packages/next/src/server/app-render/index.tsx", "packages/next/src/server/dev/on-demand-entry-handler.ts", "test/e2e/app-dir/app/app/navigation/searchparams/page.js"] | [NEXT-688] Next appDir Router stale search/query param when navigating to a previously visited route | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000
Binaries:
Node: 16.13.0
npm: 8.1.0
Yarn: 1.22.17
pnpm: 7.5.0
Relevant packages:
next: 13.2.2-canary.1
eslint-config-next: 13.2.1
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Routing (next/router, next/navigation, next/link)
### Link to the code that reproduces this issue
https://github.com/ryanto/next-13-app-dir-query-params
### To Reproduce
In the reproduction app visit localhost:3000. There are a series of steps with links you can click on the page to reproduce the issue.
The links will walk you through visiting a route with a query param, another route, and then back to the original route without a query param.
### Describe the Bug
If you visit a route with a query param, go to a different route, and then come back to the original route without a query param the render will show a cached version that has a query param.
* Visit /a?hello=world
* Visit /b
* Visit /a <- renders as if you were on /a?hello=world
### Expected Behavior
I was expecting a different render based on the url / query param.
### Which browser are you using? (if relevant)
Brave v1.48.171
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-688](https://linear.app/vercel/issue/NEXT-688/next-appdir-router-stale-searchquery-param-when-navigating-to-a)</sub> | https://github.com/vercel/next.js/issues/46503 | https://github.com/vercel/next.js/pull/47312 | afd7a50a7780a56c2ebe1e3dea77d79054bf72f1 | 8a4e8059ede3b5fbce05a734f8b72f68ece21245 | "2023-02-27T16:31:19Z" | javascript | "2023-03-20T18:57:29Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,493 | ["packages/next/src/lib/server-external-packages.json"] | Route Handlers Crash with bcrypt | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```
Operating System:
Platform: linux
Arch: x64
Version: Ubuntu 20.04.0 LTS Mon Feb 27 2023 14:52:57 GMT+0100 (Central European Standard Time)
Binaries:
Node: 16.14.2
npm: 7.17.0
Yarn: 1.22.19
pnpm: 7.13.6
Relevant packages:
next: 13.2.2-canary.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Middleware / Edge (API routes, runtime)
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-tteixg?file=app%2Fpage.tsx
### To Reproduce
1. Open the StackBlitz
2. Click on the button to compile the Route Handler `api/route.ts` and cause the server crash
### Describe the Bug
When importing [`bcrypt`](https://www.npmjs.com/package/bcrypt) in a [Route Handler](https://beta.nextjs.org/docs/routing/route-handlers) and compiling that route, the process crashes, being unable to parse the HTML:
```
error - ./node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
Module parse failed: Unexpected token (1:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> <!doctype html>
| <html>
| <head>
Import trace for requested module:
./node_modules/@mapbox/node-pre-gyp/lib/util/nw-pre-gyp/index.html
./node_modules/@mapbox/node-pre-gyp/lib/ sync ^\.\/.*$
./node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js
./node_modules/bcrypt/bcrypt.js
./app/api/route.ts
```
If this issue is avoided using an `html-loader` or similar, then further errors appear, about missing `mock-aws-s3`, `aws-sdk`, and `nock` modules:
```
error - ./node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:43:0
Module not found: Can't resolve 'mock-aws-s3'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/@mapbox/node-pre-gyp/lib/ sync ^\.\/.*$
./node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js
./node_modules/bcrypt/bcrypt.js
./app/api/route.ts
wait - compiling /_error (client and server)...
error - ./node_modules/@mapbox/node-pre-gyp/lib/util/s3_setup.js:43:0
Module not found: Can't resolve 'mock-aws-s3'
https://nextjs.org/docs/messages/module-not-found
Import trace for requested module:
./node_modules/@mapbox/node-pre-gyp/lib/ sync ^\.\/.*$
./node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js
./node_modules/bcrypt/bcrypt.js
./app/api/route.ts
```
If you install those modules, you get a bunch of critical dependency warnings and other errors like `Error: /home/projects/vercel-next-js-cc6lum/.next/server/app/api/package.json does not exist`
```
error - node_modules/@mapbox/node-pre-gyp/lib/pre-binding.js (19:10) @ exports.find
error - Error: /home/projects/vercel-next-js-cc6lum/.next/server/app/api/package.jsondoes not exist
at exports.find (webpack-internal:///(sc_server)/./node_modules/@mapbox/node-pre-gyp/lib/pre-binding.js:14:15)
at eval (webpack-internal:///(sc_server)/./node_modules/bcrypt/bcrypt.js:4:31)
at (sc_server)/./node_modules/bcrypt/bcrypt.js (file:///home/projects/vercel-next-js-cc6lum/.next/server/app/api/route.js:5698:1)
at __webpack_require__ (file:///home/projects/vercel-next-js-cc6lum/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(sc_server)/./app/api/route.ts:5:64)
at (sc_server)/./app/api/route.ts (file:///home/projects/vercel-next-js-cc6lum/.next/server/app/api/route.js:873:1)
at __webpack_require__ (file:///home/projects/vercel-next-js-cc6lum/.next/server/webpack-runtime.js:33:43)
at eval (webpack-internal:///(sc_server)/./node_modules/next/dist/build/webpack/loaders/next-app-loader.js?name=app%2Fapi%2Froute&appPaths=&pagePath=private-next-app-dir%2Fapi%2Froute.ts&appDir=%2Fhome%2Fprojects%2Fvercel-next-js-cc6lum%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2Fhome%2Fprojects%2Fvercel-next-js-cc6lum&isDev=true&tsconfigPath=tsconfig.json&assetPrefix=!:13:111)
at (sc_server)/./node_modules/next/dist/build/webpack/loaders/next-app-loader.js?name=app%2Fapi%2Froute&appPaths=&pagePath=private-next-app-dir%2Fapi%2Froute.ts&appDir=%2Fhome%2Fprojects%2Fvercel-next-js-cc6lum%2Fapp&pageExtensions=tsx&pageExtensions=ts&pageExtensions=jsx&pageExtensions=js&rootDir=%2Fhome%2Fprojects%2Fvercel-next-js-cc6lum&isDev=true&tsconfigPath=tsconfig.json&assetPrefix=! (file:///home/projects/vercel-next-js-cc6lum/.next/server/app/api/route.js:862:1)
at __webpack_require__ (file:///home/projects/vercel-next-js-cc6lum/.next/server/webpack-runtime.js:33:43)
at __webpack_exec__ (file:///home/projects/vercel-next-js-cc6lum/.next/server/app/api/route.js:17114:39)
at eval (file:///home/projects/vercel-next-js-cc6lum/.next/server/app/api/route.js:17115:28)
at Object.eval (file:///home/projects/vercel-next-js-cc6lum/.next/server/app/api/route.js:17118:3)
at Object.function (https://vercelnextjscc6lum-fscu.w-credentialless.staticblitz.com/blitz.fc57b779eff411414c7b91114df9b720faaf721b.js:15:143671)
at Module._compile (https://vercelnextjscc6lum-fscu.w-credentialless.staticblitz.com/blitz.fc57b779eff411414c7b91114df9b720faaf721b.js:6:219079)
at Module._extensions..js (https://vercelnextjscc6lum-fscu.w-credentialless.staticblitz.com/blitz.fc57b779eff411414c7b91114df9b720faaf721b.js:6:219743)
at Module.load (https://vercelnextjscc6lum-fscu.w-credentialless.staticblitz.com/blitz.fc57b779eff411414c7b91114df9b720faaf721b.js:6:217769)
at Module._load (https://vercelnextjscc6lum-fscu.w-credentialless.staticblitz.com/blitz.fc57b779eff411414c7b91114df9b720faaf721b.js:6:215340)
at Module.require (https://vercelnextjscc6lum-fscu.w-credentialless.staticblitz.com/blitz.fc57b779eff411414c7b91114df9b720faaf721b.js:6:218087)
at i (https://vercelnextjscc6lum-fscu.w-credentialless.staticblitz.com/blitz.fc57b779eff411414c7b91114df9b720faaf721b.js:6:415284)
at _0x532db6 (https://vercelnextjscc6lum-fscu.w-credentialless.staticblitz.com/blitz.fc57b779eff411414c7b91114df9b720faaf721b.js:15:142939)
at Object.requirePage (file:///home/projects/vercel-next-js-cc6lum/node_modules/next/dist/server/require.js:88:12)
at eval (file:///home/projects/vercel-next-js-cc6lum/node_modules/next/dist/server/load-components.js:49:73)
at async Object.loadComponentsImpl [as loadComponents] (file:///home/projects/vercel-next-js-cc6lum/node_modules/next/dist/server/load-components.js:49:26)
at async DevServer.findPageComponentsImpl (file:///home/projects/vercel-next-js-cc6lum/node_modules/next/dist/server/next-server.js:599:36) {
page: '/api'
}
null
warn - ./node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js
./node_modules/@mapbox/node-pre-gyp/lib/ sync ^\.\/.*$
./node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js
./node_modules/bcrypt/bcrypt.js
./app/api/route.ts
./node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js
./node_modules/@mapbox/node-pre-gyp/lib/pre-binding.js
./node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js
./node_modules/bcrypt/bcrypt.js
./app/api/route.ts
./node_modules/bcrypt/bcrypt.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./node_modules/bcrypt/bcrypt.js
./app/api/route.ts
```
### Expected Behavior
Using `bcrypt` within an API Route Handler should work.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/46493 | https://github.com/vercel/next.js/pull/46532 | 619c76c0f983a3880fcec065c933ef1ef3b21633 | 7a9047a730d52e145ab547bdec25ae26eeeb9d73 | "2023-02-27T14:01:28Z" | javascript | "2023-02-28T10:53:37Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,459 | ["packages/next-codemod/transforms/__testfixtures__/next-image-to-legacy-image/dynamic.input.tsx", "packages/next-codemod/transforms/__testfixtures__/next-image-to-legacy-image/dynamic.output.tsx", "packages/next-codemod/transforms/__testfixtures__/next-image-to-legacy-image/general.input.tsx", "packages/next-codemod/transforms/__testfixtures__/next-image-to-legacy-image/general.output.tsx", "packages/next-codemod/transforms/__testfixtures__/next-image-to-legacy-image/require.input.tsx", "packages/next-codemod/transforms/__testfixtures__/next-image-to-legacy-image/require.output.tsx", "packages/next-codemod/transforms/__tests__/next-image-to-legacy-image.test.js", "packages/next-codemod/transforms/next-image-to-legacy-image.ts"] | [next/codemod]: Type-only imports not preserved when using `next-image-to-legacy-image` | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000
Binaries:
Node: 16.13.0
npm: 8.1.0
Yarn: 1.22.19
pnpm: 7.1.7
Relevant packages:
next: 13.2.2-canary.1
eslint-config-next: 13.2.2-canary.1
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
Image optimization (next/image, next/legacy/image)
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-cw9gs5?file=pages/index.tsx
### To Reproduce
Add a type-only import from the `next/image` package (e.g. `import type { ImageProps } from 'next/image';`)
Run `npx @next/codemod next-image-to-legacy-image . --force`
### Describe the Bug
Type-only imports are not preserved when running the `next-image-to-legacy-image` codemod
### Expected Behavior
I expect that the `type` keyword will be preserved when running the codemod:
## Expected
```ts
import type { ImageProps } from 'next/image';
// Becomes:
import type { ImageProps } from 'next/legacy/image';
```
## Actual
```ts
import type { ImageProps } from 'next/image';
// Becomes:
import { ImageProps } from 'next/legacy/image';
```
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/46459 | https://github.com/vercel/next.js/pull/46460 | 586ae4e880f7b2cebe536a0d1380d3bccd462fd5 | 54266bb590e935bca6213a268155bf2bf8de1b50 | "2023-02-27T00:32:49Z" | javascript | "2023-02-27T11:06:48Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,436 | ["packages/next/src/server/base-server.ts", "test/e2e/app-dir/app-static/app-static.test.ts", "test/e2e/app-dir/app-static/app/gen-params-dynamic/[slug]/page.js"] | [NEXT-670] Faulty `app/` Static to Dynamic Error When POST fetches are used from layout.tsx | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.6.0: Sat Jun 18 17:07:28 PDT 2022; root:xnu-8020.140.41~1/RELEASE_ARM64_T8110
Binaries:
Node: 16.16.0
npm: 8.11.0
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.2-canary.1
eslint-config-next: 13.2.1
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Data fetching (gS(S)P, getInitialProps)
### Link to the code that reproduces this issue
https://github.com/kulgg/app-static-to-dynamic-reproduction
### To Reproduce
Start the development server and navigate to /one.
The `app/` Static to Dynamic Error will be shown.
### Describe the Bug
POST request fetches from a layout component inside a dynamic segment route that uses generateStaticParams will lead to a faulty [`app/ Static to Dynamic Error`](https://nextjs.org/docs/messages/app-static-to-dynamic-error).
GET requests work without problems.
On build the should-be SSG routes turn into server-side rendered routes.
### Expected Behavior
As with GET requests, the statically generated dynamic segment routes should be generated for POST requests without problems
### Which browser are you using? (if relevant)
Brave Version 1.48.171 Chromium: 110.0.5481.177
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-670](https://linear.app/vercel/issue/NEXT-670/faulty-app-static-to-dynamic-error-when-post-fetches-are-used-from)</sub> | https://github.com/vercel/next.js/issues/46436 | https://github.com/vercel/next.js/pull/46597 | cccf4f2a29c3782950aa038161746fcd84c61166 | abf8a42326c336734ee01af8573cdff8a719b4bd | "2023-02-26T10:09:30Z" | javascript | "2023-03-01T07:37:12Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,419 | ["packages/next/src/build/index.ts", "packages/next/src/build/webpack/loaders/next-edge-ssr-loader/index.ts", "packages/next/src/build/webpack/loaders/next-edge-ssr-loader/render.ts", "packages/next/src/build/webpack/plugins/flight-client-entry-plugin.ts", "packages/next/src/build/webpack/plugins/middleware-plugin.ts", "packages/next/src/export/index.ts", "packages/next/src/server/base-server.ts"] | Standalone output has a response time of >200ms when using app dir | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 18.12.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.2-canary.0
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Standalone mode (output: "standalone")
### Link to the code that reproduces this issue
-
### To Reproduce
- Create a project with the `reproduction-template-app-dir` template
- Add `output: 'standalone'` to `next.config.js`
- Run `npm run build`
- Run `node .next/standalone/server.js`
- Check the page load time in a browser
### Describe the Bug
Every request to a page has a response time of about 200ms. This does not happen with app dir disabled, or if not using standalone output.
With some debugging, I found out that problem is that `.next/server/server-reference-manifest.json` seems to be missing from the generated standalone output. The `loadManifest` function tries to load the file 3 times, with a 100ms timeout between retries, which is where the observed 200ms comes from.
### Expected Behavior
Using standalone output mode should not have a negative effect on page load times.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/46419 | https://github.com/vercel/next.js/pull/46420 | ebed7396f53363d23441e0b6b4e7432d7cf6eb0b | 624232d064a2b7f0389746ca7c6b6944433bf566 | "2023-02-25T13:58:55Z" | javascript | "2023-02-25T17:59:38Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,406 | ["packages/next-swc/crates/core/src/react_server_components.rs", "packages/next/src/build/webpack/plugins/wellknown-errors-plugin/parseRSC.ts", "test/development/acceptance-app/rsc-build-errors.test.ts"] | Metadata error contradicts what the docs says | ### Describe the feature you'd like to request
The doc says: "Metadata can be used in any page.js or layout.js file."
When I add Metadata to page.js I get an error: "metadata is not supported in app/." folder....."
This issue can be fixed like here https://github.com/vercel/next.js/issues/46404 but the error itself contradicts what the docs says and it is very confusing.
### Describe the solution you'd like
Better error messages
### Describe alternatives you've considered
Better error messages | https://github.com/vercel/next.js/issues/46406 | https://github.com/vercel/next.js/pull/46412 | 2988be2a0595d72c51780a3a2cef4db603702305 | 516bc832966021769687d21ee31a072a68fded8e | "2023-02-25T09:41:30Z" | javascript | "2023-02-25T14:00:06Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,379 | ["packages/next/src/build/webpack/plugins/flight-client-entry-plugin.ts", "packages/next/src/server/dev/hot-reloader.ts", "packages/next/src/server/dev/next-dev-server.ts", "packages/next/src/server/dev/on-demand-entry-handler.ts", "test/development/app-hmr/app/folder/page.jsx", "test/development/app-hmr/app/layout.jsx", "test/development/app-hmr/hmr.test.ts", "test/development/app-hmr/next.config.js", "test/lib/next-modes/base.ts"] | [NEXT-650] Renaming/removing on app dir page causes dev script to output the error modal on any subsequent requests | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000
Binaries:
Node: 18.5.0
npm: 8.12.1
Yarn: 1.22.17
pnpm: 7.17.0
Relevant packages:
next: 13.2.1-canary.0
eslint-config-next: 13.2.1
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), CLI (create-next-app), Routing (next/router, next/navigation, next/link)
### Link to the code that reproduces this issue
https://github.com/bruno12mota/next-rename-bug
### To Reproduce
1. Run `npm run dev`
2. Open app at http://localhost:3000/about
3. Rename `/src/app/about` folder to something else like `/src/app/aboutme`
4. Your browser at http://localhost:3000/about will now have a `Failed to compile` error
5. Navigating to http://localhost:3000/aboutme or even http://localhost:3000/ will now output the same error
### Describe the Bug
Using the experimental app dir if your page consumes a client component and a folder is renamed, the dev script enters an error state that you can't come out of, unless you restart the dev script, at which point it no longer errors and works normally.
In the git repo i create, the about route has a page that is consuming an `about-content` file which is a client component, without any client components this error doesn't happen from what i could tell.
### Expected Behavior
I'd expect for the dev server to eventually reconcile the path change and not output the error modal on every request. Right now i have to restart the dev server every time i make a routing change.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-650](https://linear.app/vercel/issue/NEXT-650/renamingremoving-on-app-dir-page-causes-dev-script-to-output-the-error)</sub> | https://github.com/vercel/next.js/issues/46379 | https://github.com/vercel/next.js/pull/46583 | 11494c30024c010523bdc7c27b772695c4c37c54 | 5532b6a93fe1d64c999ba3201cb10cd49315e8f6 | "2023-02-24T17:26:41Z" | javascript | "2023-02-28T23:32:03Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,374 | ["packages/next/src/build/webpack/config/blocks/css/index.ts", "packages/next/src/build/webpack/config/blocks/css/loaders/client.ts", "packages/next/src/build/webpack/config/blocks/css/loaders/global.ts", "packages/next/src/build/webpack/config/blocks/css/loaders/modules.ts", "packages/next/src/build/webpack/config/utils.ts"] | Webpack loaders not found when building with `[email protected]` | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Home
Binaries:
Node: 16.19.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.1
eslint-config-next: 13.1.1
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
https://github.com/LuckeeDev/csl
### To Reproduce
Install `[email protected]` and run `yarn build web`. The error will prevent the build from completing, whereas with `[email protected]` everything works fine.
### Describe the Bug
I get multiple statements like the following when building the project:
```
Module parse failed: The keyword 'interface' is reserved (4:0)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. S
ee https://webpack.js.org/concepts#loaders
| import axios from 'axios';
|
> interface TokensResponse {
| access_token: string;
| expires_in: number;
```
### Expected Behavior
The build should work without errors.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/46374 | https://github.com/vercel/next.js/pull/46490 | ce234fb9ad1513f365bb4cea734b5cbf38416f7b | 69fe4eee39747861bc7bc306ac5ab1a2e5786596 | "2023-02-24T15:40:15Z" | javascript | "2023-02-27T14:29:42Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,356 | ["packages/next/src/server/base-server.ts", "test/e2e/app-dir/app-static/app-static.test.ts", "test/e2e/app-dir/app-static/app/force-dynamic-prerender/[slug]/page.js"] | [NEXT-644] cookies broke on 13.2.1 Invariant: Method expects to have requestAsyncStorage, none available | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: Ubuntu 20.04.0 LTS Fri Feb 24 2023 12:23:18 GMT+0200 (Eastern European Standard Time)
Binaries:
Node: 16.14.2
npm: 7.17.0
Yarn: 1.22.19
pnpm: 7.13.6
Relevant packages:
next: 13.2.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-gqeapg?file=package.json,app%2F[variant]%2F(shop)%2Fp%2F[[...id]]%2Fpage.tsx,next.config.js
### To Reproduce
Try to import cookies from `next/headers`
Try to access a dynamic page, eg `/test/p`
### Describe the Bug
Error: Invariant: Method expects to have requestAsyncStorage, none available
This happens if I do an import of cookies
```
import { cookies } from 'next/headers';
const DynamicPage = async () => {
const nextCookies = cookies();
console.log(nextCookies.get('random'));
const data = await loadRandomData();
return <div>{data.title}</div>;
};
```

### Expected Behavior
I can access the cookies object on a dynamic page
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-644](https://linear.app/vercel/issue/NEXT-644/cookies-broke-on-1321-invariant-method-expects-to-have)</sub> | https://github.com/vercel/next.js/issues/46356 | https://github.com/vercel/next.js/pull/46848 | 250160f4a919b0255a2886505b4ff0914659f53f | c14c83a299725c05c56d2d12b3198da543c8d4af | "2023-02-24T10:26:47Z" | javascript | "2023-03-21T20:55:04Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,349 | ["packages/next/src/server/lib/incremental-cache/index.ts", "packages/next/src/server/lib/patch-fetch.ts", "test/e2e/app-dir/app-static/app-static.test.ts", "test/e2e/app-dir/app-static/app/variable-revalidate-edge/post-method-cached/page.js", "test/e2e/app-dir/app-static/app/variable-revalidate-edge/post-method-request/page.js", "test/e2e/app-dir/app-static/app/variable-revalidate/post-method-cached/page.js"] | "Fetch" is also cached for "POST" requests | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000
Binaries:
Node: 18.11.0
npm: 8.19.2
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 13.2.1
eslint-config-next: 13.2.1
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
Data fetching (gS(S)P, getInitialProps)
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-hg91jc
### To Reproduce
1. Start the project and open the home page.
2. Click on the post link first: "TikTok Geld verdienen".
3. On the next page you will see the exact post title.
4. Click "Back to Index".
5. Now click on the category: "Online Business Anleitungen".
6. On the next page, the post title will be displayed again. However, the category name should be displayed.
Two notes:
1. I could reproduce the error only on my Mac (Apple M1 Max). I think it works on Linux for example. On the stackblitz link it works correctly for example.
2. According to the documentation, "POST" fetch requests should not be cached, however I always get a cached result from the second request on, which causes the error (I have already investigated deeper). For example, when I execute the query to retrieve the category, I get the result of the post query.
### Describe the Bug
1. The fetch function apparently also caches POST requests.
2. The result of the first GraphQL request is cached and then returned for all further GraphQL requests.
### Expected Behavior
1. POST requests should not be cached, unless I use "cache" from React (as described in the documentation).
2. If POST requests are cached lately, then only "same requests" should be cached.
### Which browser are you using? (if relevant)
Chrome 110.0.5481.77
### How are you deploying your application? (if relevant)
npm run dev | https://github.com/vercel/next.js/issues/46349 | https://github.com/vercel/next.js/pull/46398 | 821c251a6173ed61f9d0066586648602e9cead92 | ebed7396f53363d23441e0b6b4e7432d7cf6eb0b | "2023-02-24T09:26:10Z" | javascript | "2023-02-25T15:50:51Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,347 | ["packages/next/src/client/components/layout-router.tsx", "packages/next/src/server/app-render/app-render.tsx", "test/e2e/app-dir/app-css/app/ordering/index.css", "test/e2e/app-dir/app-css/app/ordering/input.css", "test/e2e/app-dir/app-css/app/ordering/input.js", "test/e2e/app-dir/app-css/app/ordering/layout.js", "test/e2e/app-dir/app-css/app/ordering/page.js", "test/e2e/app-dir/app-css/index.test.ts"] | [NEXT-656] SCSS rules disappear in 13.2.1 | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:04:44 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8103
Binaries:
Node: 19.6.0
npm: 9.4.0
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.2.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://github.com/opensanctions/site/tree/main/styles
### To Reproduce
Try to apply a module-based SCSS rule to an element using `className={styles.foo}`.
### Describe the Bug
When upgrading from Next 13.1.1 to 13.2.1 it seems that module-based SCSS rules stopped being generated in some way - the style of the elements reverts to the default styles specified in my global CSS file.
### Expected Behavior
Being able to use `className={styles.foo}` to apply SCSS classes to an element.
### Which browser are you using? (if relevant)
Chrome evergreen
### How are you deploying your application? (if relevant)
Vercel
<sub>[NEXT-656](https://linear.app/vercel/issue/NEXT-656/scss-rules-disappear-in-1321)</sub> | https://github.com/vercel/next.js/issues/46347 | https://github.com/vercel/next.js/pull/48244 | 3ac76585152c1cd50b29eafaa2cd1acebc576946 | 2a61253f72e629816b989acadf088e0e2ff5bd9c | "2023-02-24T08:09:07Z" | javascript | "2023-04-17T12:11:47Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,320 | ["packages/next/src/build/webpack/plugins/next-types-plugin.ts", "test/integration/app-types/src/app/layout.tsx"] | [NEXT-627] Type imports from next package break with `typedRoutes: true` | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
next: 13.2.0
eslint-config-next: 13.2.0
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-rlge1y?file=app/page.tsx
### To Reproduce
Create new project with app directory, add `typedRoutes: true` to `next.config.js`, import a type from `next` package (e.g. new `Metadata`) and then try to build the app with `next build`
### Describe the Bug
Above error produces `Type error: Module '"next"' has no exported member 'Metadata'` error

### Expected Behavior
`import type { Metadata } from 'next';` should not break the app
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-627](https://linear.app/vercel/issue/NEXT-627/type-imports-from-next-package-break-with-typedroutes-true)</sub> | https://github.com/vercel/next.js/issues/46320 | https://github.com/vercel/next.js/pull/46332 | 8d83d85e5359146bbbd0f96ea2f8490e7d6bc9cd | 9df7df137f86ec595bae60550030a69a5f27bb90 | "2023-02-23T20:52:22Z" | javascript | "2023-02-24T02:58:43Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,288 | ["packages/create-next-app/templates/app/js/jsconfig.json", "packages/create-next-app/templates/app/ts/tsconfig.json", "packages/create-next-app/templates/default/js/jsconfig.json", "packages/create-next-app/templates/default/ts/tsconfig.json"] | baseUrl in create-next-app causes local files to shadow npm packages in TypeScript | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```
tomb@Thomass-MacBook-Pro-2 abcef % npx --no-install next info
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000
Binaries:
Node: 16.15.1
npm: 8.19.3
Yarn: 1.22.19
pnpm: 6.11.0
Relevant packages:
next: 13.1.7-canary.27
eslint-config-next: 13.1.6
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
TypeScript
### Link to the code that reproduces this issue
https://github.com/thomasballinger/next-typescript-module-resolution-repro
### To Reproduce
This is a bug with a behavior specific to `create-next-app`, so the repro is not based on `reproduction-template`.
To reproduce the issue clone the repo, install dependencies, and open pages/index.tsx in VSCode or run `npx tsc` in the directory. Notice that TypeScript uses the wrong types for `underscore`.
---
Or to repro the issue from scratch, run
```
$ yarn create next-app --ts --eslint --no-src-dir --no-experimental-app --use-npm --import-alias '@/*' repro
$ cd repro
$ npm install underscore @types/underscore
$ echo 'export const fileInThisRep = true' > underscore.ts
$ echo 'import _ from "underscore";' >> pages/index.tsx
$ echo 'console.log(_.each)' >> pages/index.tsx
$ npx tsc
```
TypeScript reports that
```
pages/index.tsx:124:8 - error TS1192: Module '"/Users/tomb/abcef/underscore"' has no default export.
124 import _ from "underscore";
```
### Describe the Bug
TypeScript (but not runtime) module resolution prefers local files to node modules, behavior that differs from runtime. This makes VSCode and `npx tsc` show errors when a file with the same name as an imported package exists while the package is imported.
Once underscore and @types/underscore have been installed and a `underscore.ts` file exists at the root of the project, importing
```js
import _ from 'underscore'
```
will show types for `./underscore.ts` instead of the npm package [underscore](https://www.npmjs.com/package/underscore).
### Expected Behavior
Runtime module resolution and TypeScript module resolution should match. I think the less surprising behavior is to check node_modules first, then local files, at both run time and type time.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/46288 | https://github.com/vercel/next.js/pull/46458 | 792c26d87dca92b7770c9d82787ee3155dbade2b | 474b115e6d903394d58a51eef97ffa4f2ae2ce70 | "2023-02-23T06:15:01Z" | javascript | "2023-02-27T20:16:04Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,260 | ["packages/next/src/build/utils.ts"] | [NEXT-615] Build output has wrong bundle sizes | Shown bundle sizes are wrong when running `next build` with the app directory enabled.
In a simple project I get something like this:
```
Route (app) Size First Load JS
┌ ○ / 0 B 0 B
└ ○ /a 5.64 kB 73.2 kB
+ First Load JS shared by all 67.6 kB
├ chunks/251-79dfcbe5b2c1029c.js 65.8 kB
├ chunks/main-app-8dd4300b6f120ec6.js 205 B
└ chunks/webpack-8074fabf81ca3fbd.js 1.61 kB
```
<sub>From [SyncLinear.com](https://synclinear.com) | [NEXT-615](https://linear.app/vercel/issue/NEXT-615/build-output-has-wrong-bundle-sizes)</sub> | https://github.com/vercel/next.js/issues/46260 | https://github.com/vercel/next.js/pull/46314 | cf8ca960c408c53e3cad29798d55266077ff1bc7 | 4eb34ef3e4f145f4e0687c457044b9e5beb2db80 | "2023-02-22T18:28:32Z" | javascript | "2023-02-23T19:29:22Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,257 | ["packages/next/src/build/webpack/loaders/next-app-loader.ts", "packages/next/src/client/components/navigation.ts", "packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts", "packages/next/src/server/app-render/create-flight-router-state-from-loader-tree.ts", "packages/next/src/server/app-render/index.tsx", "packages/next/src/server/dev/on-demand-entry-handler.ts", "test/e2e/app-dir/app/app/navigation/searchparams/page.js"] | [NEXT-698] Not-found stuck unaffected by changing search params | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Thu Jan 5 20:49:43 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T8103
Binaries:
Node: 16.18.0
npm: 8.19.2
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 13.1.6
eslint-config-next: 13.1.6
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Routing (next/router, next/navigation, next/link)
### Link to the code that reproduces this issue
https://github.com/akhdefault/not-found-repro
### To Reproduce
Start the app (dev or prod); go to /items; click the button to toggle search params; observe not-found output stuck once notFound was called; reload the page with no search params to see the correct result
### Describe the Bug
In this repro, an API endpoint returns an array of items if search params are not present and an empty array if they are.
A page reads search params and adds them to the API request if present; when getting an empty array of items (with search params), the page calls notFound. Removing params by pushing to router an href without them does not change the output of the page even though the data does not satisfy the condition for calling notFound.
### Expected Behavior
Initial navigation to /items - see items on the page; click 'Add search params' - see 'not found'; click 'Remove search params' - see items rendered on the page.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-698](https://linear.app/vercel/issue/NEXT-698/not-found-stuck-unaffected-by-changing-search-params)</sub> | https://github.com/vercel/next.js/issues/46257 | https://github.com/vercel/next.js/pull/47312 | afd7a50a7780a56c2ebe1e3dea77d79054bf72f1 | 8a4e8059ede3b5fbce05a734f8b72f68ece21245 | "2023-02-22T18:07:36Z" | javascript | "2023-03-20T18:57:29Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,152 | ["packages/next/src/lib/metadata/resolve-metadata.test.ts", "packages/next/src/lib/metadata/resolvers/resolve-opengraph.ts"] | Nextjs 13 - OpenGraph metadata images type definition mismatch with implementation | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64
Binaries:
Node: 16.16.0
npm: 8.11.0
Yarn: 1.22.18
pnpm: 7.24.3
Relevant packages:
next: 13.1.7-canary.21
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Metadata (metadata, generateMetadata, next/head, head.js), TypeScript
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-kc2ejf?file=app/layout.tsx
### To Reproduce
open link and run `npx next dev` in the terminal, you will see
```
Unhandled Runtime Error
Error: contents.map is not a function
```
### Describe the Bug
OpenGraph metadata images type definition mismatch with implementation.
definition:
```typescript
declare type OpenGraphMetadata = {
determiner?: 'a' | 'an' | 'the' | 'auto' | '';
title?: string | TemplateString;
description?: string;
emails?: string | Array<string>;
phoneNumbers?: string | Array<string>;
faxNumbers?: string | Array<string>;
siteName?: string;
locale?: Locale;
alternateLocale?: Locale | Array<Locale>;
// images could be OGImage and Array<OGImage> here
images?: OGImage | Array<OGImage>;
audio?: OGAudio | Array<OGAudio>;
videos?: OGVideo | Array<OGVideo>;
url?: string | URL;
countryName?: string;
ttl?: number;
};
```
implementation:
```tsx
<MultiMeta propertyPrefix="og:image" contents={openGraph.images} />
export function MultiMeta({
propertyPrefix,
namePrefix,
contents,
}: {
propertyPrefix?: string
namePrefix?: string
contents?: MultiMetaContent | null
}) {...}
// MultiMetaContent must be an array
type MultiMetaContent =
| (ExtendMetaContent | string | URL | number)[]
| null
| undefined
```
### Expected Behavior
should fix type definition or make implementation same as type definition.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/46152 | https://github.com/vercel/next.js/pull/46154 | 80c4766d2c16ca37cbf915512075273cbf4f610b | 5cb69259e6f7e1c14303d39fac3d6d62b0b52f8e | "2023-02-20T12:53:14Z" | javascript | "2023-02-20T15:22:12Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,141 | ["errors/deopted-into-client-rendering.md", "errors/manifest.json", "packages/next/src/server/app-render/index.tsx"] | [NEXT-589] Add warning when whole page is de-opted into client-side rendering | Example: when using useSearchParams
ctx: [https://vercel.slack.com/archives/C03KAR5DCKC/p1676879683515529?thread_ts=1676878373.528499&cid=C03KAR5DCKC](https://vercel.slack.com/archives/C03KAR5DCKC/p1676879683515529?thread_ts=1676878373.528499&cid=C03KAR5DCKC)
<sub>From [SyncLinear.com](https://synclinear.com) | [NEXT-589](https://linear.app/vercel/issue/NEXT-589/add-warning-when-whole-page-is-de-opted-into-client-side-rendering)</sub> | https://github.com/vercel/next.js/issues/46141 | https://github.com/vercel/next.js/pull/47531 | 956c562886e64c3e05705924655bc4ca4889a3a7 | 29d7a265df53e2c73bd11ae3c7103dc953504bf2 | "2023-02-20T08:53:25Z" | javascript | "2023-03-27T02:52:30Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,091 | ["packages/next/src/build/webpack/plugins/flight-manifest-plugin.ts", "test/e2e/app-dir/app-css/app/css/css-external/page.js", "test/e2e/app-dir/app-css/index.test.ts"] | appDir: css module not loaded in production in latest canary version | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Mon Jan 30 17:03:34 UTC 2
Binaries:
Node: 19.5.0
npm: 9.4.0
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 13.1.7-canary.16
eslint-config-next: 13.1.6
react: 18.3.0-next-3d615fc14-20220919
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://github.com/Pnlvfx/bbabystyle/tree/5accfc9c6f5ec8f4bd49eb3e2896e93e4166ad57
### To Reproduce
I've not a reproduction actually, but I hope some developer will take a look at this issue!
### Describe the Bug
When using next build and next start with the latest canary version (13.1.7-canary.20) but starting from 13.1.7-canary.18 there seems to be a problem when loading a CSS module like import style from '../abcde.module.css', I verified that is still present in the latest version, but if I step back top [email protected] it works fine!
### Expected Behavior
I expect to see the css loaded but it happens only when using next dev!
### Which browser are you using? (if relevant)
chrome
### How are you deploying your application? (if relevant)
vercel | https://github.com/vercel/next.js/issues/46091 | https://github.com/vercel/next.js/pull/46200 | d0e17ba39dafa7af42392e38811dadb1f2e6b044 | 7af4308b116a73d80b5f211d597262460ec6b4f8 | "2023-02-18T11:54:23Z" | javascript | "2023-02-21T23:02:48Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,027 | ["packages/next/src/lib/metadata/resolve-metadata.ts"] | Stray console.log (override) during build / run | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 22.3.0: Thu Jan 5 20:53:49 PST 2023; root:xnu-8792.81.2~2/RELEASE_X86_64
Binaries:
Node: 18.12.1
npm: 8.19.2
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.1.7-canary.17
eslint-config-next: 13.1.6
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Metadata (metadata, generateMetadata, next/head, head.js)
### Link to the code that reproduces this issue
N/A
### To Reproduce
Supply custom openGraph metadata to a page and then build.
### Describe the Bug
The console shows repeated `override` messages logged to stdout.
### Expected Behavior
Message should not be displayed.
### Which browser are you using? (if relevant)
N/A
### How are you deploying your application? (if relevant)
N/A | https://github.com/vercel/next.js/issues/46027 | https://github.com/vercel/next.js/pull/46025 | 22e28ff9c6620268567f4420bdb6c40c14255757 | fa5db9baebb1df4f89ec9cfae3a5a7178c4b5caf | "2023-02-17T08:10:13Z" | javascript | "2023-02-17T09:55:37Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 46,019 | ["packages/next/src/client/image.tsx", "packages/next/src/client/legacy/image.tsx", "test/unit/next-image-new.test.ts"] | [NEXT-623] `next/image` does not load lazily when dynamically generated in Safari. | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000
Binaries:
Node: 18.13.0
npm: 8.19.3
Yarn: 1.22.19
pnpm: 7.27.0
Relevant packages:
next: 13.1.7-canary.16
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
Image optimization (next/image, next/legacy/image)
### Link to the code that reproduces this issue
https://github.com/meotimdihia/nextjs-bugs
### To Reproduce
Open https://nextjs-safari-caching-bug.vercel.app/lazyload in Safari 16.2 on Mac or iOS.
### Describe the Bug
I can't explain this issue well. But please take a look at this problem.
Safari loaded every image in the world.
https://nextjs-safari-caching-bug.vercel.app/lazyload
<img width="1809" alt="image" src="https://user-images.githubusercontent.com/300961/219489385-53ebade3-3c05-4750-aad7-93c86afcc455.png">
But in this link, it works fine in this link:
https://nextjs-safari-caching-bug.vercel.app/static/test.html
Though `next/legacy/image` is fine.
### Expected Behavior
....
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-623](https://linear.app/vercel/issue/NEXT-623/nextimage-does-not-load-lazily-when-dynamically-generated-in-safari)</sub> | https://github.com/vercel/next.js/issues/46019 | https://github.com/vercel/next.js/pull/46306 | 5dee445ef92cad039d0f778d7db6e7f1471ed752 | 604b0129c38c0204683d2db9408cc5ce5ff35bdd | "2023-02-16T21:40:32Z" | javascript | "2023-02-23T16:44:07Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,916 | ["docs/basic-features/font-optimization.md"] | [NEXT-555] Docs: Missing example for importing a Google Font with a space in the font title | ### What is the improvement or update you wish to see?
[The Next.js documentation on importing Google Fonts](https://nextjs.org/docs/basic-features/font-optimization#google-fonts) shows this recommended method of importing Google fonts:
```js
import { Inter } from '@next/font/google'
const inter = Inter({ subsets: ['latin'] })
export default function MyComponent() {
return (
<main className={inter.className}>
Lorem ipsum dolar set amut
</main>
)
}
```
This method works for the `Inter` font and other fonts with single word titles. I'm trying to import a font called [Redacted Script](https://fonts.google.com/specimen/Redacted+Script) which has a space in the title.
I tried just TitleCasing it:
```js
import { RedactedScript } from '@next/font/google'
const redactedScript = RedactedScript({ subsets: ['latin'] })
export default function MyComponent() {
return (
<main className={redactedScript.className}>
Lorem ipsum dolar set amut
</main>
)
}
```
However this code gives me the error:
```
`@next/font` error:
Unknown font `RedactedScript`
```
This font is defined in [font-data.json](https://github.com/vercel/next.js/blob/canary/packages/font/src/google/font-data.json#L9983) with a key that includes a space (`Redacted Script`) as are several other multi-word fonts, I just can't figure out how to import a module with a space in the title.
I also tried:
```js
import fonts from "@next/font/google";
const RedactedScript = fonts["RedactedScript"];
```
but that code throws the error `Font loaders must be called and assigned to a const in the module scope`.
I need to see an example in the documentation of how to import Google Fonts with a space in their title.
### Is there any context that might help us understand?
I don't think any additional context is needed.
### Does the docs page already exist? Please link to it.
https://nextjs.org/docs/basic-features/font-optimization#google-fonts
<sub>[NEXT-555](https://linear.app/vercel/issue/NEXT-555/docs-missing-example-for-importing-a-google-font-with-a-space-in-the)</sub> | https://github.com/vercel/next.js/issues/45916 | https://github.com/vercel/next.js/pull/46348 | 18232f6e757753994e29481163a971245d482ff7 | 3997b502796c94a56e6192b3ba7e1d611d4fb8dd | "2023-02-14T17:39:50Z" | javascript | "2023-02-24T19:25:34Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,884 | ["packages/create-next-app/templates/index.ts", "test/integration/create-next-app/templates.test.ts"] | [NEXT-543] tsconfig import alias duplication when creating new app without default. | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Thu Jan 5 20:48:54 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T6000
Binaries:
Node: 18.14.0
npm: 9.3.1
Yarn: N/A
pnpm: 7.27.0
Relevant packages:
next: 13.1.7-canary.11
eslint-config-next: 13.1.6
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
CLI (create-next-app)
### Link to the code that reproduces this issue
not-relevant
### To Reproduce
The line to focus on is the `import alias` one.
<img width="1145" alt="Screenshot 2023-02-14 at 10 56 32 AM" src="https://user-images.githubusercontent.com/57995897/218647282-fdc7f42b-e68c-4b6b-a5cc-b1fd985ffb56.png">
### Describe the Bug
The key in the `paths` is now `@/something/something/*` which should have been `@/something/*`
```json
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"baseUrl": ".",
"paths": {
"@/something/something/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
```
### Expected Behavior
The path should be `@something/*` not `@/something/something/*`
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-543](https://linear.app/vercel/issue/NEXT-543/tsconfig-import-alias-duplication-when-creating-new-app-without)</sub> | https://github.com/vercel/next.js/issues/45884 | https://github.com/vercel/next.js/pull/46184 | 3615ede70327981933d951aa15917902b152e285 | 16aa8e9b7e5c46a31c49ef8d1adc0e7352b1392c | "2023-02-14T05:32:25Z" | javascript | "2023-02-22T00:45:32Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,883 | ["packages/next/src/shared/lib/router/utils/app-paths.test.ts", "packages/next/src/shared/lib/router/utils/app-paths.ts"] | [NEXT-541] Search params are concatenated to request pathname in RSC request. | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Thu Jan 5 20:50:36 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T6020
Binaries:
Node: 19.5.0
npm: 9.3.1
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 13.1.7-canary.11
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Middleware / Edge (API routes, runtime)
### Link to the code that reproduces this issue
https://github.com/jjantschulev/nextjs-bug-broken-search-params-rsc
### To Reproduce
I noticed that when making a request to a page with a query string, the query string is concatenated to the request pathname when examined from middleware.
Ie:
1. use `router.replace()` in a client component to update the query params to `/path/?value=123`
2. middleware logs the `request.url` as '/pathvalue=123`. The trailing slash and the question mark is missing.
- Both `req.url` and `req.nextUrl.href` have this same issue.
- This issue does NOT occur in dev mode or in a local build (`yarn build` and `yarn start`). It only occurs when deployed to Vercel.
- This issue occurs only if the `RSC` header is sent in the request. If the `RSC` header is not sent, the request url is correct in the middleware.
- Hence we can observe the incorrect request url in the middleware by running `curl -v "https://nextjs-bug-broken-search-params-rsc.vercel.app/path/?value=123" -H "RSC: 1"`.
- This will result in the incorrect pathname of `/pathvalue=123` in the middleware.
- And `req.nextUrl.search` will be empty.
- However if we run `curl -v "https://nextjs-bug-broken-search-params-rsc.vercel.app/path/?value=123"`, the request url is correct in the middleware.
- This will result in the correct pathname of `/path/` in the middleware.
- And `req.nextUrl.search` will be `?value=123`.
- To Aid in debugging I "return" the values of `req.url`, `req.nextUrl.href`, `req.nextUrl.pathname`, and `req.nextUrl.search` in the middleware by setting response headers such as `x-request-url`.
To see this issue live, visit [this vercel deployment](https://nextjs-bug-broken-search-params-rsc.vercel.app/path/)
The important files are:
- `middleware.tsx`
- `app/path/page.tsx`
This seems like a major bug in handling of URLs and search params in RSC requests. I hope we can resolve this quickly. Please let me know if you need any more information.
### Describe the Bug
When running middleware on a request with the `RSC` header set to `1`, the url received in the middleware is incorrect in the following way:
The search params are directly appended to the end of the pathname without neither a trailing slash nor a `?` to separate the query params.
EG: The middleware receives `/pathvalue=123` instead of the expected `/path/?value=123`
### Expected Behavior
The url received in the middleware in both `req.url`, `req.nextUrl.pathname` and `req.nextUrl.href` should not be missing the `/?`. They should return `/path/?value=123` and NOT `/pathvalue=123`.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
Vercel
<sub>[NEXT-541](https://linear.app/vercel/issue/NEXT-541/search-params-are-concatenated-to-request-pathname-in-rsc-request)</sub> | https://github.com/vercel/next.js/issues/45883 | https://github.com/vercel/next.js/pull/46043 | c16e28715f1b0234d7786f6e64ff02bfd9ec9c6a | 465f9846a05720facfb2014f821cab3bb2e7672c | "2023-02-14T04:30:50Z" | javascript | "2023-02-17T15:32:13Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,850 | ["packages/next/src/build/index.ts", "test/e2e/app-dir/app-static/app-static.test.ts"] | [NEXT-610] NextJS pre-renders dynamic segment route even if `generateStaticParams` is not provided | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.6.0: Sat Jun 18 17:05:47 PDT 2022; root:xnu-8020.140.41~1/RELEASE_ARM64_T8101
Binaries:
Node: 16.14.0
npm: 8.5.0
Yarn: 1.22.19
pnpm: 6.11.0
Relevant packages:
next: 13.1.7-canary.10
eslint-config-next: 13.1.6
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-3twfnt?file=app/posts/[slug]/page.tsx
### To Reproduce
1. Open the code to reproduce: https://stackblitz.com/edit/vercel-next-js-3twfnt?file=app/posts/[slug]/page.tsx
2. Run `yarn build`
3. The build will when trying to pre-render the `app/posts/[slug]/page.tsx` page.
The idea is to have a dynamic segment route like /posts/[slug] without the `generateStaticParams` function.
### Describe the Bug
When nextJS builds the project, it tries to pre-render the `posts/[slug]/page.tsx` with the invalid value for the `[slug]` parameter that is `"[slug]"` string.
### Expected Behavior
If there is no `generateStaticParams` provided, the pre-rendering should not happen.
Missing `generateStaticParams` is a clear indication that SSR is expected.
Documentation also does not say anything about this behaviour.
Just like with Nextjs.12 providing the `getStaticPaths()` was only required if we wanted to pre-render any of the dynamic routes, the `generateStaticParams()` in NextJs.13 should be optional and if we don't provide it, there should be no pre-rendering and the rendering should default to dynamic.
### Which browser are you using? (if relevant)
irrelevant
### How are you deploying your application? (if relevant)
irrelevant
<sub>[NEXT-610](https://linear.app/vercel/issue/NEXT-610/nextjs-pre-renders-dynamic-segment-route-even-if-generatestaticparams)</sub> | https://github.com/vercel/next.js/issues/45850 | https://github.com/vercel/next.js/pull/46265 | 001e6cab52237a286d310262eac53ab32f44ca39 | ff05d9b7b51cb803d75ba75bf22209db12babafd | "2023-02-13T12:13:45Z" | javascript | "2023-02-22T22:59:19Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,827 | ["packages/next/src/build/webpack/plugins/wellknown-errors-plugin/getModuleTrace.ts", "packages/next/src/build/webpack/plugins/wellknown-errors-plugin/parseNextInvalidImportError.ts", "packages/next/src/build/webpack/plugins/wellknown-errors-plugin/parseRSC.ts", "test/development/acceptance-app/invalid-imports.test.ts", "test/development/acceptance-app/rsc-build-errors.test.ts", "test/development/acceptance/server-component-compiler-errors-in-pages.test.ts"] | [NEXT-523] Docs: Make error for ReactServerComponentError more actionable | ### What is the improvement or update you wish to see?
Currently I get this error when using client only stuff in server component:
```
./node_modules/.pnpm/@[email protected]_rji2cnntvinamdkduhjj7n4ma4/node_modules/@floating-ui/react-dom-interactions/dist/floating-ui.react-dom-interactions.mjs
ReactServerComponentsError:
You're importing a component that needs flushSync. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.
,-[/home/pearman/dev/jankaifer/referator/node_modules/.pnpm/@[email protected]_rji2cnntvinamdkduhjj7n4ma4/node_modules/@floating-ui/react-dom-interactions/dist/floating-ui.react-dom-interactions.mjs:2:1]
2 | export * from '@floating-ui/react-dom';
3 | import * as React from 'react';
4 | import { useLayoutEffect, useEffect, useRef } from 'react';
5 | import { createPortal, flushSync } from 'react-dom';
: ^^^^^^^^^
6 | import { hideOthers } from 'aria-hidden';
7 |
8 | var index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;
`----
Maybe one of these should be marked as a client entry with "use client":
node_modules/.pnpm/@[email protected]_rji2cnntvinamdkduhjj7n4ma4/node_modules/@floating-ui/react-dom-interactions/dist/floating-ui.react-dom-interactions.mjs
node_modules/.pnpm/@[email protected]_x7erng6ffbvsidbmpns4v6lrhe/node_modules/@mantine/core/cjs/Popover/use-popover.js
node_modules/.pnpm/@[email protected]_x7erng6ffbvsidbmpns4v6lrhe/node_modules/@mantine/core/cjs/Popover/Popover.js
node_modules/.pnpm/@[email protected]_x7erng6ffbvsidbmpns4v6lrhe/node_modules/@mantine/core/cjs/index.js
app/page.tsx
```
The crucial information is
```
You're importing a component that needs flushSync. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.
```
And `app/page.tsx`.
Maybe we could hide stuff in `node_modules` and just show user-defined files. Or maybe adding empty new-line before `app/page.tsx` would be enough.
It just wasn't clear at the first sight what should I do.
### Is there any context that might help us understand?
nope
### Does the docs page already exist? Please link to it.
*No response*
<sub>From [SyncLinear.com](https://synclinear.com) | [NEXT-523](https://linear.app/vercel/issue/NEXT-523/docs-make-error-for-reactservercomponenterror-more-actionable)</sub> | https://github.com/vercel/next.js/issues/45827 | https://github.com/vercel/next.js/pull/46953 | 09d21d6e998cfd122a6e90e63f2e25a179fab80b | 9a41ba9ac4c6be2e90130f924933c093a9746005 | "2023-02-12T09:40:42Z" | javascript | "2023-03-09T20:27:57Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,824 | ["packages/next/src/lib/metadata/resolvers/resolve-basics.ts", "packages/next/src/lib/metadata/resolvers/resolve-url.ts", "packages/next/src/lib/metadata/types/alternative-urls-types.ts", "test/e2e/app-dir/metadata/app/alternate/page.tsx", "test/e2e/app-dir/metadata/metadata.test.ts"] | Error: missing metadataBase | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: Ubuntu 20.04.0 LTS Sun Feb 12 2023 09:39:20 GMT+0100 (Central European Standard Time)
Binaries:
Node: 16.14.2
npm: 7.17.0
Yarn: 1.22.19
pnpm: 7.13.6
Relevant packages:
next: 13.1.7-canary.10
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Metadata (metadata, generateMetadata, next/head, head.js)
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-dsf3tr
### To Reproduce
Define a relative canonical URL (`metadata.alternates.canonical`) on a page without specifying `metadataBase` in that same page.
### Describe the Bug
If a relative canonical URL is specified in the metadata of a page, an error is generated during build:
```
Error: missing metadataBase
```
This occurs even if the `metadataBase` is included in the `metadata` exported from a parent layout.
This issue does not happen in `13.1.7-canary.7` and starts with `13.1.7-canary.8`.
### Expected Behavior
A relative URL should be allowed for a canonical URL without the `metadataBase` being specified anywhere in the metadata export hierarchy.
But if the `metadataBase` is specified in a parent metadata export (e.g. a layout) then it should be respected and used.
### Which browser are you using? (if relevant)
N/A
### How are you deploying your application? (if relevant)
next run build | https://github.com/vercel/next.js/issues/45824 | https://github.com/vercel/next.js/pull/46584 | 5532b6a93fe1d64c999ba3201cb10cd49315e8f6 | b5f92c444b24c746093ca1be21020c659eeebf01 | "2023-02-12T08:46:13Z" | javascript | "2023-03-01T00:17:08Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,756 | ["packages/next/src/build/webpack-config.ts", "packages/next/src/client/components/bailout-to-client-rendering.ts", "packages/next/src/client/on-recoverable-error.ts", "packages/next/src/export/worker.ts", "packages/next/src/server/app-render.tsx", "packages/next/src/shared/lib/app-dynamic.tsx", "packages/next/src/shared/lib/lazy-dynamic/dynamic-no-ssr.tsx", "packages/next/src/shared/lib/lazy-dynamic/loadable.tsx", "packages/next/src/shared/lib/lazy-dynamic/no-ssr-error.ts", "packages/next/taskfile.js"] | [NEXT-518] Bundler throws error when bundles a third-partry lib that uses next/dynamic | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```yaml
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Thu Jan 5 20:48:54 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T6000
Binaries:
Node: 19.5.0
npm: 9.3.1
Yarn: 1.22.19
pnpm: 7.26.0
Relevant packages:
next: 13.1.7-canary.8
eslint-config-next: 13.1.6
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
Dynamic imports (next/dynamic)
### Link to the code that reproduces this issue
https://github.com/jianliao/nextjs-bundler-bug
### To Reproduce
```
$ npm i
$ npm run build
```
### Describe the Bug
Below error only throws when using the latest canary. [email protected] works fine.
```
> npm run build
> [email protected] build
> next build
warn - You have enabled experimental feature (appDir) in next.config.js.
warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
info - Thank you for testing `appDir` please leave your feedback at https://nextjs.link/app-feedback
info - Creating an optimized production build
info - Compiled successfully
info - Linting and checking validity of types
info - Collecting page data
[ ] info - Generating static pages (0/3)TypeError: next_dynamic__WEBPACK_IMPORTED_MODULE_0__ is not a function
at 9294 (/Users/jianliao/Work/git/nextjs-next-dynamic-bug/.next/server/chunks/544.js:5559:18)
at __webpack_require__ (/Users/jianliao/Work/git/nextjs-next-dynamic-bug/.next/server/webpack-runtime.js:25:43)
at 7989 (/Users/jianliao/Work/git/nextjs-next-dynamic-bug/.next/server/app/page.js:360:12)
at __webpack_require__ (/Users/jianliao/Work/git/nextjs-next-dynamic-bug/.next/server/webpack-runtime.js:25:43)
at /Users/jianliao/Work/git/nextjs-next-dynamic-bug/node_modules/next/dist/compiled/react-server-dom-webpack/client.js:915:337
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
TypeError: next_dynamic__WEBPACK_IMPORTED_MODULE_0__ is not a function
at 9294 (/Users/jianliao/Work/git/nextjs-next-dynamic-bug/.next/server/chunks/544.js:5559:18)
at __webpack_require__ (/Users/jianliao/Work/git/nextjs-next-dynamic-bug/.next/server/webpack-runtime.js:25:43)
at 7989 (/Users/jianliao/Work/git/nextjs-next-dynamic-bug/.next/server/app/page.js:360:12)
at __webpack_require__ (/Users/jianliao/Work/git/nextjs-next-dynamic-bug/.next/server/webpack-runtime.js:25:43)
at /Users/jianliao/Work/git/nextjs-next-dynamic-bug/node_modules/next/dist/compiled/react-server-dom-webpack/client.js:915:337
info - Generating static pages (3/3)
> Build error occurred
Error: Export encountered errors on following paths:
/page: /
at /Users/jianliao/Work/git/nextjs-next-dynamic-bug/node_modules/next/dist/export/index.js:417:19
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Span.traceAsyncFn (/Users/jianliao/Work/git/nextjs-next-dynamic-bug/node_modules/next/dist/trace/trace.js:79:20)
at async /Users/jianliao/Work/git/nextjs-next-dynamic-bug/node_modules/next/dist/build/index.js:1268:21
at async Span.traceAsyncFn (/Users/jianliao/Work/git/nextjs-next-dynamic-bug/node_modules/next/dist/trace/trace.js:79:20)
at async /Users/jianliao/Work/git/nextjs-next-dynamic-bug/node_modules/next/dist/build/index.js:1127:17
at async Span.traceAsyncFn (/Users/jianliao/Work/git/nextjs-next-dynamic-bug/node_modules/next/dist/trace/trace.js:79:20)
at async Object.build [as default] (/Users/jianliao/Work/git/nextjs-next-dynamic-bug/node_modules/next/dist/build/index.js:69:29)
```
The code that causes the error is in [app/page.tsx](https://github.com/jianliao/nextjs-bundler-bug/blob/ae02053df7309302e01478531217ff7c89b41566/app/page.tsx#L6). Line 7 is the same local component that uses `next/dynamic` and it works fine. But the `SpButton` that comes from a third-party library will fail the build.
### Expected Behavior
No error and build success.
### Which browser are you using? (if relevant)
N/A
### How are you deploying your application? (if relevant)
N/A
<sub>[NEXT-518](https://linear.app/vercel/issue/NEXT-518/bundler-throws-error-when-bundles-a-third-partry-lib-that-uses)</sub> | https://github.com/vercel/next.js/issues/45756 | https://github.com/vercel/next.js/pull/45781 | ac7f2b6fe77ba403bb3f668b6ef8a9c4cb28c784 | ee624b7706c92935c4a1e30a3fb69391d1a6377d | "2023-02-09T17:04:28Z" | javascript | "2023-02-10T21:30:05Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,748 | ["packages/next-mdx/index.js"] | [NEXT-515] support `mdx-components.tsx` in `./src` directory | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #66-Ubuntu SMP Fri Jan 20 14:29:49 UTC 2023
Binaries:
Node: 16.17.0
npm: 8.19.3
Yarn: 1.22.19
pnpm: 7.27.0
Relevant packages:
next: 13.1.7-canary.8
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://github.com/belgattitude/next-mdx-rs-reproduction
### To Reproduce
clone https://github.com/belgattitude/next-mdx-rs-reproduction run `npm install` and `npm run dev`
### Describe the Bug
Tried to setup the experimental mdx-rs and run into an issue if the `mdx-components.tsx` is located in the `.src/` folder.
It works if the file is in the project root directory.

### Expected Behavior
`.src/mdx-components.tsx` should work.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-515](https://linear.app/vercel/issue/NEXT-515/[mdx-rs]-mdx-componentstsx-not-working-when-in-src-directory)</sub> | https://github.com/vercel/next.js/issues/45748 | https://github.com/vercel/next.js/pull/46763 | 8d9b0b111f4c38c670d6e2fd00b1a0a603ad4136 | 745efd2812f6fec4b317b1c3c395e9ce34bc3825 | "2023-02-09T15:24:52Z" | javascript | "2023-03-05T00:46:27Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,697 | ["packages/next/src/server/lib/start-server.ts", "packages/next/src/server/lib/utils.ts", "packages/next/src/server/lib/worker-utils.ts"] | [NEXT-517] Breakpoint not getting hit in VSCode with Next.js debugger config | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 16.14.2
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.1.7-canary.7
eslint-config-next: 13.1.6
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
https://github.com/InfiniteLearner/debug_error_next_reproduction
### To Reproduce
!!!!!!!!!!!!!!!!!!!!! You should be using node v 16.14.2 !!!!!!!!!!!!!!!!!!!!
(Because of other constraints I can not update my node version so this is not an option)
Create a new next.js app
```npx create-next-app@latest```
Use every default options
Add a new config for debugging in vsCode (.vscode/launch.json):
```
{
"version": "0.2.0",
"configurations": [
{
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev"
},
{
"name": "Next.js: debug client-side",
"type": "chrome",
"request": "launch",
"url": "http://localhost:3000"
},
{
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "npm run dev",
"serverReadyAction": {
"pattern": "started server on .+, url: (https?://.+)",
"uriFormat": "%s",
"action": "debugWithChrome"
}
}
]
}
```
Create a new async function in index.tsx and call it (with an onClick for example):
```
async function greeting(){
console.log("Hello");
console.log("Goodbye");
}
...
<p onClick={greeting}></p>
...
```
Add a new breakpoint in the function.

Run in debug mode (either server-side, client-side or fullstack).
### Describe the Bug
On click of the element, the logs will be displayed without being stop.
The breakpoints are not getting hit.

It should be noted that breakpoints on the returned component are working fine but none in functions.
So if you had a breakpoint on your div (or any other component) it will stop.
### Expected Behavior
The breakpoints should get hit and the logs not be displayed.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-517](https://linear.app/vercel/issue/NEXT-517/breakpoint-not-getting-hit-in-vscode-with-nextjs-debugger-config)</sub> | https://github.com/vercel/next.js/issues/45697 | https://github.com/vercel/next.js/pull/51467 | cb7be1912f9544dd6fb97a929211b71dd0aece31 | 70aad4a2b5b34fbbae006c477f96c54118da6381 | "2023-02-08T10:54:59Z" | javascript | "2023-06-25T22:31:09Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,677 | ["packages/next/src/client/components/app-router.tsx", "test/e2e/app-dir/app-prefetch/app/layout.js", "test/e2e/app-dir/app-prefetch/prefetching.test.ts"] | app dir does not disable prefetching for bots | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000
Binaries:
Node: 18.14.0
npm: 9.4.0
Yarn: 1.22.19
pnpm: 7.26.3
Relevant packages:
next: 13.1.6
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Routing (next/router, next/navigation, next/link)
### Link to the code that reproduces this issue
https://github.com/sdorra/next-bot-prefetch-issue
### To Reproduce
Clone, build and start the sample repository:
```bash
git clone https://github.com/sdorra/next-bot-prefetch-issue
pnpm install
pnpm run build
pnpm run start
```
Open the landing page (http://localhost:3000) with a modified User-Agent e.g.: `Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +http://www.google.com/bot.html) Chrome/W.X.Y.Z Safari/537.36` ([Google Crawlers](https://developers.google.com/search/docs/crawling-indexing/overview-google-crawlers?hl=de)). The User-Agent can be modified with a browser extension e.g.: [user-agent-switcher](https://chrome.google.com/webstore/detail/user-agent-switcher/kchfmpdcejfkipopnolndinkeoipnoia?hl=en-US).
Open the developer tools, reload the page with disable cache and look for fetch requests for /one and /two.
### Describe the Bug
Prefetching of URL's referenced by the `href` prop of the `Link` component should be disabled if the client (User-Agent) is a bot. This works fine with the pages directory, but it seems to be broken within the app directory.
The error can also be observed on my productive site (https://sdorra.dev), then you can save the local cloning and building. I first noticed the error on this page in Google Search Console. The console shows a request for each linked article on the landing page.
### Expected Behavior
No link should be prefetched for a search bot.
### Which browser are you using? (if relevant)
Chrome 109.0.5414.119
### How are you deploying your application? (if relevant)
vercel | https://github.com/vercel/next.js/issues/45677 | https://github.com/vercel/next.js/pull/45678 | 6444006f231c148bcee146624d4bc8ae3ec7adfd | 01649d93ab1858bac499962e25da0c22b6dc72c1 | "2023-02-07T20:24:58Z" | javascript | "2023-02-07T22:15:10Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,651 | ["packages/next/src/build/webpack/plugins/flight-client-entry-plugin.ts", "packages/next/src/server/dev/hot-reloader.ts", "packages/next/src/server/dev/on-demand-entry-handler.ts", "test/e2e/app-dir/similar-pages-paths/similar-pages-paths.test.ts"] | [NEXT-472] appdir causes `pages/page.tsx` throws 404 in dev and 500 in prod | reproduction: [https://github.com/JanKaifer/next-repro-45651.git](https://github.com/JanKaifer/next-repro-45651.git)
visit: [http://localhost:3000/page](http://localhost:3000/page)
* [X] It will throw 404 in dev
* [X] It will throw 500 in production when loading
To reproduce it in `dev` first navigate to `/` load it and then navigate to `/page`.
(navigating to `/page` first and then to `/` also reproduces the issue)
<sub>From [SyncLinear.com](https://synclinear.com) | [NEXT-472](https://linear.app/vercel/issue/NEXT-472/appdir-causes-pagespagetsx-throws-404-in-dev-and-500-in-prod)</sub> | https://github.com/vercel/next.js/issues/45651 | https://github.com/vercel/next.js/pull/46832 | abf7da32a47d0bb19af34db05e28d8ad8346ef9b | 030fd1d6842b945a661ad8d1ef34756399330797 | "2023-02-07T09:54:06Z" | javascript | "2023-03-07T20:27:10Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,603 | ["test/e2e/app-dir/app-static/app-static.test.ts", "test/e2e/app-dir/app-static/app/force-dynamic-catch-all/[slug]/[[...id]]/page.js"] | [NEXT-640] force-dynamic broken for catch-all routes | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.1.0: Sun Oct 9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000
Binaries:
Node: 16.17.0
npm: 8.15.0
Yarn: 1.22.19
pnpm: 7.13.1
Relevant packages:
next: 13.1.7-canary.5
eslint-config-next: 13.1.7-canary.5
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-7xai7h?file=app%2F[variant]%2F(shop)%2Fp%2F[[...id]]%2Fpage.tsx
### To Reproduce
The page is explicitly set as dynamic so it can fetch data on server side
When running the app, the following error is thrown
```
Error: Page changed from static to dynamic at runtime /test/p
see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error
```
This page shouldn't be marked as static since
```
export const dynamic = 'force-dynamic';
```
Dynamic params is also not respected, giving 404 on random routes /test/p/random
```
export const dynamicParams = true;
```
The problem happens even without the `[variant]` segment in the repro, but kept it there to make sure it matches our current working environment
### Describe the Bug
Nextjs incorrectly marks a `force-dynamic` page as `static` causing runtime error
This seems to have been introduced in `13.1.3`
### Expected Behavior
The page should be dynamic, fetch should work
Probably related to #45068 #44860
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-640](https://linear.app/vercel/issue/NEXT-640/force-dynamic-broken-for-catch-all-routes)</sub> | https://github.com/vercel/next.js/issues/45603 | https://github.com/vercel/next.js/pull/47418 | 9791d1e60853b408c0eb1d19a43ee01614797db3 | 38cddd902bde742af2a27cdbc3dd1884e1ea5301 | "2023-02-06T06:59:23Z" | javascript | "2023-03-23T14:53:51Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,595 | ["packages/next-swc/crates/next-core/js/src/entry/app-renderer.tsx", "packages/next-swc/crates/next-dev-tests/tests/integration/next/app/rsc-NEXT-657/input/next.config.js", "packages/next-swc/crates/next-dev-tests/tests/integration/next/app/rsc-NEXT-657/input/src/app/app/page.jsx", "packages/next-swc/crates/next-dev-tests/tests/integration/next/app/rsc-NEXT-657/input/src/app/layout.jsx", "packages/next-swc/crates/next-dev-tests/tests/integration/next/app/rsc-NEXT-657/input/src/app/page.jsx", "packages/next-swc/crates/next-dev-tests/tests/integration/next/app/rsc-NEXT-657/input/src/pages/page.jsx"] | [NEXT-657] When going back from a page that doesn't exist, it downloads a file | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
**Operating System:**
Platform: linux
Arch: x64
Version: #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023
**Binaries:**
Node: 18.13.0
npm: 8.19.3
Yarn: N/A
pnpm: N/A
**Relevant packages:**
next: 13.1.7-canary.5
eslint-config-next: 13.1.6
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Routing (next/router, next/navigation, next/link), Turbopack (--turbo)
### Link to the code that reproduces this issue
https://github.com/Dragonaere/wyvern/tree/bug
### To Reproduce
Create a link using `next/link` that leads to a route with just a folder, no `page.js` file. Click the link and try using the back button. It should download a file called `download`. A route that doesn't exist at all works as expected, as does a route with
### Describe the Bug
When you have a folder in the `app/` directory but no `page.js`, `layout.js`, etc, when hitting the back arrow after going to that route, instead of going back, it downloads a file called `download` which contains this: `J0:[["children","",["",{}],null,null]]`. If you go to a route that doesn't exist at all, the back arrow works as expected.
### Expected Behavior
It should just go back to the previous page
### Which browser are you using? (if relevant)
Chromium 109.0.5414.119
### How are you deploying your application? (if relevant)
next dev --turbo
<sub>[NEXT-657](https://linear.app/vercel/issue/NEXT-657/when-going-back-from-a-page-that-doesnt-exist-it-downloads-a-file)</sub> | https://github.com/vercel/next.js/issues/45595 | https://github.com/vercel/next.js/pull/47946 | e3e22f5beded84a342d7a8cc7dd1a98ebdf1b041 | fde065b94a2e78c918009ffd89be26e627aac031 | "2023-02-05T22:16:38Z" | javascript | "2023-04-05T21:08:11Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,587 | ["packages/next/src/client/components/navigation.ts"] | App Directory: globalThis is not defined under Chome 71 version | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:04:44 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8103
Binaries:
Node: 16.19.0
npm: 8.19.3
Yarn: 1.22.18
pnpm: 7.21.0
Relevant packages:
next: 13.1.7-canary.5
eslint-config-next: 13.1.7-canary.5
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://github.com/CrazydduGi/nextjs-app-directory-global-this-reproduction
### To Reproduce
In order to reproduce the bug is just fallow below steps
1. clone reproducion link code
2. yarn build
3. yarn start
4. connect http://localhost:3000 with Chrome which versions is under 71
5. open inspector and then see the console error and javascript stops
<img width="471" alt="Screenshot 2023-02-06 at 2 08 58 AM" src="https://user-images.githubusercontent.com/3412104/216833661-b1ccce69-3c91-49a1-93f1-623dc10a7f6b.png">
### Describe the Bug
According to Nextjs documentation ([Link](https://nextjs.org/docs/basic-features/supported-browsers-features))
Nextjs is support Chrome 64+, however `globalThis` is not supported yet until Chrome 71 version so that `globalThis` is not defined in lower version between 64 and 71
### Expected Behavior
console error does not occur for globalThis access
### Which browser are you using? (if relevant)
Chrome 70
### How are you deploying your application? (if relevant)
next build && next start | https://github.com/vercel/next.js/issues/45587 | https://github.com/vercel/next.js/pull/45589 | 45d57323493e11fa30810d37a4bfee9a785077fe | cb7409a6ca4cfa08349a1621d93def146c075ce5 | "2023-02-05T17:12:43Z" | javascript | "2023-02-06T00:21:46Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,508 | ["packages/next/src/lib/worker.ts"] | Hight number of processes of /next/dist/compiled/jest-worker/processChild.js still alive after next build | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Thu Jan 5 20:48:54 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T6000
Binaries:
Node: 18.13.0
npm: 8.19.3
Yarn: 1.22.19
pnpm: 7.26.2
Relevant packages:
next: 12.0.9
react: 17.0.2
react-dom: 17.0.2
### Which area(s) of Next.js are affected? (leave empty if unsure)
CLI (create-next-app)
### Link to the code that reproduces this issue
https://github.com/vercel/next.js/files/10565355/reproduce.zip
### To Reproduce
[reproduce.zip](https://github.com/vercel/next.js/files/10565355/reproduce.zip)
<img width="1492" alt="image" src="https://user-images.githubusercontent.com/3240259/216242566-6f87ae6e-e369-405f-9fca-e525e051797d.png">
This problem can reproduce above [email protected], but 12.0.8 was all right.
Or remove `getInitialProps` in `_app.tsx ` was all right above [email protected].
```ts
// GlobalApp.getInitialProps = async function getInitialProps(appContext) {
// const appProps = await App.getInitialProps(appContext);
// return {
// ...appProps,
// };
// };
```
### Describe the Bug
Hight number of processes of /next/dist/compiled/jest-worker/processChild.js still alive after next build
### Expected Behavior
Kill all child processes.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-1348](https://linear.app/vercel/issue/NEXT-1348/hight-number-of-processes-of-nextdistcompiledjest-workerprocesschildjs)</sub> | https://github.com/vercel/next.js/issues/45508 | https://github.com/vercel/next.js/pull/54500 | f2766b979baa1dd7f03719e9529a3ff28c7ca5cd | eca06a56b25ee151d9bbf7c1b0c6c4e74aefa604 | "2023-02-02T05:55:49Z" | javascript | "2023-08-26T21:28:46Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,485 | ["packages/next/src/build/webpack-config.ts", "packages/next/src/client/components/react-dev-overlay/hot-reloader-client.tsx", "packages/next/src/client/dev/error-overlay/format-webpack-messages.ts"] | appDir: Module resolution error when using a RSC | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.3.0: Thu Jan 5 20:48:54 PST 2023; root:xnu-8792.81.2~2/RELEASE_ARM64_T6000
Binaries:
Node: 16.19.0
npm: 8.19.3
Yarn: 1.22.19
pnpm: 7.26.0
Relevant packages:
next: 13.1.7-canary.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://github.com/kasvith/next13-remirror-react-renderer-error.git
### To Reproduce
- Run the project
- Visit [http://localhost:3000](http://localhost:3000)
### Describe the Bug
I want to render React Nodes with React Remirror Renderer(it doesn't load the Editor and produces React Nodes from a given JSON, similar to how MDX works)
So i wanted to use it as a Server Component,
This gives me a weird error like
```
error - ./node_modules/@remirror/core-utils/dist/remirror-core-utils.js
Attempted import error: 'includes' is not exported from '@remirror/core-helpers' (imported as 'includes').
Import trace for requested module:
./node_modules/@remirror/core-utils/dist/remirror-core-utils.js
./node_modules/@remirror/core/dist/remirror-core.js
./node_modules/@remirror/preset-react/dist/remirror-preset-react.js
./node_modules/@remirror/react/dist/remirror-react.js
./src/app/page.tsx
```
But the `includes` from `@remirror/core-helpers` is already an exported member.
If i switch to `use client`, it works fine and renders content
### Expected Behavior
To provide a better error or solve this if can
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/45485 | https://github.com/vercel/next.js/pull/45971 | 903e74be115f75f5535258b28b129f010ef31900 | ade72643c1c51ccbce44b4743f3cdc847f461485 | "2023-02-01T15:25:56Z" | javascript | "2023-02-16T18:16:25Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,481 | ["packages/next/src/server/lib/mock-request.ts", "packages/next/src/server/send-payload/revalidate-headers.ts", "run-tests.js", "test/e2e/prerender.test.ts", "test/e2e/prerender/pages/ssr.js"] | On-Demand revalidation fails with "res.hasHeader is not a function" when cookies() is used (/app directory) | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000
Binaries:
Node: 18.12.1
npm: 9.2.0
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 13.1.7-canary.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://github.com/patshologram/revalidation-error
### To Reproduce
- start the added code via ` yarn build && yarn start -- -p 3001 `
- open http://localhost:3001/api/revalidate
- revalidation fails
```
TypeError: res.hasHeader is not a function
at Object.setRevalidateHeaders (/Users/martonpa/Sources/my-app/node_modules/next/dist/server/send-payload/revalidate-headers.js:8:37)
at Object.sendRenderResult (/Users/martonpa/Sources/my-app/node_modules/next/dist/server/send-payload/index.js:62:33)
at NextNodeServer.sendRenderResult (/Users/martonpa/Sources/my-app/node_modules/next/dist/server/next-server.js:394:34)
at NextNodeServer.pipe (/Users/martonpa/Sources/my-app/node_modules/next/dist/server/base-server.js:419:25)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.fn (/Users/martonpa/Sources/my-app/node_modules/next/dist/server/next-server.js:759:21)
at async Router.execute (/Users/martonpa/Sources/my-app/node_modules/next/dist/server/router.js:253:36)
at async NextNodeServer.run (/Users/martonpa/Sources/my-app/node_modules/next/dist/server/base-server.js:384:29)
at async NextNodeServer.handleRequest (/Users/martonpa/Sources/my-app/node_modules/next/dist/server/base-server.js:322:20)
```
### Describe the Bug
Using [cookies](https://beta.nextjs.org/docs/api-reference/cookies) within a server component breaks the on-demand revalidation.
### Expected Behavior
On-demand revalidation should work for pages using `next/headers` functions.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/45481 | https://github.com/vercel/next.js/pull/45681 | e36fb42e30e7b69f6484275df960bc91ab81ee86 | 434a8cb7d0764993b8cb39fe1ec520eb667de703 | "2023-02-01T13:14:46Z" | javascript | "2023-02-08T01:51:26Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,469 | ["packages/next/src/client/components/static-generation-async-storage.ts", "packages/next/src/client/components/static-generation-bailout.ts", "packages/next/src/server/app-render.tsx", "test/development/acceptance-app/dynamic-error.test.ts"] | [NEXT-440] If the page is `dynamic = 'error'` we should be showing the error message in development | If the page is `dynamic = 'error'` we should be showing the error message in development
_Originally posted by @ijjk in https://github.com/vercel/next.js/pull/45432#discussion_r1092174061_
<sub>[NEXT-440](https://linear.app/vercel/issue/NEXT-440/if-the-page-is-dynamic-=-error-we-should-be-showing-the-error-message)</sub> | https://github.com/vercel/next.js/issues/45469 | https://github.com/vercel/next.js/pull/45893 | ddccab7536e8efd8d52ba9fc34124a6d2dcf267e | 714720ffa9d6659c1bc67d1ed53628b8ac81f167 | "2023-02-01T08:39:02Z" | javascript | "2023-02-27T11:20:23Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,393 | ["packages/next/src/lib/load-custom-routes.ts", "packages/next/src/server/server-route-utils.ts", "test/e2e/middleware-trailing-slash/app/pages/html-links.js", "test/e2e/middleware-trailing-slash/app/pages/product/[...product-params].tsx", "test/e2e/middleware-trailing-slash/test/index.test.ts", "test/integration/custom-routes/next.config.js", "test/integration/custom-routes/test/index.test.js", "test/lib/next-modes/base.ts"] | Page params not passed properly when using Next/Link in very specific circumstance | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 22.3.0: Thu Jan 5 20:53:49 PST 2023; root:xnu-8792.81.2~2/RELEASE_X86_64
Binaries:
Node: 16.19.0
npm: 8.19.3
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.1.6
eslint-config-next: 13.1.6
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
Data fetching (gS(S)P, getInitialProps), Middleware / Edge (API routes, runtime)
### Link to the code that reproduces this issue
https://github.com/kshehadeh/next-link-bug-example
### To Reproduce
Run the sample app above and navigate to the http://localhost:3000. There are two links - "Works" and "Does not work". When you click on the "Does not work" you will be taken to a page where the page params are not being passed to the component properly.
### Describe the Bug
This is a demonstration of a bug with NextJS 13:
**When**
1. middleware is used
2. trailingSlash config is set to `true`
3. Using next/link to link to a [...params] file that uses getServerSideProps and ends with `.html`
**Result**
Page params are not passed to component properly.
**IMPORTANT**
This only happen with local non-prod development
### Expected Behavior
I would expect that params get sent to the component properly in a local dev environment with trailingSlash set to true, middleware enabled and a path that ends in `.html`
### Which browser are you using? (if relevant)
Chrome
### How are you deploying your application? (if relevant)
Vercel | https://github.com/vercel/next.js/issues/45393 | https://github.com/vercel/next.js/pull/45417 | 9e290f9f15744c19e9e2581c995404ca5255b77b | d3a9f5a54aa9ad4638dbc96f165eb922ac48f529 | "2023-01-30T00:41:26Z" | javascript | "2023-01-30T20:10:30Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,301 | ["packages/next/src/server/base-server.ts"] | Missing cache control directive for server side props response when using middleware and prefetch | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000
Binaries:
Node: 16.19.0
npm: 9.4.0
Yarn: 1.22.19
pnpm: 7.26.0
Relevant packages:
next: 13.1.6-canary.1
eslint-config-next: 13.1.5
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
Data fetching (gS(S)P, getInitialProps)
### Link to the code that reproduces this issue
https://github.com/muntamala/nextjs-no-cache-issue
### To Reproduce
Run the server in production mode
```
yarn
yarn build
yarn start
```
and navigate to http://localhost:3000/. Observer the network for example with chrome developer tools. When loading the
static home page the app also prefetches the ssr pages json. What the response for the SSR page json is missing is
cache-control no-cache directive. Navigating to the ssr page results in the ssr pages json being re-fetched and this time
it does include the no-cache directive but if there would be a caching element in between like a CDN then we would not hit
the actual api until the empty cached response expires.
### Describe the Bug
Prefetch of data for SSR pages returning empty object without a cache-control header having no-cache directive. This can potentially cause issues with CDNs as it did in our case. For example CloudFront having a default TTL value of higher than 0, which by default is 24h, would result in the CDN caching the empty response. The empty cached response would then be served by the CDN when user navigates to the SSR page and the page tries to fetch server side props using the same URL (.../ssr.json)
The enabler for this behaviour seems to be using a middleware. If a middleware (middleware.ts) is present then the
prefetch for pages is done separately for each page whose path is present on the page via Link component (prefetch true).
### Expected Behavior
I'd expect next.js to behave sensibly in terms of cache control and set no-cache directive for getServerSideProps as
stated in next.js documentation:
```
If the page uses getServerSideProps or getInitialProps, it will use the default Cache-Control header set by next start
in order to prevent accidental caching of responses that cannot be cached. If you want a different cache behavior while
using getServerSideProps, use res.setHeader('Cache-Control', 'value_you_prefer') inside of the function as shown above.
```
### Which browser are you using? (if relevant)
Google Chrome 109.0.5414.119 (Official Build) (arm64)
### How are you deploying your application? (if relevant)
yarn build, yarn start | https://github.com/vercel/next.js/issues/45301 | https://github.com/vercel/next.js/pull/54732 | fc48fc8c4cbb718646f1c3cb89de5af87f392567 | 20d05958ff853e9c9e42139ffec294336881c648 | "2023-01-26T13:09:16Z" | javascript | "2023-08-29T20:18:25Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,190 | ["packages/next/src/shared/lib/router/router.ts"] | The next/link component may generate links crashing the page (offline mode, SSR) | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #22 SMP Tue Jan 10 18:39:00 UTC 2023
Binaries:
Node: 16.17.0
npm: 8.15.0
Yarn: 1.22.19
pnpm: 7.1.0
Relevant packages:
next: 13.1.5-canary.2
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
Routing (next/router, next/navigation, next/link)
### Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/nextjs-next-link-srr-offline-x5recn
### To Reproduce
1. Use Firefox browser
2. Go to "about" page
3. Switch your browser to "offline mode"
4. Go to "home" page
### Describe the Bug
The bug occurs in the following context:
- A minimal production site based on your [progessive web app example](https://github.com/vercel/next.js/tree/canary/examples/progressive-web-app).
- Click on a link generated by the `next/link` component.
- The target link gets props from SSR
- The json related to the target link is not saved in the storage cache
In offline mode, when the browser tries to fetch the related JSON, a network error occurs and Next.js **only** handles the `typeError` "Failed to fetch" message and runs `window.reload()` as a fallback.
Only Chrome browser is satisfied because:
✔️ Chrome returns the "Failed to fetch" typeError message.
❌ Firefox returns "NetworkError when attempting to fetch resource."
❌ Safari returns "Load failed".
### Expected Behavior
Next.js handles all the browser TypeError message.
I made this following PR https://github.com/vercel/next.js/pull/44929
### Which browser are you using? (if relevant)
Firefox 108.0.2
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/45190 | https://github.com/vercel/next.js/pull/44929 | 57ba24e39a1376bce763a6af3768dbec220997e8 | d45df25de6029e4fa6d24342c37ed62a3f86a867 | "2023-01-23T17:15:50Z" | javascript | "2023-01-26T22:20:20Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,189 | ["test/e2e/edge-pages-support/edge-document.test.ts", "test/e2e/edge-pages-support/index.test.ts"] | Watchpack Error (initial scan): Error: ENOTDIR: not a directory, scandir '/root/InfinityBotList/Infinity-Next/node_modules/next/dist/pages/_document.js' | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Watchpack Error (initial scan): Error: ENOTDIR: not a directory, scandir '/root/InfinityBotList/Infinity-Next/node_modules/next/dist/pages/_document.js' in edge routes with a custom document
export const config = {
runtime: 'experimental-edge',
}
custom document:
import Document, { Html, Head, Main, NextScript } from 'next/document'
class MyDocument extends Document {
render() {
return (
<Html>
<Head>
</Head>
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
}
export default MyDocument
### Which area(s) of Next.js are affected? (leave empty if unsure)
Head component/file (next/head / head.js), Middleware / Edge (API routes, runtime)
### Link to the code that reproduces this issue
.
### To Reproduce
1. Make a route with experimental-edge and a custom _document.tsx, the error will then appear and the custom document will not be rendered
### Describe the Bug
1. Make a route with experimental-edge and a custom _document.tsx, the error will then appear and the custom document will not be rendered
### Expected Behavior
The server runs properly with custom document
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
next dev and next start
<sub>[NEXT-1396](https://linear.app/vercel/issue/NEXT-1396/watchpack-error-initial-scan-error-enotdir-not-a-directory-scandir)</sub> | https://github.com/vercel/next.js/issues/45189 | https://github.com/vercel/next.js/pull/54316 | 0e91c79f57bf36c51d7f3dc3e8e29da1a5cda66e | 70231ef7cd35b143ef6dcff023f3798ed8e51130 | "2023-01-23T16:24:44Z" | javascript | "2023-08-21T20:56:46Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,161 | ["packages/create-next-app/templates/index.ts"] | [NEXT-455] Trying to start a project with create-next-app and an import alias causes "EMFILE: too many open files..." | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Windows 10
git bash terminal
### Which area(s) of Next.js are affected? (leave empty if unsure)
CLI (create-next-app)
### Link to the code that reproduces this issue
no link because the problem is with CNA
### To Reproduce
try and create a project with an alias
for example `npx create-next-app@latest my-project3 --typescript --eslint`
select yes for src and no for app dir and input an alias
### Describe the Bug

Causes an error on install
`Aborting installation.
Unexpected error. Please report it as a bug:
[Error: EMFILE: too many open files, open 'C:\Users\Will\Programming\my-project3\node_modules\next\dist\compiled\raw-body\index.js'] {
errno: -4066,
code: 'EMFILE',
syscall: 'open',
path: 'C:\\Users\\Will\\Programming\\my-project3\\node_modules\\next\\dist\\compiled\\raw-body\\index.js'
}`
No alias works

### Expected Behavior
should be able to give an alias
### Which browser are you using? (if relevant)
none
### How are you deploying your application? (if relevant)
local host
<sub>[NEXT-455](https://linear.app/vercel/issue/NEXT-455/trying-to-start-a-project-with-create-next-app-and-an-import-alias)</sub> | https://github.com/vercel/next.js/issues/45161 | https://github.com/vercel/next.js/pull/45760 | bb9bb64864dc4ed609030d6b0a94bd5b53873b06 | 0f48a6f0748e4154d07e2c17e39d0c5ed4a15a94 | "2023-01-23T00:12:24Z" | javascript | "2023-02-09T18:29:56Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,151 | ["packages/next/src/shared/lib/loadable.tsx", "test/development/basic/next-dynamic.test.ts"] | `next/dynamic` SSR is broken when not using a custom `Document`, or using a `Document` with `getInitialProps` | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000
Binaries:
Node: 18.12.0
npm: 8.19.2
Yarn: N/A
pnpm: 7.12.2
Relevant packages:
next: 13.1.5-canary.2
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
Dynamic imports (next/dynamic)
### Link to the code that reproduces this issue
https://github.com/sebpettersson/next-dynamic-bug
### To Reproduce
Import a component with `next/dynamic`, build the project and then check the rendered markup.
<img width="457" alt="next-dynamic-bug" src="https://user-images.githubusercontent.com/1528383/213930157-2c846c54-5c2c-4339-83eb-14ec5bcaab54.png">
https://next-dynamic-bug.vercel.app/
### Describe the Bug
When using a component imported with `next/dynamic`, the markup will contain `<template>` instead of correct SSR content.
**NOTE:** If JavaScript is enabled it is easy to miss this bug since the `<template>` will be switched out for the correct content.
---
**Additional findings**
1. This bug was introduced in 13.0.7.
2. If a custom `Document` is used the, markup is rendered correctly - provided it is a functional component that _doesn't_ use `getInitialProps`. If it is a `class` that extends `Document` from `next/document`, or a functional component that uses `getInitialProps`, the bug is still triggered.
3. In `dev` mode, the bug is only triggered the first time the page is loaded. On subsequent page loads the correct markup is output.
### Expected Behavior
That server side rendered content contains the correct markup when using components imported with `next/dynamic`.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/45151 | https://github.com/vercel/next.js/pull/45160 | e33e46d9508baeb3e4c6cc244a4a2269003cf20e | e6ff749aeec6a12364d7de0ab2c611c061741c5a | "2023-01-22T17:34:39Z" | javascript | "2023-01-23T22:13:37Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,145 | ["docs/testing.md"] | Docs: test file name in Cypress Manual setup cannot be read by Cypress | ### What is the improvement or update you wish to see?
The test file name in [Cypress Manual Setup](https://nextjs.org/docs/testing#creating-your-first-cypress-integration-test) should be changed from `cypress/integration/app.spec.js` to `cypress/e2e/app.cy.js`, otherwise the file won't appear in the Cypress' specs page.
### Is there any context that might help us understand?
I tried to follow the [testing manual setup guide](https://nextjs.org/docs/testing#manual-setup). After I added the test file and tried to run `npm run cypress` and open Cypress' GUI, I didn't see any spec file. I looked at the [with-cypress example](https://github.com/vercel/next.js/tree/canary/examples/with-cypress) and changed my file structure to match it, then it worked.
### Does the docs page already exist? Please link to it.
https://nextjs.org/docs/testing#creating-your-first-cypress-integration-test | https://github.com/vercel/next.js/issues/45145 | https://github.com/vercel/next.js/pull/45146 | f931a636e130cbeaf4f1913ada65b5a7968513cc | 095a3c4b27ce9f620244368478073d826eae4821 | "2023-01-22T12:26:16Z" | javascript | "2023-01-23T21:37:56Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,122 | ["packages/next/src/cli/next-dev.ts", "packages/next/src/server/lib/start-server.ts"] | [NEXT-447] [13.0.7+] Issues caused by "temporary" clusterization on development environment | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
**Operating System:**
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000
**Binaries:**
Node: 16.17.0
npm: 8.15.0
Yarn: 1.22.19
pnpm: 7.25.1
**Relevant packages:**
next: 13.1.4-canary.1
eslint-config-next: 13.1.2
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
CLI (create-next-app)
### Link to the code that reproduces this issue
https://codesandbox.io/s/bold-waterfall-xg2qog?file=/pages/api/bug.ts
### To Reproduce
Run the app and access `/api/bug.ts` in 2 different ways.
1. Just let it run by default (`yarn dev`)
2. Run with the env variable `__NEXT_DISABLE_MEMORY_WATCHER` set to something truthy (or `yarn dev:nocluster`)
### Describe the Bug
Since v13.0.7 (or more specifically, since #43958) if the app is started using the `next dev` command, the server by default will do some kind of process orchestrating to stop and resurrect the process if it exceeds an amount of used memory.
The issue is that the use of `cluster.fork()` is a breaking change for some projects as they may depend on the value of `cluster` properties such as `cluster.isMaster` (or `cluster.isPrimary`).
I noticed that issue because `log4js` wasn't logging in development environment and was working fine on production builds. Initially I thought that it was actually some kind of problem with `stdout` routing between the child processes and the main one, but actually I noticed that `log4js` depends on `cluster` properties to listen to log events and work fine even if you are clustering your app (e.g using PM2). But actually `log4js` wasn't actually performing `process.stdout.write` because the "main" process (in the case, an API route) wasn't actually the master process.
Turns out that disabling that behavior either from log4js using the `disableClustering` parameter or using the `__NEXT_DISABLE_MEMORY_WATCHER` env variable the problem disappears (in the first case because it will assume you aren't using clusters and consider that it should always write into `stdout`, and in the second case due to disabling the next-dev clusterization).
It was hard to find the cause of issue, but luckily I have other project using next + log4js and I tested some versions and found it. Shouldn't it be better documented or even this "temporary solution" removed?
### Expected Behavior
The app should work as a main process (master/primary).
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-447](https://linear.app/vercel/issue/NEXT-447/[1307]-issues-caused-by-temporary-clusterization-on-development)</sub> | https://github.com/vercel/next.js/issues/45122 | https://github.com/vercel/next.js/pull/45745 | 484f4724f4f635f023b1db644f0544bda8bb96b9 | be5fd6cee00311c9b76c6d67c382989fc3efba31 | "2023-01-20T23:42:11Z" | javascript | "2023-02-10T10:20:50Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,072 | ["docs/api-reference/next/link.md"] | Docs: broken example for middleware rewrites on link reference | ### What is the improvement or update you wish to see?
The example should work, currently is throwing an error related to https://nextjs.org/docs/messages/middleware-relative-urls. We need to pass an absolute url, not a relative one.
### Is there any context that might help us understand?
Error being thrown: https://nextjs.org/docs/messages/middleware-relative-urls.
### Does the docs page already exist? Please link to it.
https://nextjs.org/docs/api-reference/next/link | https://github.com/vercel/next.js/issues/45072 | https://github.com/vercel/next.js/pull/45073 | 919a71186e5d75d42f3499774599fa92722177f7 | 55f3a6d8fb4e55a45115da150fdb8aca0bb72cce | "2023-01-20T02:26:40Z" | javascript | "2023-01-20T03:23:30Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,052 | ["packages/next/src/build/webpack/config/blocks/css/index.ts"] | Global SCSS not working | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
inversion less than 13 it was working , but after updating next.js to ^13.0 it is failing to build in dev mode.
```
import '../styles.scss';
export default function App({ Component, pageProps }) {
return <Component {...pageProps} />;
}
```
error for next.js 13
```
unhandledRejection: Error: Cannot find module 'D:\nextjs\node_modules\next\dist\compiled\sass-loader/fibers.js'
.
.
.
.
code: 'MODULE_NOT_FOUND'
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
Script optimization (next/script)
### Link to the code that reproduces this issue
yarn run dev
### To Reproduce
change version from 12 to 13 ..it is failing to run yarn run dev script
### Describe the Bug
Global SCSS not loading
### Expected Behavior
it should build if we are using next.js 13 and SASS package
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/45052 | https://github.com/vercel/next.js/pull/50185 | 0539b9c96e0e8d4a0ce1cd7a71b50fa5ed26cb43 | 6318d50a4a7387240fc1c3840619b520c4b2dfab | "2023-01-19T16:11:58Z" | javascript | "2023-05-30T22:24:08Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,026 | ["packages/next/src/build/webpack/loaders/next-app-loader.ts", "packages/next/src/client/components/navigation.ts", "packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts", "packages/next/src/server/app-render/create-flight-router-state-from-loader-tree.ts", "packages/next/src/server/app-render/index.tsx", "packages/next/src/server/dev/on-demand-entry-handler.ts", "test/e2e/app-dir/app/app/navigation/searchparams/page.js"] | [NEXT-685] Page navigation & caching with search params is broken in 13.1.2 production (work in dev) | ### Verify canary release
- [x] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:36:28 PST 2022; root:xnu-8019.80.24~21/RELEASE_ARM64_T6000
Binaries:
Node: 19.0.0
npm: 8.19.2
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 13.1.3-canary.5
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-phyu1x
### To Reproduce
in the terminal: `npm install && npx next build` then `npx next start`
In the browser:
1. Go to url `/1?page=1`
2. Click `next page` multiple times
### Describe the Bug
The first time the page `/1?page=1` is open, the server log will read `server page: 1` twice. Then if you click the link `next page`, the correct url `/1?page=2` is displayed in the address bar but the html page content remains on page 1. If you click again on `next page` nothing happens anymore. Besides even hard reloading the page (even with a different page param) will still serve the content of page 1 (the first ever called).
### Expected Behavior
When page `/1?page=1` is open, the server log shall read `server page: 1`.
Then on subsequent clicks `server page: 2`, `server page: 3`, etc. and the html content shall reflect that.
It is the case in 13.1.1 but not from 13.1.2 in production mode.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
next start
<sub>[NEXT-685](https://linear.app/vercel/issue/NEXT-685/page-navigation-and-caching-with-search-params-is-broken-in-1312)</sub> | https://github.com/vercel/next.js/issues/45026 | https://github.com/vercel/next.js/pull/47312 | afd7a50a7780a56c2ebe1e3dea77d79054bf72f1 | 8a4e8059ede3b5fbce05a734f8b72f68ece21245 | "2023-01-19T03:02:59Z" | javascript | "2023-03-20T18:57:29Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,024 | ["packages/next/src/pages/_document.tsx", "packages/next/src/shared/lib/html-context.ts"] | Unhelpful error when <Html> is used in page | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Given a page that contains `<Html>` imported from `"next/document"`, this runtime crash occurs:
```plaintext
TypeError: Cannot destructure property 'inAmpMode' of '(0 , _react).useContext(...)' as it is null.
```
Not a very helpful error. Folks who don't know they're not meant to use `next/document`'s `<Html>` in a page -such as those who don't have in-editor ESLint enabled and/or don't have the [`@next/next/no-document-import-in-page`](https://nextjs.org/docs/messages/no-document-import-in-page) rule enabled- could get very confused by this.
### Which area(s) of Next.js are affected? (leave empty if unsure)
Document component/file (next/document / document.js)
### Link to the code that reproduces this issue
https://github.com/JoshuaKGoldberg/repros/tree/nextjs-html-in-page
### To Reproduce
```shell
git clone -b nextjs-html-in-page https://github.com/JoshuaKGoldberg/repros
cd nextjs-html-in-page
pnpm install
pnpm dev
```
Then, visit localhost:3000
### Describe the Bug
If you render `<Html>` in a page, it will crash at runtime with an unusually unhelpful error:
```plaintext
error - TypeError: Cannot destructure property 'inAmpMode' of '(0 , _react).useContext(...)' as it is null.
at Html (webpack-internal:///./node_modules/.pnpm/[email protected]_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/pages/_document.js:678:13)
```
### Expected Behavior
Give a more informative error message. Maybe:
```plaintext
Error: <Html> should not be imported outside of pages/_document.
```
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/45024 | https://github.com/vercel/next.js/pull/45056 | d206c68ad715595aea211376342b48330af3af5e | 0bd9b4bbdff3c38bfa9c59d0c1e99d7003c94f9f | "2023-01-19T02:28:22Z" | javascript | "2023-06-28T22:40:35Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 45,006 | ["packages/next/src/build/utils.ts", "test/e2e/app-dir/app-static/app-static.test.ts", "test/e2e/app-dir/app-static/app/force-dynamic-no-prerender/[id]/page.js"] | [appdir] [next 13.1.2] build crashes because routes are prerendered with fake data in dynamic segments | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
$ /private/tmp/reproduction-app/node_modules/.bin/next info
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64
Binaries:
Node: 16.16.0
npm: 9.1.2
Yarn: 1.22.19
pnpm: 7.23.0
Relevant packages:
next: 13.1.3-canary.4
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
✨ Done in 2.42s.
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
https://github.com/raphaelbadia/nextjs-appdir-prerenders-weird
### To Reproduce
Hello,
I upgraded from next 13.0.6 to [email protected] yesterday and since then I cannot build anymore my project. Digging into the issue showed my that the pages with dynamic segments are now prerendered at build time with the dynamic segment name as a string.
To reproduce, simply clone and install my reproduction link, then run `yarn build`.
The build will fail.
### Describe the Bug
When building, next will try to render the page with the param as an argument. For instance, it will prerender `app/[todoId]/page.tsx` with the params `{todoId: "[todoId]"}`.
I tried using `export const dynamic = 'force-dynamic';` but it doesn't change anything.
### Expected Behavior
Like in 13.1.1, it shouldn't fail the build.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/45006 | https://github.com/vercel/next.js/pull/45015 | 04f26460da908e31afc0a445bce927709259fba5 | ad4820243246306a1a2ab9344557b13f43f4f4cd | "2023-01-18T14:52:36Z" | javascript | "2023-01-18T19:24:48Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,992 | ["packages/next/src/cli/next-dev.ts", "packages/next/src/telemetry/project-id.ts", "packages/next/src/telemetry/storage.ts"] | When closing `yarn dev` in VS Code, new console windows pop up | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
The module 'react' was not found. Next.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install react'
The module 'react-dom' was not found. Next.js requires that you include it in 'dependencies' of your 'package.json'. To add it, run 'npm install react-dom'
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 18.13.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.1.2
eslint-config-next: N/A
react: N/A
react-dom: N/A
warn - Latest canary version not detected, detected: "13.1.2", newest: "13.1.3-canary.4".
Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
See below
### To Reproduce
1. `npx create-next-app -e reproduction-template bug`
2. `code bug`
3. In the VSCode terminal, `yarn dev`
4. Wait for the server to start
5. Press ctrl + c
### Describe the Bug
### What happens
One (or more if 13.1.3-canary.4) console windows pop up and immediately close. The window contained [messages](https://user-images.githubusercontent.com/47689923/213086905-bddd5b8b-4fcc-489a-bd42-18e068c3e722.png).
### Why it matters
The console immediately closes, so the messages cannot be read. But mainly, the console popping up and immediately closing is indescribably disturbing for such a regular task.
### Expected Behavior
The process closes with all messages printed in the VS Code terminal with no external console window showing.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/44992 | https://github.com/vercel/next.js/pull/45022 | c50641f70987925984d96123de4ceceb3604a2a7 | 57fb41b880c86204e10bec2067d4e637580ce070 | "2023-01-18T04:53:46Z" | javascript | "2023-01-19T00:59:02Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,976 | ["packages/next/src/build/webpack/plugins/middleware-plugin.ts", "packages/next/src/telemetry/events/swc-load-failure.ts", "packages/next/src/trace/report/to-telemetry.ts", "packages/next/src/trace/shared.ts", "test/e2e/yarn-pnp/test/utils.ts", "test/e2e/yarn-pnp/test/with-eslint.test.ts", "test/e2e/yarn-pnp/test/with-mdx.test.ts", "test/e2e/yarn-pnp/test/with-next-sass.test.ts"] | `next dev` does not compile page as of Next 13.0.3-canary.4 | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Windows:
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 18.11.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.1.3-canary.2
eslint-config-next: N/A
react: 0.0.0-experimental-e7d0053e6-20220325
react-dom: 0.0.0-experimental-e7d0053e6-20220325
Linux:
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP Wed Nov 23 01:01:46 UTC 2022
Binaries:
Node: 18.12.1
npm: 8.19.2
Yarn: 3.2.1
pnpm: N/A
Relevant packages:
next: 13.1.3-canary.2
eslint-config-next: N/A
react: 0.0.0-experimental-e7d0053e6-20220325
react-dom: 0.0.0-experimental-e7d0053e6-20220325
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
https://github.com/replayio/devtools/tree/feature/FE-1124-next-13-upgrade
### To Reproduce
1. Clone the Replay.io DevTools repo at https://github.com/replayio/devtools
2. Check out branch `feature/FE-1124-next-13-upgrade`
3. Run `yarn` to install all deps
4. Run `yarn dev` to start the dev server
5. Browse to http://localhost:8080/recording/reduxts-csb-2--be1a4568-6c84-474c-a9eb-3a0491a792d8 , which will attempt to compile page `/recording/[[...id]]`
6. Observe that it does not finish compiling. There are no further progress updates.
Confirmed that this happens on both Windows and WSL Linux.
### Describe the Bug
The Replay.io DevTools repo is currently on Next 12.1, and still uses Babel to do our JS compilation, as we had seen issues with Next+SWC sourcemaps (previously filed as #39878 ).
I attempted to upgrade our repo to Next 13.1.2 to see if the sourcemap issues were resolved. After installing 13.1.2, `yarn build` succeeded with Next configured to use either Babel or SWC for JS compilation. (Repo uses Babel by default because we have a `.babelrc` file. Renaming that to `.babelrc.bak` switches to SWC.)
However, when I tried to run `yarn dev` and load a page, Next started compiling our `/recording/[[...id]]` page, and never progressed further.
I bisected Next releases and confirmed that this behavior started with Next 13.0.3-canary.4. `yarn dev` runs okay with 13.0.3-canary.3, but the same freezing happens with 13.0.3-canary.4.
Looking at https://github.com/vercel/next.js/releases/tag/v13.0.3-canary.4 , the potentially relevant PRs could likely be:
- #42741
- #42767
- #42733
### Expected Behavior
`yarn dev` would successfully compile the page as usual
### Which browser are you using? (if relevant)
Chrome 108, but not relevant
### How are you deploying your application? (if relevant)
Local dev | https://github.com/vercel/next.js/issues/44976 | https://github.com/vercel/next.js/pull/44986 | 6d09f0b80c6ce3e956733492a9c56bf1159f513b | 8f0acdf781dc69575c236fd6e785ae3e78c85808 | "2023-01-17T19:18:28Z" | javascript | "2023-01-18T00:00:22Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,875 | ["errors/app-static-to-dynamic-error.md", "errors/manifest.json", "packages/next/src/server/base-server.ts", "test/e2e/app-dir/app-static/app-static.test.ts", "test/e2e/app-dir/app-static/app/static-to-dynamic-error-forced/[id]/page.js", "test/e2e/app-dir/app-static/app/static-to-dynamic-error/[id]/page.js"] | Dynamic routes failing in 13.1.2 "Error: invariant: invalid Cache-Control duration provided: 0 < 1" | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.1.0: Sun Oct 9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000
Binaries:
Node: 18.12.1
npm: 8.19.2
Yarn: 1.22.19
pnpm: N/A
Relevant packages:
next: 13.1.3-canary.0
eslint-config-next: 13.0.5
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
https://github.com/DavidTParks/vamp
### To Reproduce
Clone the repository, run `npm run build` and try to navigate to a dynamic route. It will error out and throw in the terminal
```
Error: invariant: invalid Cache-Control duration provided: 0 < 1
```
### Describe the Bug
The bug seems to happen when navigating to a dynamic route. Occurs only in production, both locally building and on Vercel.
```
Error: invariant: invalid Cache-Control duration provided: 0 < 1
```
When trying to navigate via a next/link to a dynamic route.
### Expected Behavior
Route to the route without throwing
### Which browser are you using? (if relevant)
Chrome
### How are you deploying your application? (if relevant)
Vercel | https://github.com/vercel/next.js/issues/44875 | https://github.com/vercel/next.js/pull/44989 | cefb30b32bc05fcb46058a6e8b1ff545fb9ddf1d | 6b7c69fa4d773d76730272158e2fe7fed12e03aa | "2023-01-14T01:25:35Z" | javascript | "2023-01-18T18:24:35Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,860 | ["errors/app-static-to-dynamic-error.md", "errors/manifest.json", "packages/next/src/server/base-server.ts", "test/e2e/app-dir/app-static/app-static.test.ts", "test/e2e/app-dir/app-static/app/static-to-dynamic-error-forced/[id]/page.js", "test/e2e/app-dir/app-static/app/static-to-dynamic-error/[id]/page.js"] | Dynamic routing fails in production v.13.1.2 (Error: invariant: invalid Cache-Control duration provided: 0 < 1) | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101
Binaries:
Node: 16.17.1
npm: 8.15.0
Yarn: 1.22.11
pnpm: N/A
Relevant packages:
next: 13.1.2
eslint-config-next: 13.0.4
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
///
### To Reproduce
- Install v. 13.1.2
- Add dynamic route (e.g. [slug] folder)
- Build and run it in production mode
Returns the following error:
```
Error: invariant: invalid Cache-Control duration provided: 0 < 1
at Object.setRevalidateHeaders (/Users/lasse/Repos/aihelperbot.com/node_modules/next/dist/server/send-payload/revalidate-headers.js:13:19)
at Object.sendRenderResult (/Users/lasse/Repos/aihelperbot.com/node_modules/next/dist/server/send-payload/index.js:62:33)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: invariant: invalid Cache-Control duration provided: 0 < 1
at Object.setRevalidateHeaders (/Users/lasse/Repos/aihelperbot.com/node_modules/next/dist/server/send-payload/revalidate-headers.js:13:19)
at Object.sendRenderResult (/Users/lasse/Repos/aihelperbot.com/node_modules/next/dist/server/send-payload/index.js:62:33)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: invariant: invalid Cache-Control duration provided: 0 < 1
at Object.setRevalidateHeaders (/Users/lasse/Repos/aihelperbot.com/node_modules/next/dist/server/send-payload/revalidate-headers.js:13:19)
at Object.sendRenderResult (/Users/lasse/Repos/aihelperbot.com/node_modules/next/dist/server/send-payload/index.js:62:33)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: invariant: invalid Cache-Control duration provided: 0 < 1
at Object.setRevalidateHeaders (/Users/lasse/Repos/aihelperbot.com/node_modules/next/dist/server/send-payload/revalidate-headers.js:13:19)
at Object.sendRenderResult (/Users/lasse/Repos/aihelperbot.com/node_modules/next/dist/server/send-payload/index.js:62:33)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
```
### Describe the Bug
Returns white screen of death for dynamic routes with the error message: "Internal Server Error".
> I verified that the issue exists in the latest Next.js canary release *
It exist in "stabile" release.
### Expected Behavior
Render dynamic routes without issue.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/44860 | https://github.com/vercel/next.js/pull/44989 | cefb30b32bc05fcb46058a6e8b1ff545fb9ddf1d | 6b7c69fa4d773d76730272158e2fe7fed12e03aa | "2023-01-13T15:15:31Z" | javascript | "2023-01-18T18:24:35Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,817 | ["packages/next/src/cli/next-dev.ts", "packages/next/src/server/lib/start-server.ts"] | [NEXT-493] Docs: next.js after 13.0.7 dev server cluster worker restarter causes NODE_OPTIONS='--inspect' to use port 9230 instead of 9229 and so on | ### What is the improvement or update you wish to see?
This affects the following versions of nextjs:
- 13.0.7
- 13.1.0
- 13.1.1
- and probably some future versions too
TLDR: Set environment variable `__NEXT_DISABLE_MEMORY_WATCHER=1` if you don't have Out Of Memory issues. Otherwise read on to understand the problem but unfortunately no solution.
I would like better documentation or information regarding PR https://github.com/vercel/next.js/pull/43958. Or at least better exposure for such a big change in execution model without having to dig through releaselogs/changelogs for something unknown. Hopefully this issue might help exposure and future googlers.
The linked PR introduces the cluster module to start the next dev server in a forked process so that it can monitor the memory usage of the dev server and restart it if it gets too high.
This model causes the port used by inspection to get increased by 1 for the first start and every restart after that. So all official documentation and third party/user contributed educational material regarding debugging like tutorials, video, courses, etc will stop working **by default** as the changes in the linked PR are opt-out, rather than inform the user in a proper way and then be opt-in.
Basically providing `NODE_OPTIONS=--inspect` will assign the default port of 9229 to the main node process that handles nextjs. Before the linked PR was merged this process was the same process that started and ran the next dev server, meaning attaching a debugger to this process worked as expected; we could debug our nextjs code.
After the merge though, the next dev server is run in a forked child process to the main process, meaning we now have to attach to port 9230 (node increases the port number by 1 automatically) because port 9229 is assigned to the main process that does the actual forking. If you happen to run into the OOM issues that the PR was meant to work around, your next dev server will hit the memory limit and will get stopped and then started again by the main node process. This is a new forked child process and also a new inspect port number, 9231 (increased by 1 again) and so on.
I appreciate the workaround in the PR, it is quite clever. Hopefully this issue can help some people understand why they can't debug their Next.js code anymore or why the debug agent suddenly stops from out of nowhere due to the main process restarting the dev server.
### Is there any context that might help us understand?
The PR https://github.com/vercel/next.js/pull/43958 is meant to be helpful, and it is. I just would've appreciated a bit more light on the change of execution model for the next dev server. Some big bold text on the github release page or at least some keyword filled discussion/issue that we can find by google (as I hope this issue might be able to help with)
### Does the docs page already exist? Please link to it.
_No response_
<sub>[NEXT-493](https://linear.app/vercel/issue/NEXT-493/docs-nextjs-after-1307-dev-server-cluster-worker-restarter-causes-node)</sub> | https://github.com/vercel/next.js/issues/44817 | https://github.com/vercel/next.js/pull/45745 | 484f4724f4f635f023b1db644f0544bda8bb96b9 | be5fd6cee00311c9b76c6d67c382989fc3efba31 | "2023-01-12T13:52:29Z" | javascript | "2023-02-10T10:20:50Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,811 | ["packages/next/src/server/api-utils/node.ts"] | Ability to add custom headers to the on demand revalidation request | ### Describe the feature you'd like to request
When calling `res.revalidate()` from an API route I'd like to see the ability to add custom headers to the actual revalidate request.
A use case of this is bypassing protection. Vercel has a bypass protection header which we use to access our testing/staging environments. While this works for accessing the API route, it will not get passed on and the revalidate call will fail on a 401.
### Describe the solution you'd like
An additional option where we can define custom headers:
```ts
await res.revalidate(`/my-path`, {
unstable_customHeaders: {
'x-vercel-protection-bypass': req.headers['x-vercel-protection-bypass']
}
})
```
The `revalidate` function can then merge those headers and use them in the fetch request.
### Describe alternatives you've considered
Not a lot of alternatives to consider, you could allow custom cookies or allow for only one custom header to be set if you don't want to give developers the ability to override a required header that might break the experience.
While this issue pops up on Vercel for me, I don't think we should fix it just for Vercel but allow developers to bypass other platforms security as well. | https://github.com/vercel/next.js/issues/44811 | https://github.com/vercel/next.js/pull/44981 | 098305024681c15166ad8d9af6a06acda16a316f | 2bc8e740c7550af2e63c766dc24065dd78b89fdd | "2023-01-12T11:25:07Z" | javascript | "2023-01-17T20:35:07Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,733 | ["docs/advanced-features/compiler.md"] | Docs: "Modularize Import" codeblocks are incorrect | ### What is the improvement or update you wish to see?
The following codeblocks are missing the `modularizeImports` block.
```
// next.config.js
module.exports = {
'my-library': {
transform: 'my-library/{{member}}',
skipDefaultConversion: true,
},
}
```
and
```
// next.config.js
module.exports = {
lodash: {
transform: 'lodash/{{member}}',
preventFullImport: true,
},
}
```
should respectively become
```
// next.config.js
module.exports = {
modularizeImports: {
'my-library': {
transform: 'my-library/{{member}}',
skipDefaultConversion: true,
},
},
}
```
and
```
// next.config.js
module.exports = {
modularizeImports: {
lodash: {
transform: 'lodash/{{member}}',
preventFullImport: true,
},
},
}
```
### Is there any context that might help us understand?
The codeblocks specified above appear to be missing the `modularizeImports` block.
### Does the docs page already exist? Please link to it.
https://nextjs.org/docs/advanced-features/compiler#modularize-imports | https://github.com/vercel/next.js/issues/44733 | https://github.com/vercel/next.js/pull/44734 | cdfc484ba54725bde8e0949b71307de224c23932 | f4d9a50a3ef58ae7442ac2f61a28e6f7d6f09357 | "2023-01-09T19:40:55Z" | javascript | "2023-01-09T20:49:09Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,658 | ["packages/next/src/build/webpack/loaders/next-image-loader.ts", "test/integration/next-image-legacy/default/components/static-img.js", "test/integration/next-image-legacy/default/pages/dynamic-static-img.js", "test/integration/next-image-legacy/default/test/index.test.ts", "test/integration/next-image-new/default/components/static-img.js", "test/integration/next-image-new/default/pages/dynamic-static-img.js", "test/integration/next-image-new/default/test/index.test.ts"] | Static media not being included when using next/dynamic with ssr: false | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```
Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:19:52 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T6000
Binaries:
Node: 14.19.3
npm: 6.14.17
Yarn: 1.22.15
pnpm: 7.5.2
Relevant packages:
next: 13.1.2-canary.1
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
Dynamic imports (next/dynamic)
### Link to the code that reproduces this issue
https://github.com/deini/no-static-media-on-dynamic-import
### To Reproduce
1. Clone the reproduction repo
2. `pnpm install`
3. `pnpm run dev`
4. A next.js logo should be rendered but it isn't
### Describe the Bug
When importing static media assets such as .svg in a component which is imported using `next/dynamic` with `ssr: false` the media file is not copied to `.next/static/media/`.
```js
// Logo component imports an svg file
const Logo = dynamic(() => import('../Logo'), {
ssr: false,
});
```
This used to work in Next `13.0.6` and broke in `13.0.7`
### Expected Behavior
The media files should be copied to the Next's static media directory.
The reproduction repo has a `next-13.0.6` branch that shows it working.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/44658 | https://github.com/vercel/next.js/pull/44831 | 9255da252581246239786ac38b58a54ae87c076e | 6fcb518f31a823915cd5ec21ede1975a2a66ddec | "2023-01-06T17:54:52Z" | javascript | "2023-01-12T19:24:59Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,646 | ["packages/next/src/server/dev/next-dev-server.ts"] | generateStaticParams slows down dev | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```
npx next info
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:06:26 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T8112
Binaries:
Node: 16.18.1
npm: 8.19.2
Yarn: N/A
pnpm: 7.22.0
Relevant packages:
next: 13.1.2-canary.1
eslint-config-next: 13.1.1
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Data fetching (gS(S)P, getInitialProps)
### Link to the code that reproduces this issue
- (can provide if necessary)
### To Reproduce
Have a tree with quite some static paths. For me it is:
- Level 1: 8
- Level 2: 160
So in total 1280 paths.
### Describe the Bug
Loading pages (especially from level 2) is excruciatingly slow in development:
<img width="581" alt="image" src="https://user-images.githubusercontent.com/159500/211001797-fd2f6abe-9eac-4dd8-b675-8199069e1bf5.png">
I had to work around it by doing:
```typescript
export async function generateStaticParams() {
if (process.env.NODE_ENV !== 'production') return []
// ...
}
```
Then it's:
<img width="577" alt="image" src="https://user-images.githubusercontent.com/159500/211002809-cfb7d0e2-9bbd-4cab-912e-23f9b7cc0c85.png">
### Expected Behavior
I don't see the need to block rendering in development, as these paths are not statically generated anyway. So it would be nice if Next did this `if (process.env.NODE_ENV !== 'production') skip` automatically.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/44646 | https://github.com/vercel/next.js/pull/46940 | de6a1e3d7606b7d510d563307152bf4ea37d92a6 | 80f2293a017db0159bd141f52162dc4778327add | "2023-01-06T11:23:21Z" | javascript | "2023-03-08T22:33:28Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,542 | ["docs/api-reference/next.config.js/introduction.md"] | Docs: update a broken link on the introduction page | ### What is the improvement or update you wish to see?
There is a broken link on the [introduction page](https://nextjs.org/docs/api-reference/next.config.js/introduction), close to configs allowed by `next.config.js`

### Is there any context that might help us understand?
The updated link is https://github.com/vercel/next.js/blob/canary/packages/next/src/server/config-shared.ts/#L184
### Does the docs page already exist? Please link to it.
https://nextjs.org/docs/api-reference/next.config.js/introduction | https://github.com/vercel/next.js/issues/44542 | https://github.com/vercel/next.js/pull/44547 | 29106f47acea128acb575c09074570736be37b58 | a25d800f3f30ead113bbe672391ad8dcee8600ed | "2023-01-03T19:14:45Z" | javascript | "2023-01-03T23:16:09Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,442 | ["packages/next/src/build/index.ts", "test/production/standalone-mode/no-app-routes/app/layout.js", "test/production/standalone-mode/no-app-routes/index.test.ts", "test/production/standalone-mode/no-app-routes/next.config.js", "test/production/standalone-mode/no-app-routes/pages/hello.js"] | Error: ENOENT: no such file or directory, lstat '/app/.next/server/app' | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```
"next": "13.1.1",
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
_No response_
### Link to the code that reproduces this issue
private repo
### To Reproduce
```
$ yarn install
$ yarn build
```
### Describe the Bug
```
> Build error occurred
[Error: ENOENT: no such file or directory, lstat '/root/workspace/apps/api/.next/server/app'] {
errno: -2,
code: 'ENOENT',
syscall: 'lstat',
path: '/root/workspace/apps/api/.next/server/app'
}
```
### Expected Behavior
No build error
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/44442 | https://github.com/vercel/next.js/pull/51993 | 62c2c5abc2f7f3cfa99e66bacd64b1d56d45e85c | 98cc99df466dd45d8150dfa4858f3484ccbd6e8b | "2022-12-30T05:20:11Z" | javascript | "2023-07-10T08:40:02Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,424 | ["docs/api-reference/cli.md", "docs/basic-features/eslint.md", "packages/next/src/cli/next-lint.ts", "packages/next/src/lib/constants.ts", "packages/next/src/lib/verifyAndLint.ts", "test/integration/eslint/base-directories/app/layout.js", "test/integration/eslint/base-directories/next.config.js", "test/integration/eslint/test/index.test.js"] | `next lint` omits `app` dir by default. | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.2.0: Fri Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000
Binaries:
Node: 18.4.0
npm: 8.12.1
Yarn: 1.22.19
pnpm: 7.20.0
Relevant packages:
next: 13.1.1
eslint-config-next: 13.1.1
react: 18.2.0
react-dom: 18.2.0
```
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), ESLint (eslint-config-next)
### Link to the code that reproduces this issue
-
### To Reproduce
Just run the `next lint` command when you have some issues inside `app` directory. They will be skipped by default as `app` dir is not listed inside `ESLINT_DEFAULT_DIRS`
### Describe the Bug
By default, the `next lint` omits the `app` directory.
### Expected Behavior
Linter should also go through the `app` directory by default.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/44424 | https://github.com/vercel/next.js/pull/44426 | c26fc2456bba2acf2bdd5708a5fbffd5489cfbbf | 6444006f231c148bcee146624d4bc8ae3ec7adfd | "2022-12-29T14:26:12Z" | javascript | "2023-02-07T21:53:46Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,423 | ["packages/eslint-plugin-next/src/rules/no-unwanted-polyfillio.ts", "packages/next-polyfill-module/src/index.js", "packages/next-polyfill-nomodule/src/index.js"] | Array.prototype.at is not transpiled and causes TypeError in browsers | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #61-Ubuntu SMP Fri Oct 14 13:05:50 UTC 2022
Binaries:
Node: 18.12.1
npm: 8.19.2
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.1.1
eslint-config-next: 13.1.1
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
SWC transpilation
### Link to the code that reproduces this issue
https://codesandbox.io/s/awesome-dewdney-yp0x9d?file=/pages/index.tsx
### To Reproduce
Create a new app via `npx create-next-app@canary` with default options
Add `console.log([1,2,3].at(0))` in `pages/index.tsx`.
`npm run build && npm run start`
### Describe the Bug
Open http://localhost:3000 in Chrome 91, Firefox 89 or Safari 13 ([any browser not supporting array.at](https://caniuse.com/mdn-javascript_builtins_array_at))
An error will occurs : TypeError: "[...].at is not a function"
The code isn’t transpiled to older browsers.
### Expected Behavior
Code is transpiled and works on older browsers as described in [next browser support documentation](https://nextjs.org/docs/basic-features/supported-browsers-features).
### Which browser are you using? (if relevant)
Safari 13.1
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/44423 | https://github.com/vercel/next.js/pull/44436 | 895f104b3a993faadf1bb8495627b3fee23b4caa | ffe2d0400bf8ac457cc4a9890e21a88cc443b289 | "2022-12-29T14:25:36Z" | javascript | "2023-08-21T22:09:14Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,316 | ["packages/next/src/lib/server-external-packages.json"] | Next 13 Shiki vscode-oniguruma wasm file not found in React Server Component | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 16.18.1
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.1.1-canary.0
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
### Link to the code that reproduces this issue
https://github.com/selenecodes/next13-rsc-shiki-wasm-not-found
### To Reproduce
1. Install the reproduction
2. Run npm install
3. Witness the following error:
```
Error: ENOENT: no such file or directory, open '(sc_server)\node_modules\vscode-oniguruma\release\onig.wasm'
at Object.openSync (node:fs:590:3)
at Object.readFileSync (node:fs:458:35)
at getOniguruma (webpack-internal:///(sc_server)/./node_modules/shiki/dist/index.js:2178:32)
at Object.getHighlighter (webpack-internal:///(sc_server)/./node_modules/shiki/dist/index.js:2682:36)
at getHighlighter (webpack-internal:///(sc_server)/./markdown.plugin.ts:66:66)
at Function.rehypePrettyCode (webpack-internal:///(sc_server)/./node_modules/rehype-pretty-code/dist/rehype-pretty-code.js:30110:45)
at Function.freeze (webpack-internal:///(sc_server)/./node_modules/unified/lib/index.js:115:74)
at Function.process (webpack-internal:///(sc_server)/./node_modules/unified/lib/index.js:306:19)
at parseMarkdown (webpack-internal:///(sc_server)/./markdown.plugin.ts:41:31)
at Page (webpack-internal:///(sc_server)/./app/page.tsx:15:87)
at preloadComponent (D:\Code\osr\my-app\node_modules\next\dist\server\app-render.js:82:22)
at D:\Code\osr\my-app\node_modules\next\dist\server\app-render.js:880:24
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async createComponentTree (D:\Code\osr\my-app\node_modules\next\dist\server\app-render.js:879:25)
at async D:\Code\osr\my-app\node_modules\next\dist\server\app-render.js:819:56
at async Promise.all (index 0)
at async createComponentTree (D:\Code\osr\my-app\node_modules\next\dist\server\app-render.js:783:38)
at async D:\Code\osr\my-app\node_modules\next\dist\server\app-render.js:1059:51 {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: '(sc_server)\\node_modules\\vscode-oniguruma\\release\\onig.wasm'
}
```
### Describe the Bug
When loading the [shiki.js](https://github.com/shikijs/shiki) syntax highlighter in a React Server Component the `vscode-oniguruma` file can't be found.
### Expected Behavior
Load the syntax highlighter without issues and allow it to resolve the installed node module containing the `vscode-oniguruma` wasm file.
### Which browser are you using? (if relevant)
_No response_
### How are you deploying your application? (if relevant)
_No response_ | https://github.com/vercel/next.js/issues/44316 | https://github.com/vercel/next.js/pull/44968 | 72d35d0524751d7f959c43c437a3578cd7cdc559 | 0a5097c46626b38cc00ea4086463ff1caf2ab43f | "2022-12-23T22:53:37Z" | javascript | "2023-01-19T21:50:59Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,293 | ["packages/next/src/shared/lib/router/router.ts", "test/e2e/404-page-router/index.test.ts"] | [NEXT-435] Minimal middleware (only NextResponse.next()), generates error on error pages in dev mode | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 16.17.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.1.0
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
### Which area(s) of Next.js are affected? (leave empty if unsure)
Routing (next/router, next/navigation, next/link)
### Link to the code that reproduces this issue
https://github.com/w4zZz4p/issue-nextjs-error-page
### To Reproduce
```
npm install
npm run dev
```
open http://localhost:3000/page-does-not-exist
### Describe the Bug
When there is empty global middleware created:
```js
import { NextResponse } from 'next/server';
export function middleware(request) {
// some rewrite logic for specific requests
// all other requests pass-trough
return NextResponse.next();
}
```
and when you visit any 404 page, error occurs:
```
Unhandled Runtime Error
Error: Invariant: attempted to hard navigate to the same URL /page-does-not-exist http://localhost:3000/page-does-not-exist
```
The issue appeared in version `v13.0.7-canary.5`.
Version `v13.0.7-canary.4` works as expected.
My assumption its related to https://github.com/vercel/next.js/pull/43836
### Expected Behavior
There should be no error as in any existing page for example http://localhost:3000/
### Which browser are you using? (if relevant)
Chrome 108.0.5359.125 (Official Build) (64-bit)
### How are you deploying your application? (if relevant)
_No response_
<sub>[NEXT-435](https://linear.app/vercel/issue/NEXT-435/minimal-middleware-only-nextresponsenext-generates-error-on-error)</sub> | https://github.com/vercel/next.js/issues/44293 | https://github.com/vercel/next.js/pull/46303 | cd557c96676a3e76cb23c05d73c2caf97a3fd264 | bcb20100dbb6c6b43ecbc46e8ee8d236ad724f15 | "2022-12-23T08:00:40Z" | javascript | "2023-02-23T15:55:58Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,271 | ["examples/with-cloudinary/components/SharedModal.tsx"] | Swiping to the left on the first image causes a client side exception | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP Wed Nov 23 01:01:46 UTC 2022
Binaries:
Node: 19.0.1
npm: 8.19.2
Yarn: 1.22.18
pnpm: N/A
Relevant packages:
next: 13.1.0
eslint-config-next: 13.1.0
react: 18.2.0
react-dom: 18.2.0
### Which example does this report relate to?
with-cloudinary nextjs-image-gallery
### What browser are you using? (if relevant)
Chrome 108.0.5359.125
### How are you deploying your application? (if relevant)
Official demo
### Describe the Bug
A Client side exception inside the image carousel.
### Expected Behavior
Either nothing should happen when swiping to the left or make it wrap around to the end.
### To Reproduce
Click on the first image, then Swipe left. | https://github.com/vercel/next.js/issues/44271 | https://github.com/vercel/next.js/pull/44771 | 28afb887db3bb9342ee6aafb58a8f20fad5d75e9 | 975d96afdd8512d17e54557139bdaa29973321c9 | "2022-12-22T17:41:37Z" | javascript | "2023-01-11T23:53:34Z" |
closed | vercel/next.js | https://github.com/vercel/next.js | 44,164 | ["examples/with-turbopack/lib/styling.tsx", "test/e2e/app-dir/rsc-basic/app/root-style-registry.js"] | Styled components example crashes on reload | ### Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
### Provide environment information
```bash
$ npx next info
Operating System:
Platform: linux
Arch: x64
Version: #1 SMP Wed Nov 23 01:01:46 UTC 2022
Binaries:
Node: 19.2.0
npm: 9.2.0
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 13.0.7
eslint-config-next: 13.0.7
react: 18.2.0
react-dom: 18.2.0
```
### Which example does this report relate to?
with-turbopack
### What browser are you using? (if relevant)
Edge Version 108.0.1462.54 (Official build) (64-bit)
### How are you deploying your application? (if relevant)
next dev
### Describe the Bug
The styled-components example page errors on reload.

### Expected Behavior
The styled-components example page does not error on reload. Like vercel/app-playground.
### To Reproduce
For with-turbopack example:
```bash
$ npx create-next-app --example with-turbopack --typescript <dir>
$ cd <dir> && npx next dev --turbo --show-all
```
Navigate to `localhost:3000/styling/styled-components` and reload the page. An error is produced.
For app-playground example:
```bash
$ npx create-next-app --example https://github.com/vercel/app-playground --typescript <dir>
$ cd <dir> && npx next dev --turbo --show-all
```
Navigate to `localhost:3000/styling/styled-components` and reload the page. No error is produced. | https://github.com/vercel/next.js/issues/44164 | https://github.com/vercel/next.js/pull/44165 | 43c9d8940dc42337dd2f7d66aa90e6abf952278e | ea7d85687bae92ebdb5c51ebc59173e01db7b7e0 | "2022-12-19T19:47:38Z" | javascript | "2022-12-19T20:59:16Z" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.