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
36,997
["packages/next/build/webpack-config.ts", "test/e2e/next-script/index.test.ts"]
next/script `beforeInteractive` not working in `_document.js`
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 Binaries: Node: 14.17.6 npm: 7.24.2 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.7-canary.7 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug Script fails to load when using `<Script src="beforeInteractive"/>` in `_document.js` as specified in the documentation. Complete `_document.js` file as written: ```jsx import { Html, Head, Main, NextScript } from "next/document"; import Script from "next/script"; export default function Document() { return ( <Html> <Head> <Script src="https://unpkg.com/[email protected]/dist/css-paint-polyfill.js" strategy="beforeInteractive" /> </Head> <body> <Main /> <NextScript /> </body> </Html> ); } ``` There are also no console or browsers warning. Things fail silently. ### Expected Behavior Script loads. ### To Reproduce Import `next/script` in `_document.js` and load any third-party, or inline, script. Run the application and take a look at your network requests or DOM and you'll notice that no script tag has been inserted.
https://github.com/vercel/next.js/issues/36997
https://github.com/vercel/next.js/pull/37000
b2045c7669982edbb7002c7f88f8e7665a2168f7
81e69e8662e5d4010b1ca726092479f777b0e4d7
"2022-05-17T20:08:46Z"
javascript
"2022-05-18T18:36:11Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,966
["docs/basic-features/environment-variables.md"]
Env variables defined in`.env.development` override envs defined in `.env`
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: arm64 Binaries: Node: 14.17.6 npm: 8.8.0 Yarn: 1.22.17 pnpm: 6.32.3 Relevant packages: next: 12.1.7-canary.6 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug Env variables defined in`.env.development` override envs defined in `.env` ### Expected Behavior `.env` should override the definition in `.env.development` Or the docs are wrong on https://nextjs.org/docs/basic-features/environment-variables#:~:text=.env-,NODE_ENV%3Ddevelopment,.env,-NODE_ENV%3Dtest ### To Reproduce Next js app Proof of concept: https://github.com/gaspar09/envs-order `npm run dev` on the repo in https://github.com/gaspar09/envs-order. Open `localhost:3000/` Notice the environment variable in `.env.development` overrides the definition in `.env`
https://github.com/vercel/next.js/issues/36966
https://github.com/vercel/next.js/pull/36967
f1babe9302590fa143588a1da9313e3bf3ab6268
c72d32d3b5cce4fcf33cf621f0e43b899a493424
"2022-05-17T04:03:42Z"
javascript
"2022-05-17T17:52:41Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,964
["packages/next/server/dev/next-dev-server.ts", "packages/next/server/next-server.ts", "test/integration/middleware-general/test/index.test.js"]
`DecodeError` from invalid URI causes 500 with middleware (vs 400 without)
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` 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.14.2 npm: 8.5.0 Yarn: 1.22.18 pnpm: N/A Relevant packages: next: 12.1.7-canary.6 react: 18.1.0 react-dom: 18.1.0 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug When an invalid URI is requested against a dynamic route, Next will hit a `DecodeError` and ultimately return a 400. If a custom `_error` page is provided, the `res` object provided to `_error.getInitialProps` will also have `statusCode: 400`. Changing nothing else, if middleware is added the response is now a 500, yielding this stack. ``` DecodeError: failed to decode param at decode (.../test/node_modules/next/dist/shared/lib/router/utils/route-matcher.js:18:23) at .../test/node_modules/next/dist/shared/lib/router/utils/route-matcher.js:29:21 at Array.forEach (<anonymous>) at Object.match (.../test/node_modules/next/dist/shared/lib/router/utils/route-matcher.js:22:29) at DevServer.runMiddleware (.../test/node_modules/next/dist/server/next-server.js:837:50) at async DevServer.runMiddleware (.../test/node_modules/next/dist/server/dev/next-dev-server.js:435:28) at async Object.fn (.../test/node_modules/next/dist/server/next-server.js:710:30) at async Router.execute (.../test/node_modules/next/dist/server/router.js:226:36) at async DevServer.run (.../test/node_modules/next/dist/server/base-server.js:636:29) at async DevServer.run (.../test/node_modules/next/dist/server/dev/next-dev-server.js:483:20) ``` (Originates from [here](https://github.com/vercel/next.js/blob/canary/packages/next/shared/lib/router/utils/route-matcher.ts#L12-L18), and `middleware: true` is also attached to this error object.) This 500 is both the status code for the default UI, and if a custom `_error` page is provided, the `res` object provided to `_error.getInitialProps` will now have `statusCode: 500`. ### Expected Behavior The simple presence of middleware should not effect the outcome of this request, and both situations should yield 400 status codes to either default UI or custom application handling. Without custom error pages, Next should return a 400 status code with the "400 Bad Request" default UI. With custom error pages, Next should yield a `res` object to `_error.getInitialProps` with `statusCode: 400`. I'm guessing that the middleware logic needs the same special casing of `DecodeError` as found elsewhere: https://github.com/vercel/next.js/blob/canary/packages/next/server/base-server.ts#L579 ### To Reproduce Minimal repro here: https://github.com/merrywhether/next-uri-repro Steps: 1. Start a new Next project and start app (`build && start` is necessary to see UI outcomes of errors locally, but `dev` also works) 2. Add a dynamic route eg `pages/[test].js`: ``` import { useRouter } from 'next/router'; const Post = () => { const { query: { test }, } = useRouter(); return <p>Test: {test}</p>; }; export default Post; ``` 3. Make a good request (eg `/hello`) and see "Test: hello" with 200 status 4. Make a bad request (eg `/%c0`) and see "400 | Bad Request" default UI with 400 status 5. Add `pages/_error.js`: ``` export const ErrorPage = ({ statusCode }) => { return <div>Error {statusCode}</div>; }; ErrorPage.getInitialProps = (ctx) => { return { statusCode: ctx.res?.statusCode }; }; export default ErrorPage; ``` 6. Make same bad request and see "Error 400" custom UI with 400 status 7. Add `pages/_middleware.js`: ``` import { NextResponse } from 'next/server'; export const middleware = () => { return NextResponse.next(); }; ``` 8. Make same bad request and see "Error 500" with 500 status 9. Move/remove `_error.js`, make same bad request, and see "500 | Internal Server Error" default UI with 500 status
https://github.com/vercel/next.js/issues/36964
https://github.com/vercel/next.js/pull/36993
5b893663fdb3658de4e8ce2bb5966fbfe4e905ef
7e57432247cf4b418ee614a43dc82df9128e61d1
"2022-05-17T02:03:01Z"
javascript
"2022-05-22T03:25:51Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,864
["packages/next/shared/lib/router/router.ts", "test/e2e/ignore-invalid-popstateevent/app/next.config.js", "test/e2e/ignore-invalid-popstateevent/app/pages/[dynamic].js", "test/e2e/ignore-invalid-popstateevent/app/pages/static.js", "test/e2e/ignore-invalid-popstateevent/with-i18n.test.ts", "test/e2e/ignore-invalid-popstateevent/without-i18n.test.ts", "tsconfig.json"]
Next.js serves fresh props to stale Safari pages
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:34:37 PST 2022; root:xnu-8020.101.4~2/RELEASE_X86_64 Binaries: Node: 16.9.0 npm: 7.21.1 Yarn: 1.22.11 pnpm: N/A Relevant packages: next: 12.1.7-canary.4 react: 18.1.0 react-dom: 18.1.0 ``` ### What browser are you using? (if relevant) iOS Safari 15.4 ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug For a Next.js website I maintain, I observed a few users end up with broken pages after a release. 1. A user had opened a page a month ago and kept it in their iOS tabs. The page at the time was dynamically routed (e.g. `pages/[...dynamic].tsx`). 2. In the interim, we released a change that required the page to be statically routed (e.g. `pages/static.tsx`) and changed the page props served to the page. The dynamic route still remained, however, as it is serving other needs. 3. When the user reopened Safari and the tab, the page was serving the same code as from when it was dynamically routed, but serving the new page's props. This resulted in breaking the page because it wasn't being served the expected props. ### Expected Behavior Expect to either: - Serve stale page with old props - Serve new page with new props ### To Reproduce Steps to reproduce and code are all available here: https://github.com/czycha/next-zombie-bug
https://github.com/vercel/next.js/issues/36864
https://github.com/vercel/next.js/pull/37110
88b1f7d50a04995ee7db3b7eccaf5d3b176d6096
5739edc7cf5e9a3ba41054c5c701e8ddbe7607ed
"2022-05-12T16:37:00Z"
javascript
"2022-05-29T01:07:44Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,830
["packages/next/shared/lib/router/router.ts", "test/integration/client-navigation/test/index.test.js"]
Cancel Rendering Route Error when Router Push from Hash
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information 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.13.0 npm: 8.3.0 Yarn: 1.22.18 pnpm: N/A Relevant packages: next: 12.1.7-canary.3 react: 18.1.0 react-dom: 18.1.0 ### What browser are you using? (if relevant) Google Chrome Version 101.0.4951.54 (Official Build) (arm64) ### How are you deploying your application? (if relevant) Locally and Vercel ### Describe the Bug We have a hash based modal system. When a modal is opened using... ```ts router.push('#modalname'); ``` ...and quickly closed with... ```ts const removeHash = (path) => { return path.indexOf("#") > -1 ? path.substring(0, path.indexOf("#")) : path; }; const { asPath } = router; const path = removeHash(asPath); router.push(path); ``` ...the modal is closed, but we get the error `Error: Cancel rendering route`. ### Expected Behavior The modal closes without the error. ### To Reproduce # Source ``` git clone https://github.com/u840903/hash-cancel-rendering-route cd hash-cancel-rendering-route yarn yarn dev ``` # Vercel https://hashes-two.vercel.app/ # Steps locally There's various combinations, but the shortest is to: - From /, click on To blog - Now in /blog click Back home - Now in /, click the to world button - Error pops! # Steps on Vercel - From /, click on To blog - Error pops! ## Comment from icyJoseph (https://github.com/icyJoseph) It seems that any navigation to another route, followed by a hash navigation and a navigation away to another route triggers this. I think the key issue, at least on my setup, is the synchronous call to router.push, twice, once as a hash, and then as a route. Odd, that one must first navigate away, and come back to the page. Though, I'd expect router.push("#hash").then(() => router.push("/route")) to help out, but it doesn't. The event listener for errors also does nothing. Curious.
https://github.com/vercel/next.js/issues/36830
https://github.com/vercel/next.js/pull/36828
ef69aca4df648949aa0011b1431fafd6f21dafe5
baed42c79a19d85d046e3ef8263f317dfece2c18
"2022-05-11T09:09:36Z"
javascript
"2022-05-22T19:15:08Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,807
["packages/next/client/image.tsx", "test/unit/image-rendering.test.ts"]
sizes defined in props is not applied to noscript in next/image
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 19.6.0: Tue Jan 12 22:13:05 PST 2021; root:xnu-6153.141.16~1/RELEASE_X86_64 Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.7-canary.3 react: 18.1.0 react-dom: 18.1.0 ### What browser are you using? (if relevant) Chrome 100.0.4896.127 ### How are you deploying your application? (if relevant) next start ### Describe the Bug next/image does not handle size properly in server rendering. This problem occurs with image components that do not have `priority`. Here is an example of a rendering result using next/image. ```jsx <Image src='/img.png' width={1920} height={1280} sizes='100vw' alt='' /> <Image src='/img.png' width={1920} height={1280} sizes='50vw' alt='' /> ``` ↓ We have omitted all but the most important parts. ```html <noscript> <img sizes="100vw" srcset=" /_next/image?url=%2Fimg.png&amp;w=640&amp;q=75 640w, /_next/image?url=%2Fimg.png&amp;w=750&amp;q=75 750w, /_next/image?url=%2Fimg.png&amp;w=828&amp;q=75 828w, /_next/image?url=%2Fimg.png&amp;w=1080&amp;q=75 1080w, /_next/image?url=%2Fimg.png&amp;w=1200&amp;q=75 1200w, /_next/image?url=%2Fimg.png&amp;w=1920&amp;q=75 1920w, /_next/image?url=%2Fimg.png&amp;w=2048&amp;q=75 2048w, /_next/image?url=%2Fimg.png&amp;w=3840&amp;q=75 3840w " /> </noscript> <noscript> <img sizes="100vw" srcset=" /_next/image?url=%2Fimg.png&amp;w=640&amp;q=75 640w, /_next/image?url=%2Fimg.png&amp;w=750&amp;q=75 750w, /_next/image?url=%2Fimg.png&amp;w=828&amp;q=75 828w, /_next/image?url=%2Fimg.png&amp;w=1080&amp;q=75 1080w, /_next/image?url=%2Fimg.png&amp;w=1200&amp;q=75 1200w, /_next/image?url=%2Fimg.png&amp;w=1920&amp;q=75 1920w, /_next/image?url=%2Fimg.png&amp;w=2048&amp;q=75 2048w, /_next/image?url=%2Fimg.png&amp;w=3840&amp;q=75 3840w " /> </noscript> ``` ### Expected Behavior The expected rendering results are as follows. ```html <noscript> <img sizes="100vw" srcset=" /_next/image?url=%2Fimg.png&amp;w=640&amp;q=75 640w, /_next/image?url=%2Fimg.png&amp;w=750&amp;q=75 750w, /_next/image?url=%2Fimg.png&amp;w=828&amp;q=75 828w, /_next/image?url=%2Fimg.png&amp;w=1080&amp;q=75 1080w, /_next/image?url=%2Fimg.png&amp;w=1200&amp;q=75 1200w, /_next/image?url=%2Fimg.png&amp;w=1920&amp;q=75 1920w, /_next/image?url=%2Fimg.png&amp;w=2048&amp;q=75 2048w, /_next/image?url=%2Fimg.png&amp;w=3840&amp;q=75 3840w " /> </noscript> <noscript> <img sizes="50vw" srcset=" /_next/image?url=%2Fimg.png&amp;w=384&amp;q=75 384w, /_next/image?url=%2Fimg.png&amp;w=640&amp;q=75 640w, /_next/image?url=%2Fimg.png&amp;w=750&amp;q=75 750w, /_next/image?url=%2Fimg.png&amp;w=828&amp;q=75 828w, /_next/image?url=%2Fimg.png&amp;w=1080&amp;q=75 1080w, /_next/image?url=%2Fimg.png&amp;w=1200&amp;q=75 1200w, /_next/image?url=%2Fimg.png&amp;w=1920&amp;q=75 1920w, /_next/image?url=%2Fimg.png&amp;w=2048&amp;q=75 2048w, /_next/image?url=%2Fimg.png&amp;w=3840&amp;q=75 3840w " /> </noscript> ``` ### To Reproduce Implemented with minimal code in this repository. https://github.com/dc7290/next-noscript-sizes After cloning it. ```bash yarn build ``` If you look at `.next/server/pages/index.html` you will see that the sizes are not applied correctly. Finally, with or without this issue. Next.js remains the best product for me. I'm not exaggerating when I say I can't develop without Next.js anymore! Here's to Next.js!!🥂
https://github.com/vercel/next.js/issues/36807
https://github.com/vercel/next.js/pull/37161
18dc7e1a4993c3d70966b8510abf5073fe2926e8
13747476b87e5536abc7fd6590247d2ff991b501
"2022-05-10T14:34:16Z"
javascript
"2022-05-24T19:25:05Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,802
["docs/advanced-features/automatic-static-optimization.md", "docs/api-reference/next/router.md"]
`asPath` mismatch when using `rewrites` feature
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 Binaries: Node: 16.13.2 npm: 8.1.2 Yarn: 1.19.1 pnpm: N/A Relevant packages: next: 12.1.7-canary.3 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug My urls looks like `/weekend-list`, which should be mapped to `/weekendList` when I print `asPath` & `pathname` I get a mismatch error . ### Expected Behavior It should behave the same as it works on the client, `asPath` points to the actual path in the browser, `pathname` points to the underline page rendered. ### To Reproduce ```js // next.config.js /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, async rewrites() { return [ { source: '/weekend-list', destination: '/weekendList', }, ] }, } module.exports = nextConfig ``` ```js // pages/weekendList.js import { useRouter } from 'next/router'; export default function WeekendList() { const { asPath, pathname } = useRouter(); return ( <ul> <li>asPath: {asPath}</li> <li>pathname: {pathname}</li> </ul> ); } ``` 1. start the server (dev or prod). 2. navigate to `/weekend-list` You will get a mismatch error.
https://github.com/vercel/next.js/issues/36802
https://github.com/vercel/next.js/pull/36876
87e93a275ded4c2d19d40fcefbf9316bd71e249c
5b893663fdb3658de4e8ce2bb5966fbfe4e905ef
"2022-05-10T11:47:09Z"
javascript
"2022-05-22T02:45:47Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,794
["packages/next/taskfile-swc.js", "test/unit/esm-interpolate/esm-interpolate.test.tsx", "test/unit/esm-interpolate/fixture.tsx"]
router client file is transpiled incorrectly
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:34:37 PST 2022; root:xnu-8020.101.4~2/RELEASE_X86_64 Binaries: Node: 16.11.1 npm: 8.0.0 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.5 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) n/a ### How are you deploying your application? (if relevant) n/a ### Describe the Bug The dist/client/router.js file had this code added in version 12.1.5 ```js if (typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) { Object.assign(exports.default, exports); module.exports = exports.default; } ``` This essentially erases all named exports from the CJS exports object, and instead hangs them all on the default export. This breaks Jest code that's mocking the useRouter hook. ```ts import * as routerModule from 'next/router'; // ... jest.spyOn(routerModule, 'useRouter').mockReturnValue(({ pathname: '/foo/bar', push: pushMockFn, } as unknown) as useRouter.NextRouter); ``` now breaks, since `routerModule.useRouter` is null, requiring instead ```ts import routerModule from 'next/router'; ``` This fixes the test, but is wrong. useRouter is not a property on the default export (or shouldn't be) but is rather a named export in that module. ### Expected Behavior CJS exports should match ESM. ### To Reproduce See above
https://github.com/vercel/next.js/issues/36794
https://github.com/vercel/next.js/pull/36877
2ed5b3d5f02460c3b589c30e9a3b918492eceb6e
9e568dae2495e867cba0bb961a0822cf9042dca4
"2022-05-10T03:24:29Z"
javascript
"2022-05-13T16:39:38Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,693
["packages/eslint-plugin-next/lib/rules/no-before-interactive-script-outside-document.js", "test/unit/eslint-plugin-next/no-before-interactive-script-outside-document.test.ts"]
ESLint Error During Vercel Deployment
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 Binaries: Node: 16.13.2 npm: 8.1.2 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.6 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) Not relevant ### How are you deploying your application? (if relevant) Vercel ### Describe the Bug I recently set up ESLint in my Next.js app via `next lint`. Running `next lint` works correctly in my local development environment. However, when deploying that application an ESLint error is displayed in the build log output. The exact error is: In my local environment: <img width="733" alt="image" src="https://user-images.githubusercontent.com/24758740/166850252-c3d1e931-f04e-4286-a534-f7508989e032.png"> When deploying on Vercel: ``` error - ESLint: Failed to load plugin '@next/next' declared in '.eslintrc.json » eslint-config-next/core-web-vitals » /vercel/path0/node_modules/eslint-config-next/index.js': Unexpected token '.' Referenced from: /vercel/path0/node_modules/eslint-config-next/index.js ``` This error does not stop the deployment, but I would like linting to work properly so that I can be sure the build will broken for linting errors. Here is my current `.eslintrc.json` ``` { "extends": "next/core-web-vitals" } ``` Here is my `package.json` (I tried the canary version but didn't have any luck so I reverted to 12.1.6) ``` { "name": "personal-site", "version": "1.3.0", "private": true, "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "rss": "node ./scripts/rss.js", "lint": "next lint" }, "dependencies": { "dotenv": "^8.2.0", "next": "^12.1.6", "next-themes": "^0.0.15", "node-fetch": "^2.6.1", "react": "^17.0.2", "react-dom": "^17.0.2", "remark": "^13.0.0", "remark-html": "^13.0.1", "rss": "^1.2.2" }, "devDependencies": { "@tailwindcss/typography": "^0.5.0", "@types/node-fetch": "^2.6.1", "@types/react": "^17.0.41", "autoprefixer": "^10.4.1", "eslint": "8.14.0", "eslint-config-next": "12.1.6", "postcss": "^8.4.5", "tailwindcss": "^3.0.8", "typescript": "^4.6.2" } } ``` ### Expected Behavior I would expect linting not to produce this error during deployment so that I can be confident that linting is working properly and that the build will be broken should linting errors exist. While the error does not stop the deployment from happening, it could be misleading for the error to be displayed in the build log output. ### To Reproduce I'm not sure if this particular issue is reproducible in any other repositories, but I can confirm it does happen in all of my attempted production and preview deployments. I do have my app on Vercel integrated with GitHub to do production deploys on pushes to `main` and preview deploys when pushing to other remote branches. The steps to reproduce this would be to configure ESLint with specified package versions and deploy via Vercel. Here is a link to my [repo](https://github.com/aaronmbos/personal-site). <img width="1004" alt="image" src="https://user-images.githubusercontent.com/24758740/166849922-3003c906-29fc-4c66-b364-eb5c7a2f3942.png">
https://github.com/vercel/next.js/issues/36693
https://github.com/vercel/next.js/pull/36978
af86ca08e4363f2bbc10e4bd94a76b4f62b106c2
4fd883f2382c3a66969709f51d4a3d0bfff08fd3
"2022-05-05T01:05:43Z"
javascript
"2022-05-17T17:09:31Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,682
["examples/with-jest/package.json", "packages/next/build/jest/jest.ts"]
moduleNameMapper with next/jest no longer works well with absolute imports
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: linux Arch: x64 Version: #45~20.04.1-Ubuntu SMP Mon Apr 4 09:38:31 UTC 2022 Binaries: Node: 16.15.0 npm: 8.5.5 Yarn: 1.22.18 pnpm: 6.32.6 Relevant packages: next: 12.1.6 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug i have absolute imports configured in tsconfig, as well as in my `jest` config: ```js const nextJest = require('next/jest') const createJestConfig = nextJest({ dir: './' }) const config = { moduleNameMapper: { '^@/(.*)$': '<rootDir>/src/$1', }, } module.exports = createJestConfig(config) ``` with this config, importing a `.module.css` file in a component via absolute import was handled correctly before `[email protected]`: ```js import styles from '@/components/my-component/my-component.module.css ``` since `next/[email protected]` however (specifically with https://github.com/vercel/next.js/pull/36312) this changed because now user-provided `moduleNameMapper` will match before anything auto-configured by `next/jest`, which means i would have to manually copy the mapping for `.css`, `.module.css`, images etc. ### Expected Behavior see above ### To Reproduce see above
https://github.com/vercel/next.js/issues/36682
https://github.com/vercel/next.js/pull/36787
fdc071c5fd176f719d3eb4f2700412263cf7bff0
e05a95a844021b00d9a063ce5ba6e5c28a9c09cc
"2022-05-04T15:40:35Z"
javascript
"2022-05-10T21:36:10Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,681
["packages/next/server/config.ts", "test/integration/next-image-new/both-basepath-trailingslash/next.config.js", "test/integration/next-image-new/both-basepath-trailingslash/pages/index.js", "test/integration/next-image-new/both-basepath-trailingslash/public/test.jpg", "test/integration/next-image-new/both-basepath-trailingslash/test/index.test.ts"]
[BUG] ImageComponent does not work when combine `trailingSlash` and `basePath`
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` 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.14.2 npm: 7.24.2 Yarn: 1.22.17 pnpm: 6.27.1 Relevant packages: next: 12.1.7-canary.1 react: 17.0.2 react-dom: 17.0.2 ``` ### What browser are you using? (if relevant) Microsoft Edge Version 101.0.1210.32 (Official build) (arm64) ### How are you deploying your application? (if relevant) next start ### Describe the Bug When we combine `basePath` with `trailingSlash`, the `next/image` component does not applies the correct `src` and `srcSet`. It always generates `/_next/...` instead `/<base-path>/_next/...`. That leads to images not loading properly. ### Expected Behavior Add the `basePath` into the generated `src` and `srcSets` so the image can be loaded properly. ### To Reproduce 1. clone this project: https://github.com/raulfdm/next-basepath-trailing-image-bug 3. install the dependencies `npm install` 4. run the server `npm run dev` 5. open the app at [`http://localhost:3001/docs/`](http://localhost:3001/docs/) 6. see the image component failing 7. press the button that adds the base path 8. the image should be properly displayed If you run `npm build && npm start`, the image will still be broken.
https://github.com/vercel/next.js/issues/36681
https://github.com/vercel/next.js/pull/44312
f0aa10b2165e661c6ed2494787eab31891115065
b0a1e99606a7a7329f885d4c418943c5612d2a0f
"2022-05-04T15:35:43Z"
javascript
"2022-12-23T23:04:26Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,675
["packages/next/server/node-web-streams-helper.ts", "packages/next/server/render.tsx", "packages/next/server/view-render.tsx", "test/integration/amphtml-fragment-style/next.config.js", "test/integration/amphtml-fragment-style/test/index.test.js", "test/integration/app-document/pages/_document.js", "test/integration/app-document/pages/index.js", "test/integration/app-document/test/rendering.js", "test/integration/styled-jsx-module/app/next.config.js", "test/integration/styled-jsx-module/test/index.test.js"]
12.1.6 CSS generation regression
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64 Binaries: Node: 16.14.0 npm: 8.5.0 Yarn: 1.22.10 pnpm: N/A Relevant packages: next: 12.1.7-canary.1 react: 18.1.0 react-dom: 18.1.0 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug I'm seeing a CSS generation regression in my setup starting from `12.1.6` and persisting with current `12.1.7-canary.1`. I'm using React 18 with emotion based UI kit. I see a huge FOUC that gets resolved a moment after load, see dev lighthouse screenshots: `12.1.5` <img width="718" alt="Screen Shot 2022-05-04 at 2 38 08 PM" src="https://user-images.githubusercontent.com/789031/166683512-a2b11f7b-4f94-4c87-a4eb-5aa6f41ebc1c.png"> `12.1.6+` <img width="712" alt="Screen Shot 2022-05-04 at 2 37 20 PM" src="https://user-images.githubusercontent.com/789031/166683578-d89a18fa-6a05-4a85-be53-d1c5b8a07770.png"> Any idea if this is an issue with React 18 or how to mitigate? I locked my packages to 12.1.5 for now. ### Expected Behavior No FOUC like in 12.1.5 ### To Reproduce 1. use React 18 2. use css-in-js library like emotion or ui kit like http://mantine.dev 3. use next version 12.1.6 or later 4. Run lighthouse test or watch content jump around during load
https://github.com/vercel/next.js/issues/36675
https://github.com/vercel/next.js/pull/36792
e05a95a844021b00d9a063ce5ba6e5c28a9c09cc
4de5b64c0b0c320a56910f3e609e2dc2528662c2
"2022-05-04T12:47:46Z"
javascript
"2022-05-11T13:25:23Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,651
["packages/next/build/swc/options.js", "test/production/jest/remove-react-properties/app/jest.config.js", "test/production/jest/remove-react-properties/app/next.config.js", "test/production/jest/remove-react-properties/app/pages/index.js", "test/production/jest/remove-react-properties/remove-react-properties-jest.test.ts"]
`data-testid` being stripped in test/local env in latest 12.1.6
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: linux Arch: x64 Version: #1 SMP Wed Mar 2 00:30:59 UTC 2022 Binaries: Node: 14.18.1 npm: 6.14.15 Yarn: 1.22.18 pnpm: N/A Relevant packages: next: 12.1.6 react: 18.1.0 react-dom: 18.1.0 ### What browser are you using? (if relevant) Firefox ### How are you deploying your application? (if relevant) Vercel ### Describe the Bug In the latest 12.1.6, running Jest locally with tests that try to locate elements using the `data-testid` attr fail, this works fine in 12.1.5. In my next config I have: ``` compiler: { styledComponents: true, reactRemoveProperties: true, }, ``` ![image](https://user-images.githubusercontent.com/222170/166480517-fee520dd-c2b6-48ef-8457-fa5f5c95dca8.png) ### Expected Behavior `data-testid` should only be removed in production env, not local or preview envs. ### To Reproduce Create a projec with latest next, jest, and a test that looks for a `data-testid`.
https://github.com/vercel/next.js/issues/36651
https://github.com/vercel/next.js/pull/36922
c7f2c635cb1e9c2e9373836640bae4ce76d514d1
96034e2d9cf2e15c70a49d591fadf4e7a6aecde2
"2022-05-03T15:00:55Z"
javascript
"2022-05-17T11:05:31Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,643
["packages/next/client/index.tsx", "packages/next/server/next.ts", "test/integration/custom-server/test/index.test.js"]
Custom server causes using old root API in React 18
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Codesandbox ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug The error message appears in browser console while running Next.js with React 18 and custom server: ``` Warning: ReactDOM.hydrate is no longer supported in React 18. Use hydrateRoot instead. Until you switch to the new API, your app will behave as if it's running React 17 ``` ### Expected Behavior No error ### To Reproduce Create empty Next.js project and add custom server according to docs. Reproduced on codesandbox: https://codesandbox.io/s/next-12-1-6-react-18-1-custom-server-9blolp
https://github.com/vercel/next.js/issues/36643
https://github.com/vercel/next.js/pull/36664
9cda84b48434ae83561023487666e6a661b77141
ce6e8b562250f10d4fa9a7dea6e229e363e3baa7
"2022-05-03T12:13:23Z"
javascript
"2022-05-03T22:42:00Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,639
[".github/workflows/build_test_deploy.yml", "packages/next-swc/crates/napi/npm/freebsd-x64/README.md", "packages/next-swc/crates/napi/npm/freebsd-x64/package.json"]
Missing @next/swc-freebsd-x64 package
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: freebsd Arch: x64 Version: FreeBSD 13.0-RELEASE-p11 #0: Tue Apr 5 18:54:35 UTC 2022 [email protected]:/usr/obj/usr/src/amd64.amd64/sys/GENERIC Binaries: Node: 16.13.0 npm: 8.5.2 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.6 react: 18.1.0 react-dom: 18.1.0 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug Trying to run `next build` on FreeBSD produces the following error and the project is not built: ``` warn - Attempted to load @next/swc-freebsd-x64, but it was not installed error - Failed to load SWC binary for freebsd/x64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc ``` The issue is that such package doesn't exist, so it cannot be installed. ### Expected Behavior The package is found and installed. ### To Reproduce Simply try to build a next.js app on FreeBSD.
https://github.com/vercel/next.js/issues/36639
https://github.com/vercel/next.js/pull/36826
334d42c441a9d1df865867eeea77e280f13a74b9
6f344e661723135e48266ac57116cc4b50636475
"2022-05-03T09:18:54Z"
javascript
"2022-05-11T16:20:05Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,636
["packages/next-swc/crates/core/src/next_dynamic.rs", "packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/input.js", "packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-dev.js", "packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-prod.js", "packages/next-swc/crates/core/tests/fixture/next-dynamic/with-options/output-server.js", "test/e2e/dynamic-with-suspense/index.test.ts"]
dynamic import with `suspense:true, ssr:false` causes `The server could not finish this Suspense boundary` error
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 Binaries: Node: 16.14.2 npm: 8.1.4 Yarn: 1.22.1 pnpm: 6.32.4 Relevant packages: next: 12.1.6-canary.16 react: 18.1.0 react-dom: 18.1.0 ``` ### Describe the Bug Using dynamic component import with `{suspense: true, ssr:false}` cause this error: ``` Error: The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering. ``` ![image](https://user-images.githubusercontent.com/8813276/166362901-5c2059fe-91a5-4290-b476-3cafbdd7d455.png) **Important Note:** functionally this works correctly, the issue is just that an error is being generated and so it appears broken ### Expected Behavior Should work without any error popup or error in browser console ### To Reproduce #### Runable reproduction: https://codesandbox.io/s/dank-sound-pkxopr?file=/pages/index.js ```tsx import { Suspense } from "react"; import dynamic from "next/dynamic"; const Thing = dynamic(() => import("../thing"), { ssr: false, suspense: true }); export default function IndexPage() { return ( <div> <p>Next.js Example</p> <Suspense fallback="Loading..."> <Thing /> </Suspense> </div> ); } ``` ```tsx //thing.js export default function Thing() { return "Thing"; } ``` ### Other You can also cause this same behavior with this next.js page: ```tsx import { Suspense } from "react"; export default function Thing() { if (typeof window === 'undefined') { const e = new error() e.name = "rendering suspense fallback..." delete e.stack throw e } return "Thing" } export default function IndexPage() { return ( <div> <p>Next.js Example</p> <Suspense fallback="Loading..."> <Thing /> </Suspense> </div> ); } ```
https://github.com/vercel/next.js/issues/36636
https://github.com/vercel/next.js/pull/36825
31a538d68ba92298d2b1964c7ac1bb779f908e6e
c7f2c635cb1e9c2e9373836640bae4ce76d514d1
"2022-05-03T00:38:41Z"
javascript
"2022-05-17T10:41:17Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,615
["package.json", "packages/next/types/index.d.ts", "pnpm-lock.yaml", "test/unit/infer-get-server-side-props-type.test.ts", "test/unit/infer-get-static-props.test.ts"]
InferGetServerSidePropsType doesn't work with conditional returns
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ❯ next info Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 20.6.0: Tue Feb 22 21:10:41 PST 2022; root:xnu-7195.141.26~1/RELEASE_X86_64 Binaries: Node: 17.9.0 npm: 8.5.5 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.6-canary.16 react: 18.0.0 react-dom: 18.0.0 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug In the documentation here: https://nextjs.org/docs/api-reference/data-fetching/get-server-side-props#redirect We are shown that we can return a redirect or a notFound instead of props. I have attempted to do that in TypeScript here: ``` export default function user({ user }: InferGetServerSidePropsType<typeof getServerSideProps>) { return ( <div>{user}</div> ); } export const getServerSideProps = async ({ req }: GetServerSidePropsContext) => { const userJwt = parseCookies({ req })['jwt'] if (!userJwt) { return { redirect: { destination: '/login', permanent: false } } } const user = await prisma.users.findFirst() return { props: { user } } } ``` If there is logic handling a conditional redirect, we don't get type inference. Here is a WebStorm screenshot showing that: ![image](https://user-images.githubusercontent.com/17555572/166203937-a3d23bc2-a6e1-46d1-a4ce-0e5178c3385b.png) Once I remove the conditional logic: ``` export default function user({ user }: InferGetServerSidePropsType<typeof getServerSideProps>) { return ( <div>{user?.email}</div> ); } export const getServerSideProps = async ({ req }: GetServerSidePropsContext) => { const user = await prisma.users.findFirst() return { props: { user } } } ``` Then type inference works again: ![image](https://user-images.githubusercontent.com/17555572/166204237-f3e06ad7-7750-431a-bda6-c609ae0e1e25.png) ### Expected Behavior Type inference works with conditionals. ### To Reproduce One way of reproducing is copy/pasting what I provided in the bug description: ``` export default function user({ user }: InferGetServerSidePropsType<typeof getServerSideProps>) { return ( <div>{user}</div> ); } export const getServerSideProps = async ({ req }: GetServerSidePropsContext) => { const userJwt = parseCookies({ req })['jwt'] if (!userJwt) { return { redirect: { destination: '/login', permanent: false } } } const user = await prisma.users.findFirst() return { props: { user } } } ``` This however requires extra dependencies to be installed. With no dependencies, you can simply take the example from the docs and attempt to use type inference with it: https://nextjs.org/docs/api-reference/data-fetching/get-server-side-props#redirect
https://github.com/vercel/next.js/issues/36615
https://github.com/vercel/next.js/pull/40635
c2f48ea86d448c8be1982b46f184b1d2f2d6cd50
3943b20f554ba6558fa2f8262a302c14c42c134e
"2022-05-02T08:14:37Z"
javascript
"2022-09-20T22:25:01Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,590
["errors/swc-disabled.md", "packages/next/build/webpack-config.ts", "packages/next/server/config-shared.ts", "test/e2e/swc-warnings/index.test.ts"]
Docs: how to opt back into SWC
### What is the improvement or update you wish to see? https://nextjs.org/docs/messages/swc-disabled explains why a project opted out of SWC, but doesn't explain how to explicitly opt in. Is that possible? (if not, I suppose this is a feature request) ### Is there any context that might help us understand? Other tools such as Jest and Storybook react to the presense of a `.babelrc`. It's inconvenient -or sometimes not supported well- to have to configure those tools to point to a custom `.babelrc` location. ### Does the docs page already exist? Please link to it. https://nextjs.org/docs/messages/swc-disabled
https://github.com/vercel/next.js/issues/36590
https://github.com/vercel/next.js/pull/36789
7d52589bd610c9770f3acafb8384e166f91c4400
c7b2083f2eff850150ae6ac315d04ac74737e880
"2022-04-30T17:47:48Z"
javascript
"2022-05-10T10:33:31Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,569
["packages/next/bin/next.ts", "packages/next/cli/next-dev.ts", "test/development/watch-config-file/index.test.ts", "test/lib/next-modes/base.ts", "test/lib/next-modes/next-dev.ts"]
should listen for config file changes when specifying the app directory
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 20.6.0: Wed Jan 12 22:22:42 PST 2022; root:xnu-7195.141.19~2/RELEASE_X86_64 Binaries: Node: 14.19.0 npm: 6.14.16 Yarn: 1.22.17 pnpm: 6.32.3 Relevant packages: next: 12.1.6-canary.14 react: 18.1.0 react-dom: 18.1.0 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug When you run `next dev` in the project root directory and modify `next.config.js`, you will soon see a prompt in the terminal that you need to restart the server. However, if you start the project with `next dev some-dir`, you will not see any hints after modifying the `next.config.js` ### Expected Behavior Should also listen to `next.config.js` changes when run `next dev some-dir` ### To Reproduce 1. `npx create-next-app@latest test-watch-config` 2. `./test-watch-config/node_modules/.bin/next dev ./test-watch-config` 3. modify `./test-watch-config/next.config.js` Should see a prompt in the terminal that you need to restart the server.
https://github.com/vercel/next.js/issues/36569
https://github.com/vercel/next.js/pull/36570
baed42c79a19d85d046e3ef8263f317dfece2c18
ff37cc9e13cbe33c4b954743413567387fec705e
"2022-04-29T12:09:12Z"
javascript
"2022-05-22T19:42:53Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,534
["packages/next/jest.js", "packages/next/taskfile.js"]
Wrong TypeScript export signature for next/jest
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:35:58 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T6000 Binaries: Node: 16.13.2 npm: 8.1.2 Yarn: 1.22.18 pnpm: 6.32.4 Relevant packages: next: 12.1.4 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) N/A ### How are you deploying your application? (if relevant) N/A ### Describe the Bug The TypeScript definition requires writing `require('next/jest').default` to access the function while in the actual code, there is no such `default` property. ### Expected Behavior `jest.d.ts` uses `export =` instead of `export default`. ### To Reproduce ```js // @ts-check const nextJest = require('next/jest'); // ❌ TS2349: Cannot invoke an expression whose type lacks a call signature. const config = nextJest(); // ❌ Uncaught TypeError: nextJest.default is not a function const config = nextJest.default(); ```
https://github.com/vercel/next.js/issues/36534
https://github.com/vercel/next.js/pull/36824
2e135346cf0847efd85329fb77e86f9e21ad417a
d76bbde311da00cd750bf48d49887610960cafb9
"2022-04-28T03:39:48Z"
javascript
"2022-05-11T18:13:13Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,456
["packages/next/pages/_document.tsx", "test/integration/amphtml/pages/_document.js"]
Invalid head attributes in amp mode
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 Binaries: Node: 16.8.0 npm: 7.21.0 Yarn: 1.22.18 pnpm: N/A Relevant packages: next: 12.1.5 react: N/A react-dom: N/A ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug There is an issue for amp version of pages, if nonce props is specified for `Head` component. Following code returns invalid attributes for `<head>` html element, but it is a blocker for amp pages, because non-valid pages won't appear in Google Search results. ``` import { useAmp } from 'next/amp' import Document, { Html, Head, Main, NextScript } from 'next/document' const AmpTst = () => { const isAmp = useAmp() return <p>{isAmp ? 'AMP Power!!!' : 'no AMP for you...'}</p> } class MyDocument extends Document { static async getInitialProps(ctx) { const initialProps = await Document.getInitialProps(ctx) return { ...initialProps } } render() { return ( <Html> <Head nonce="test-nonce" /> <body> <Main /> <AmpTst /> <NextScript /> </body> </Html> ) } } export default MyDocument ``` ### Expected Behavior Valid amp page ### To Reproduce Copy-paste following snippet to https://validator.ampproject.org/ ``` <!-- This is the minimum valid JavaScript AMP HTML document. Type away here and the AMP Validator will re-check your document on the fly. --> <!doctype html> <html ⚡> <head nonce="test-nonce"> <meta charset="utf-8"> <link rel="canonical" href="self.html"> <meta name="viewport" content="width=device-width,minimum-scale=1"> <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> <script async src="https://cdn.ampproject.org/v0.js"></script> </head> <body>Hello, AMP world.</body> </html> ```
https://github.com/vercel/next.js/issues/36456
https://github.com/vercel/next.js/pull/36457
9b61b10245d513d67621b6bf57c41d54cad5122c
29b3cdf93f483b0081512bd3a21ff7e0bd72f2ca
"2022-04-25T19:38:08Z"
javascript
"2022-05-22T05:54:33Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,432
["packages/next/shared/lib/head.tsx", "test/e2e/next-head/index.test.ts"]
`meta charset` element still not at the top of `<head>`
### Verify canary release - [X] I verified that the issue exists in 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: 12.1.6-canary.6 react: 18.0.0 react-dom: 18.0.0 ``` ### What browser are you using? (if relevant) Edge 100.0.1185.50 ### How are you deploying your application? (if relevant) next export ### Describe the Bug Unfortunately #28119 has not fully fixed #26534 - as described as in [this comment](https://github.com/vercel/next.js/pull/28119#issuecomment-1059678069), `<meta charset="utf-8">` is still only second from the top of `<head>`, rather than at the top, failing this [hint](https://webhint.io/docs/user-guide/hints/hint-meta-charset-utf-8/) ### Expected Behavior `<meta charset="utf-8">` should be at the top of `<head>` ### To Reproduce Same as #26534 - Add a font to `_document.js` - Run next build and next export - Observe that `<meta charset="utf-8">` is still only second from the top of `<head>`, rather than at the top, with `<meta name="viewport" content="width=device-width">` being first instead.
https://github.com/vercel/next.js/issues/36432
https://github.com/vercel/next.js/pull/36561
2e1740bb69d2bffdb08da4541b23b9e12daed757
afbc511d3ff21f4a34a11207d04fe41d8887a455
"2022-04-25T08:30:45Z"
javascript
"2022-05-22T17:28:54Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,386
["packages/next/build/utils.ts"]
Next standalone build does not work with Yarn 3 workspaces
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Next.js v12.1.6-canary.5 (also tried against 12.1.5) ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug I am using yarn 3.2.0 and workspaces, where a next.js project is one package, with dependencies on others in the same monorepo. For development and a regular next build, this works as expected, but I am unable to use standalone. I have attempted a few different combinations of settings. When using `nodeLinker: node-modules` I am getting build errors as next is unable to find files in the local `node_modules` (which does not exist, only the one at the top of the monorepo does): ``` Error occurred prerendering page "[...]". Read more: https://nextjs.org/docs/messages/prerender-error Error: Cannot find module '[...]/mypackage/node_modules/react/jsx-runtime.js' at createEsmNotFoundErr (node:internal/modules/cjs/loader:960:15) at finalizeEsmResolution (node:internal/modules/cjs/loader:953:15) at resolveExports (node:internal/modules/cjs/loader:482:14) at Function.Module._findPath (node:internal/modules/cjs/loader:522:31) at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:102:18) at Object.997 ([...]/mypackage/dist/server/pages/_app.js:32:18) at __webpack_require__ ([...]/mypackage/dist/server/webpack-runtime.js:25:43) ``` I have attempted to use the pnpm linker instead, which does put a node_modules directory in each package (but with symlinks rather than a fully copy of all dependencies). In this setup, I can get it to build without errors. However, if I run the build twice, I receive an error: ``` [Error: EEXIST: file already exists, symlink '../../../../react-npm-18.0.0-fdbcb4c477/node_modules/react' -> '[...]/mypackage/node_modules/.store/react-dom-virtual-d71fc3884c/node_modules/react-dom/node_modules/react'] { errno: -17, code: 'EEXIST', syscall: 'symlink', path: '../../../../react-npm-18.0.0-fdbcb4c477/node_modules/react', dest: '[...]/mypackage/node_modules/.store/react-dom-virtual-d71fc3884c/node_modules/react-dom/node_modules/react' ``` I'm not sure why symlinks are getting created inside my node_modules, but this can be resolved by deleting node_modules/.store When starting the server from the standalone directory as built with pnpm compatible node_modules, I do get a "Listening on port ..." but later get errors as the server cannot find dependencies ``` Error: Cannot find module '[...]/mypackage/dist/standalone/node_modules/react/jsx-runtime.js' ``` The node_modules directory in my standalone output folder contains a link to react: ``` react -> ../../../node_modules/.store/react-npm-18.0.0-fdbcb4c477/node_modules/react ``` This does in fact exist, but contains no jsx-runtime.js. Other dependencies in my output node_modules contain symlinks to node_modules/.store that do not exist at all. ### Expected Behavior next build with standalone mode configured correctly produces the artifacts required to run the server with yarn 3 workspaces ### To Reproduce * Create a yarn 3 style monorepo with a workspace `foo` containing a next js project, using pnpm as node linker * Configure the next project to build with standalone output * Run next build * Attempt to run the produced standalone server *
https://github.com/vercel/next.js/issues/36386
https://github.com/vercel/next.js/pull/40150
2de7b43b7819b4148f019ec560651e54e9ba562c
57fdff135dbdc5c40f4b6063d2c21dbd1faed34b
"2022-04-22T12:07:12Z"
javascript
"2022-09-01T18:20:08Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,329
["packages/next/server/dev/hot-reloader.ts", "test/development/webpack-issuer-deprecation-warning/index.test.ts", "test/lib/next-modes/next-dev.ts"]
[DEP_WEBPACK_MODULE_ISSUER] DeprecationWarning: Module.issuer: Use new ModuleGraph API
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` $ npx --no-install next info Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 20.6.0: Wed Jan 12 22:22:42 PST 2022; root:xnu-7195.141.19~2/RELEASE_X86_64 Binaries: Node: 14.19.0 npm: 6.14.16 Yarn: 1.22.17 pnpm: 7.0.0-alpha.2 Relevant packages: next: 12.1.6-canary.4 react: 18.0.0 react-dom: 18.0.0 ``` ### What browser are you using? (if relevant) Version 100.0.4896.127 (Official Build) (x86_64) ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug The deprecation warning for webpack appears when there is a compilation error: ![Pasted Graphic copy](https://user-images.githubusercontent.com/41503212/164375616-74912682-80ec-4f1a-8e20-545bdbf6e3ae.png) ![image](https://user-images.githubusercontent.com/41503212/164375358-7c336a28-34aa-4639-9be0-d164067dec23.png) ### Expected Behavior It should be possible to use webpack's `moduleGraph` API to avoid the warning ### To Reproduce 1. `npx create-next-app@latest test-next-warning` 2. `cd test-next-warning` 3. modify `pages/index.js` to manually add some syntax errors 4. `yarn dev` 5. visit `localhost:3000` and you should see the warning in the terminal
https://github.com/vercel/next.js/issues/36329
https://github.com/vercel/next.js/pull/36330
9456fc6b3b31a3291c69600866e1be3a9eac8835
864d401ee16ef9711c7e1165aa96f3d55a0e189b
"2022-04-21T05:06:00Z"
javascript
"2022-04-21T14:14:03Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,318
["docs/basic-features/script.md", "errors/invalid-script.md", "errors/manifest.json", "packages/next/client/script.tsx", "packages/next/pages/_document.tsx", "test/e2e/next-script-worker-strategy/index.test.ts", "test/integration/script-loader/base/pages/_document.js", "test/integration/script-loader/test/index.test.js"]
[Script] Inline scripts do not work with the "worker" strategy
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Any environment ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug Embedding an inline script with `next/script` and the `worker` strategy shows a console error and the script is not executed in the web worker. Example: ```jsx <Script id="gtm" strategy="worker" dangerouslySetInnerHTML={{ __html: `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-******');`, }} />; ``` Error: <img width="526" alt="Screen Shot 2022-04-20 at 12 30 52 PM" src="https://user-images.githubusercontent.com/12476932/164279026-c2faba83-2755-4c43-8ca0-b6ab79e82476.png"> ### Expected Behavior No error and that the script executes normally in the web worker. ### To Reproduce 1. Add `experimental: { nextScriptWorkers: true }` to `next.config.js` 2. Install the required Partytown dependency 3. Add an inline script to a page with `<Script strategy="worker" ... />`
https://github.com/vercel/next.js/issues/36318
https://github.com/vercel/next.js/pull/36364
e30d7237efcf8bb5d5c87f75cca856deaa2f7e21
fd2ba117635b983399a1b6dbe5d1432872ef4e08
"2022-04-20T16:46:19Z"
javascript
"2022-04-29T15:20:31Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,251
["packages/next/server/config-schema.ts", "packages/next/server/config-shared.ts", "packages/next/server/next-server.ts"]
[next.config.js rewrites] Error: socket hang up
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: linux Arch: x64 Version: #1 SMP Wed Oct 28 23:40:43 UTC 2020 Binaries: Node: 16.13.1 npm: 8.1.2 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.5 react: 17.0.2 react-dom: 17.0.2 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug When using rewrites it's impossible to make a request to API endpoint that takes more than 30 seconds to respond. After 31 second Next just throws the error `Server Error Error: socket hang up` which makes it impossible to use with any responding APIs. ### Expected Behavior There should be a soft timeout which would not throw after 30 seconds but should proceed waiting for the response and only show a warning. Or provide additional option to set custom timeouts. ### To Reproduce Create a rewrite rule to the endpoint which responds more than 30 seconds.
https://github.com/vercel/next.js/issues/36251
https://github.com/vercel/next.js/pull/40289
abbe3b0ad48f94522ff17e55f47fa54432c54772
fbf1c97eac7769be7a6fc038217176298bcfd1ee
"2022-04-18T20:24:44Z"
javascript
"2022-09-07T03:14:08Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,247
["packages/next/shared/lib/utils.ts"]
The DocumentContext.defaultGetInitialProps type is missing the optional `options` argument
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:36:53 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T8101 Binaries: Node: 16.14.2 npm: 8.5.0 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.6-canary.3 react: 17.0.2 react-dom: 17.0.2 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug The type definition for `DocumentContext.defaultGetInitialProps` is missing the optional `options` argument so a `Type error: Expected 1 arguments, but got 2.` error appears if you try to do something like ```ts const docProps = await ctx.defaultGetInitialProps(ctx, { nonce }); ``` as demonstrated in the [styled-jsx-with-csp](https://github.com/vercel/next.js/blob/2e00eb6746dfcda074154e7780e883d2618d2524/examples/styled-jsx-with-csp/pages/_document.jsx#L6) example. ### Expected Behavior There should not be a TypeScript error when passing in an options object to `defaultGetInitialProps`. ### To Reproduce 1) Checkout https://github.com/seanparmelee/nextjs-documentcontext-issue 2) From the project folder, run `npm install` and then `npm run build`
https://github.com/vercel/next.js/issues/36247
https://github.com/vercel/next.js/pull/36252
deb82802a4d112079ca6fcaa4bca4054d25cec3b
ffdb9f847f7b74db7daae43aa1440bd3162d76d1
"2022-04-18T17:40:18Z"
javascript
"2022-04-19T12:37:57Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,239
["docs/basic-features/eslint.md", "packages/eslint-plugin-next/lib/index.js", "packages/eslint-plugin-next/lib/rules/no-server-import-in-page.js", "test/unit/eslint-plugin-next/no-server-import-in-page.test.ts"]
Docs: @next/next/no-server-import-in-page explanation
### What is the improvement or update you wish to see? Can we get some context on why importing from `next/server` should not be done? ### Is there any context that might help us understand? I am wanting to make some reusable middleware functions that are placed outside of `pages`, so I need to import `NextRequest` and `NextResponse`, and it's unclear to me what I'm at risk of breaking by importing what amounts to type information. ### Does the docs page already exist? Please link to it. https://nextjs.org/docs/messages/no-server-import-in-page
https://github.com/vercel/next.js/issues/36239
https://github.com/vercel/next.js/pull/38028
d57342a94e60c42b14fccc60a038bf601f0b7449
22206651a69a8a15e8da396de8cab9b4faacd26a
"2022-04-18T13:40:12Z"
javascript
"2022-06-26T12:43:15Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,229
["packages/next/server/render.tsx", "test/development/basic/styled-components.test.ts", "test/development/basic/styled-components/pages/index.js", "test/integration/react-18/app/pages/index.js", "test/integration/react-18/test/basics.js", "test/lib/next-test-utils.js"]
Page Components rendering twice on Server
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:34:37 PST 2022; root:xnu-8020.101.4~2/RELEASE_X86_64 Binaries: Node: 16.13.1 npm: 8.1.2 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.5 react: 18.0.0 react-dom: 18.0.0 warn - Latest canary version not detected, detected: "12.1.5", newest: "12.1.6-canary.3". 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 ### What browser are you using? (if relevant) Chrome ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug Every Page component renders twice on server. For, example the following code prints `TempPage Render` twice on server in production mode (executed using npm run build; npm start) In fact the root component defined in `_app.js` also renders twice on server. BTW: the components render only once on client (browser) which is expected. ``` import { GetServerSideProps, NextPage } from 'next'; import React, { useEffect } from 'react'; const TempPage: NextPage<{username:string}> = ({username}) => { console.log("TempPage Render"); return ( <div>Welcome to temp {username}!</div> ); }; export default TempPage; export const getServerSideProps: GetServerSideProps = async () => { console.log('getServerSideProps'); return { props: { username: 'username', }, } }; ``` Following is the output on the command line where npm run build; npm start is run: ``` getServerSideProps TempPage Render TempPage Render ``` ### Expected Behavior Every Page should render only once on the Server. ### To Reproduce Create a new next app using `npx create-next-app <app-name> --ts` and then create a sample temp page using the above code.
https://github.com/vercel/next.js/issues/36229
https://github.com/vercel/next.js/pull/36352
b8f7c520daf295705fb309d15a89670678eb6945
be9491e2430b713846dc889aa386f71275c97b4a
"2022-04-17T09:23:02Z"
javascript
"2022-04-21T16:01:47Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,198
["packages/next/server/render.tsx", "test/integration/app-tree/pages/_app.tsx", "test/integration/app-tree/pages/index.js"]
Broken context w/ next 12.1.5-rc.2 and above
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: linux Arch: x64 Version: #77~18.04.1-Ubuntu SMP Wed Mar 30 15:36:02 UTC 2022 Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 4.0.0-rc.2 pnpm: N/A Relevant packages: next: 12.1.6-canary.1 react: 18.0.0 react-dom: 18.0.0 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug An application I have is having a strange behavior after an upgrade from 12.1.0 to current. Bisecting the releases, the problem started in 12.1.5-canary.2. I presume it's from [the React 18 upgrade](https://github.com/vercel/next.js/pull/35888), but I didn't try individual commits (is there an easy way to build them locally?). I have some contexts defined inside layout components (using a pattern similar to the one described [here](https://nextjs.org/docs/basic-features/layouts)), and since this upgrade those contexts are missing in the SSR build, crashing the direct page load (navigating to the page client-side works fine). It's almost as if pages were built without the _app wrapper. ### Expected Behavior Should work. ### To Reproduce To reproduce, clone https://github.com/arcanis/next-bug-context-ssr, run `yarn && yarn next dev`, and open localhost. It will crash. If you run `yarn add [email protected]` before restarting the server, it'll work.
https://github.com/vercel/next.js/issues/36198
https://github.com/vercel/next.js/pull/36206
9c7311b1a5a449a2951a580f153a18ac13aed6e2
fe6e74dc57a811f83a4908bc2a138ce087b31be3
"2022-04-15T19:13:38Z"
javascript
"2022-04-16T01:55:16Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,183
["packages/next/head.js", "packages/next/taskfile.js", "test/e2e/type-module-interop/index.test.ts"]
[next/head] [ESM] Element type is invalid: expected a string
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ```console Operating System: Platform: win32 Arch: x64 Version: Windows 10 Home Binaries: Node: 16.14.0 npm: N/A Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.6-canary.1 react: 17.0.2 react-dom: 17.0.2 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug Error when rendering _next/head_ with ESM enabled: ```console ready - started server on 0.0.0.0:3000, url: http://localhost:3000 event - compiled client and server successfully in 189 ms (112 modules) wait - compiling / (client and server)... event - compiled client and server successfully in 48 ms (124 modules) Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. Check your code at index.js:6. at Home at App (webpack-internal:///./node_modules/next/dist/pages/_app.js:69:1) at StyleRegistry (C:\head-elements-app\node_modules\styled-jsx\dist\index\index.js:671:34) at FlushEffectContainer (C:\head-elements-app\node_modules\next\dist\server\render.js:414:37) at AppContainer (C:\head-elements-app\node_modules\next\dist\server\render.js:429:29) at AppContainerWithIsomorphicFiberStructure (C:\head-elements-app\node_modules\next\dist\server\render.js:460:57) at div at Body (C:\head-elements-app\node_modules\next\dist\server\render.js:724:21) wait - compiling /_error (client and server)... event - compiled client and server successfully in 26 ms (125 modules) error - Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. ``` No error if I remove Head tag. ### Expected Behavior No error ### To Reproduce 1. from [Head Elements](https://github.com/vercel/next.js/tree/canary/examples/head-elements) example: `yarn create next-app --example head-elements head-elements-app` 2. add `"type": "module"` to `package.json` 3. `yarn dev` 4. go to `localhost:3000`
https://github.com/vercel/next.js/issues/36183
https://github.com/vercel/next.js/pull/36464
e97a6488185ba77a4f90016874b63973ad5cc80e
487f7ababad198041a77528c8b5250fe6b9b6c9a
"2022-04-15T10:47:16Z"
javascript
"2022-04-26T16:15:49Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,169
["packages/next/shared/lib/router/router.ts", "test/e2e/i18n-data-fetching-redirect/app/next.config.js", "test/e2e/i18n-data-fetching-redirect/app/pages/gsp-blocking-redirect/[locale].js", "test/e2e/i18n-data-fetching-redirect/app/pages/gsp-fallback-redirect/[locale].js", "test/e2e/i18n-data-fetching-redirect/app/pages/gssp-redirect/[locale].js", "test/e2e/i18n-data-fetching-redirect/app/pages/home.js", "test/e2e/i18n-data-fetching-redirect/app/pages/index.js", "test/e2e/i18n-data-fetching-redirect/index.test.ts"]
redirection to default locale doesn't work from getStaticProps(fallback) when we're in another locale currently
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information 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.14.2 npm: 8.5.0 Yarn: 1.22.18 pnpm: N/A Relevant packages: next: 12.1.5 react: 18.0.0 react-dom: 18.0.0 ### What browser are you using? (if relevant) Chrome ### How are you deploying your application? (if relevant) Other platform ### Describe the Bug let's say you entered /es/xyz/[slug] on chrome and since this page wasn't statically generated before, getStaticProps runs and since there is not Spanish content for this page, I want to redirect the user to /xyz/[slug]. but the below doesn't work. ``` return { redirect: { destination: '/xyz/abc', permanent: false, }, }; ``` I even tried doing ``` return { redirect: { destination: '/en/xyz/abc', permanent: false, }, }; ``` but that doesn't work either. So my question is how to change the current locale to the default one inside of getStaticProps? ### Expected Behavior redirects to default locale inside of getStaticProps when you're in a different locale currently should happen. ### To Reproduce I think whatever I wrote above kinda explains it. Thanks a lot!
https://github.com/vercel/next.js/issues/36169
https://github.com/vercel/next.js/pull/36944
91c75b6c1f55dbfcd0c4d090f87829ff3dc4d9bd
e3382e64f0f8658285039eb550e1826aa9427373
"2022-04-14T18:58:02Z"
javascript
"2022-05-19T00:31:43Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,151
["packages/next-swc/Cargo.lock", "packages/next-swc/crates/core/Cargo.toml", "packages/next-swc/crates/emotion/Cargo.toml", "packages/next-swc/crates/modularize_imports/Cargo.toml", "packages/next-swc/crates/napi/Cargo.toml", "packages/next-swc/crates/styled_components/Cargo.toml", "packages/next-swc/crates/styled_jsx/Cargo.toml", "packages/next-swc/crates/wasm/Cargo.toml"]
Non ascii char can not be use parameter type with destructuring
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 3.2.0 pnpm: 6.32.4 Relevant packages: next: 12.1.6-canary.0 react: 18.0.0 react-dom: 18.0.0 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug <img width="1019" alt="image" src="https://user-images.githubusercontent.com/97939463/163384170-004b15df-0619-4de1-a927-be63f6b8ca9d.png"> ``` type ü = { name: string; value: string; }; export const SomeComponent = ({ name, value }: ü) => { return ( <div> {name} {value} </div> ); }; ``` ### Expected Behavior Not met errors ### To Reproduce https://github.com/flex-jonghyen/reproduce-bug
https://github.com/vercel/next.js/issues/36151
https://github.com/vercel/next.js/pull/36351
0441f816a668fdfef19e1b35a6fc7333e0bdcf87
b4d4f241291e9a569aadf2f2563c6eb54f9e6a7d
"2022-04-14T11:45:48Z"
javascript
"2022-04-22T07:20:44Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,146
["packages/next/compiled/use-subscription/index.js", "packages/next/taskfile.js"]
IE11 breaks when importing components with next/dynamic
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: linux Arch: x64 Version: #1 SMP Wed Oct 28 23:40:43 UTC 2020 Binaries: Node: 12.22.4 npm: 6.14.14 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.6-canary.0 react: 18.0.0 react-dom: 18.0.0 ### What browser are you using? (if relevant) IE11 21H2 (OS Build 19044.1645) ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug 1. With **IE11** import any component with "next/dynamic" 2. Page will not render correctly, JS will stop working (onClick etc) ### Expected Behavior 1. With **IE11** import any component with "next/dynamic" 2. Page renders correctly, JS continues to work (onClick etc) ### To Reproduce 1. Git Clone https://github.com/jaspersorrio/next-js-ie11-bug 2. npm install && npm run dev 3. Open **IE 11** 4. [GET] http://localhost:3000 <-- Will error <br/><img height="300" src="https://user-images.githubusercontent.com/10573718/163371921-a20b267b-28f8-42c0-b4c1-5ad0eadde482.png"/><br/> 5. [GET] http://localhost:3000/without-dynamic <-- Works fine <br/><img height="300" src="https://user-images.githubusercontent.com/10573718/163371942-d1e1c862-e9e7-4f26-b853-3a6b80652c25.png"/><br/>
https://github.com/vercel/next.js/issues/36146
https://github.com/vercel/next.js/pull/36159
a4aa1df7da9e37caf957d3d9a037ad54546f5e2e
cb526f579738baf6cf5728590bcbd38faec78126
"2022-04-14T10:05:43Z"
javascript
"2022-04-14T15:04:42Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,127
["packages/next-swc/Cargo.lock", "packages/next-swc/crates/core/Cargo.toml", "packages/next-swc/crates/emotion/Cargo.toml", "packages/next-swc/crates/modularize_imports/Cargo.toml", "packages/next-swc/crates/napi/Cargo.toml", "packages/next-swc/crates/styled_components/Cargo.toml", "packages/next-swc/crates/styled_jsx/Cargo.toml", "packages/next-swc/crates/styled_jsx/tests/fixture/transform-css-complex-selector/output.js", "packages/next-swc/crates/styled_jsx/tests/fixture/transform-css/output.js", "packages/next-swc/crates/wasm/Cargo.toml"]
`swcMinify: true` does not produce an usable build with v12.1.5
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ```bash $ npx --no-install next info Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 Binaries: Node: 16.13.1 npm: 8.1.2 Yarn: 1.22.18 pnpm: N/A Relevant packages: next: 12.1.5 react: 17.0.2 react-dom: 17.0.2 ``` ### What browser are you using? (if relevant) Not relevant ### How are you deploying your application? (if relevant) `next start` after a `next build` ### Describe the Bug Locally (running the application locally, in my IDE), everything looks good. Our tests are green as well. Only the PROD artefact is somehow rubbish. When accessing the homepage, this is what we get in the console: <img width="578" alt="console" src="https://user-images.githubusercontent.com/13186156/163226690-b735a408-b32c-4cf9-9573-bfc0f906c0e6.png"> When clicking on one of the links displayed, this is what I get: <img width="468" alt="error_decoder" src="https://user-images.githubusercontent.com/13186156/163226792-c8e14255-e240-4ea5-b9d7-6822a989bf19.png"> ### Expected Behavior No error messages in the console, application is running properly and _swcMinify_ is set to `true`, like it used to be for _v12.1.0_ (application was NOT working with the releases from _v12.1.1_ to _v12.1.4_). The expected behavior could be achieved if I set _swcMinify_ to `false` in the configuration [file](https://gitlab.com/biomedit/portal/-/blob/dev/frontend/next.config.js). ### To Reproduce Kindly follow instructions given in the [README.md](https://gitlab.com/biomedit/portal#production-like-local-deployment), _Production-like local deployment_. More info on the problem could be found [here](https://gitlab.com/biomedit/portal/-/issues/581) and [there](https://gitlab.com/biomedit/portal/-/issues/577). Please, let me know if you have questions, or whether I should deeply investigate in a given direction, or if I can do anything here to help. Thanks in advance for your time and investigation.
https://github.com/vercel/next.js/issues/36127
https://github.com/vercel/next.js/pull/36187
1582e11185a4b597dd789ace255911d30802d38f
cbb64ee5544739587d8697507406b73fbf015f83
"2022-04-13T16:38:59Z"
javascript
"2022-04-15T14:34:32Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,059
["packages/next/shared/lib/utils.ts"]
`performance` error
### Provide environment information next 12.1.4 react 17.0.2 react-dom 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug For some users in production, for various of browsers and OS, we sometimes get the following error. We saw this code is part of the client: https://github.com/vercel/next.js/blob/39318883783668d96b65391b62197fc0767dd26d/packages/next/client/index.tsx#L586 ``` TypeError: undefined is not an object (evaluating 'performance.getEntriesByName("Next.js-hydration").forEach') at te(./node_modules/next/dist/client/index.js:844:47) at ? (./node_modules/next/dist/client/page-loader.js:114:9) at forEach([native code]) at ? (chunks/main-f290bc8384acaedd.js:110:23) at Yi(./node_modules/react-dom/cjs/react-dom.production.min.js:219:278) at Ri(./node_modules/react-dom/cjs/react-dom.production.min.js:259:285) at Ri([native code]) at Pf(./node_modules/scheduler/index.js:4:3) at gg(./node_modules/react-dom/cjs/react-dom.production.min.js:122:422) at Uj(./node_modules/react-dom/cjs/react-dom.production.min.js:253:69) at Lj(./node_modules/react-dom/cjs/react-dom.production.min.js:244:190) at bi([native code]) at ? (./node_modules/react-dom/cjs/react-dom.production.min.js:123:206) at Pf(./node_modules/scheduler/index.js:4:3) at gg(./node_modules/react-dom/cjs/react-dom.production.min.js:122:422) at jg(./node_modules/react-dom/cjs/react-dom.production.min.js:123:157) at ig(./node_modules/react-dom/cjs/react-dom.production.min.js:123:94) at Jg(./node_modules/react-dom/cjs/react-dom.production.min.js:237:299) at documentElement(./node_modules/react-dom/cjs/react-dom.production.min.js:285:192) at tk(./node_modules/react-dom/cjs/react-dom.production.min.js:288:43) at hydrate(./node_modules/react-dom/cjs/react-dom.production.min.js:296:84) at ? (./node_modules/next/dist/client/page-loader.js:94:46) at noscript(chunks/main-f290bc8384acaedd.js:94:71) at ? (./node_modules/next/dist/client/index.js:783:44) at _unsupportedIterableToArray(chunks/pages/_app-9282cbc679e8547d.js:8:3) ``` We are not sure how to disable this performance module completely. ### Expected Behavior Doesn't need to crash ### To Reproduce N/A
https://github.com/vercel/next.js/issues/36059
https://github.com/vercel/next.js/pull/38186
f3659a5f931bec0e619ccabd678ab0cfdcf323ce
ab314605af8f8bfdb5acfbef7994ad8ccf7641e7
"2022-04-11T12:57:24Z"
javascript
"2022-06-30T16:06:53Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,041
["docs/upgrading.md"]
Docs: upgrade guide with specific React version
### What is the improvement or update you wish to see? In the Next.js upgrade guide, I would like to see specific versions of React that are required to have a particular Next.js version instead of "latest" ### Is there any context that might help us understand? Recently, React 18 went live, and we all know this is a major release that brings a lot of issues in libraries like testing-library/react, types, to name a few. If you are upgrading Next.js from 11 to 12 these days, then you will use the upgrade guide. When you read this guide, it says "update react to latest". But if you follow this instruction you may get into a lot of troubles. If, instead, it says "Upgrade to at least version X of react" and then, on each Next.js version it says something like "React version required: 17.0.2", then the developer will be able to decide what's best without wasting unnecessary time trying to upgrade React to latest. An option could be a "suggested minimum version". ### Does the docs page already exist? Please link to it. https://nextjs.org/docs/upgrading
https://github.com/vercel/next.js/issues/36041
https://github.com/vercel/next.js/pull/36091
4726b5a618fc0ec3e206c633a0f2fd22e6a9dfee
c0f979b5c8ee5c55a82fcdd5346758e3898b96d8
"2022-04-09T20:11:16Z"
javascript
"2022-04-15T12:43:26Z"
closed
vercel/next.js
https://github.com/vercel/next.js
36,008
["test/production/typescript-basic/app/pages/_document.tsx"]
Custom _document file example for styled-components throws a TS bug after updating @types/react to ^18.0.0
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.4.0: Fri Mar 18 00:47:26 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T8101 Binaries: Node: 17.4.0 npm: 8.3.1 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.4 react: 18.0.0 react-dom: 18.0.0 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug I'm not entirely sure if it should be posted here or as an issue in the types/SC repo, so sorry if it shouldn't be here. After updating @types/react to 18.0.0, I started noticing an error in the _documents.tsx file when using [this approach for styled components.](https://github.com/vercel/next.js/blob/canary/examples/with-styled-components/pages/_document.js). I now get an error which says ``` Class static side 'typeof MyDocument' incorrectly extends base class static side 'typeof Document'. The types returned by 'getInitialProps(...)' are incompatible between these types. Type 'Promise<{ styles: Element; html: string; head?: (Element | null)[] | undefined; }>' is not assignable to type 'Promise<DocumentInitialProps>'. Type '{ styles: JSX.Element; html: string; head?: (JSX.Element | null)[] | undefined; }' is not assignable to type 'DocumentInitialProps'. Type '{ styles: JSX.Element; html: string; head?: (JSX.Element | null)[] | undefined; }' is not assignable to type '{ styles?: ReactFragment | ReactElement<any, string | JSXElementConstructor<any>>[] | undefined; }'. Types of property 'styles' are incompatible. Type 'Element' is not assignable to type 'ReactFragment | ReactElement<any, string | JSXElementConstructor<any>>[] | undefined'. Type 'ReactElement<any, any>' is missing the following properties from type 'ReactElement<any, string | JSXElementConstructor<any>>[]': length, pop, push, concat, and 29 more.ts(2417) ``` Upon further investigation I discovered that in this part: ``` return { ...initialProps, styles: ( <> {initialProps.styles} {sheet.getStyleElement()} </> ), }; ``` the overwrite of styles seems to be causing trouble. `styles` are of type `styles?: ReactFragment | ReactElement<any, string | JSXElementConstructor<any>>[] | undefined` instead of `JSX.Element`. If we downgrade types back to "[^17.0.43](https://npmjs.com/package/@types/react)", it doesn't seem to be a problem anymore. ### Expected Behavior Types should work correctly if the example made by SC is still relevant. ### To Reproduce You can create a new project with `create next-app --typescript` and add the document from the file I linked above, you should see the error immediately.
https://github.com/vercel/next.js/issues/36008
https://github.com/vercel/next.js/pull/36671
88747a2653f372b314d819c42b865d31b7c1dd0a
01629113bd89919c324b74726f92a3e06c5347b7
"2022-04-08T14:24:00Z"
javascript
"2022-05-23T04:25:38Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,962
["packages/next/build/swc/options.js", "test/development/basic/emotion-swc.test.ts", "test/development/basic/emotion-swc/jsconfig.json", "test/development/basic/emotion-swc/next.config.js", "test/development/basic/emotion-swc/pages/_app.js", "test/development/basic/emotion-swc/pages/index.js", "test/development/basic/emotion-swc/shared/styles.js"]
Add support for configurable `jsxImportSource` when using Emotion SWC
### Describe the feature you'd like to request Currently, when opting into the SWC Emotion plugin, there is an assumption made that the `jsxImportSource` is `@emotion/react`. This prevents projects that use Emotion 10 from being able to use SWC, because the package which provides the JSX runtime is called `@emotion/core`. ### Describe the solution you'd like I have a couple suggestions for how to resolve this. 1. Allow the `jsxImportSource` from `jsConfig.compilerOptions` to be used, if present 2. Allow a `jsxImportSource` to be specified as part of the `emotion` SWC options Of these two suggestions, I think the first one is probably the better way to go, since its a little surprising that the `jsxImportSource` from `jsConfig.compilerOptions` is ignored if the `nextConfig.experimental.emotion` option is set ### Describe alternatives you've considered I'm not aware of another way to set the `jsxImportSource` to support `@emotion/core`while using the SWC Emotion plugin
https://github.com/vercel/next.js/issues/35962
https://github.com/vercel/next.js/pull/35963
633050402f8706cb06c1874338ab9d5e6aec1107
9110b5a4f1def444986744bd9fa68eb22b340ed6
"2022-04-07T07:18:48Z"
javascript
"2022-04-07T12:33:38Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,912
["test/production/escheck-output/index.test.ts"]
Vendored useSubscription is not ES5-compatible
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.4 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug A version of `useSubscription` interned/vendored into Next (https://github.com/vercel/next.js/pull/35746) because of its new peer-dep declaration. This version [contains an arrow function ](https://github.com/vercel/next.js/blob/canary/packages/next/compiled/use-subscription/index.js#L1) which is not ES5-compatible. ### Expected Behavior Next currently states that it is ES5 compatible, so it should not contain this arrow function. https://github.com/vercel/next.js/discussions/33227 I've also created https://github.com/vercel/next.js/issues/35913 to try to prevent these situations in the future. ### To Reproduce 1. Create a next app (e.g. `npx create-next-app@latest`) 2. Add a dynamic import (the code-path that contains internal `useSubscription` usage). For example, change `pages/index.js` to dynamically import the Image component: ``` import Head from 'next/head'; import styles from '../styles/Home.module.css'; import dynamic from 'next/dynamic'; const Image = dynamic(() => import('next/image')); ``` 3. Run `next build` 4. Run `npx es-check es5 '.next/static/**/*.js'` Get error: ``` error: ES-Check: there were 1 ES version matching errors. info: ES-Check Error: ---- · erroring file: .next/static/chunks/pages/index-35bd0f2403564f83.js · error: SyntaxError: Unexpected token (1:8374) · see the printed err.stack below for context ---- SyntaxError: Unexpected token (1:8374) ```
https://github.com/vercel/next.js/issues/35912
https://github.com/vercel/next.js/pull/39358
d88fd14a280928d46e18a8186ed83a8d1f609289
0571885ec4e324b4722c24712677169851ed3560
"2022-04-05T16:55:09Z"
javascript
"2022-08-05T13:07:50Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,870
["packages/next/server/node-web-streams-helper.ts", "packages/next/server/render.tsx", "test/integration/react-streaming-and-server-components/app/pages/index.server.js", "test/integration/react-streaming-and-server-components/test/basic.js"]
title issue with react-18
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: linux Arch: x64 Version: #23-Ubuntu SMP Fri Mar 11 14:54:05 UTC 2022 Binaries: Node: 17.8.0 npm: 8.5.5 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.5-canary.0 react: 18.0.0 react-dom: 18.0.0 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug With React 18, there is a html comment inside the title tag: NextJS + React 17: ``` <title>| abc</title> ``` NextJS + React 18: ``` <title>| abc<!-- --></title> ``` ![title-issue](https://user-images.githubusercontent.com/23744935/161531968-6868b3f4-2562-464e-9251-26978aa79115.png) ### Expected Behavior no html comment is inside the title tag ### To Reproduce https://github.com/SimonSiefke/nextjs-title-issue
https://github.com/vercel/next.js/issues/35870
https://github.com/vercel/next.js/pull/36213
0e2fd9280af2bd7a69f6879a57c1bb6c5e7056fc
90d3478c52d020aaa763dd9777a928f004139f82
"2022-04-04T11:13:57Z"
javascript
"2022-04-19T17:20:20Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,811
["packages/next-swc/Cargo.lock", "packages/next-swc/crates/core/Cargo.toml", "packages/next-swc/crates/emotion/Cargo.toml", "packages/next-swc/crates/modularize_imports/Cargo.toml", "packages/next-swc/crates/napi/Cargo.toml", "packages/next-swc/crates/styled_components/Cargo.toml", "packages/next-swc/crates/styled_jsx/Cargo.toml", "packages/next-swc/crates/styled_jsx/tests/fixture/transform-css-complex-selector/output.js", "packages/next-swc/crates/styled_jsx/tests/fixture/transform-css/output.js", "packages/next-swc/crates/wasm/Cargo.toml"]
cannot read properties of undefined on swcMinify
I've been getting these kind of errors poping up a lot when using swcMinify on version `12.1.2` ``` Cannot read properties of undefined (reading 'lib') ``` FYI this was working in the previous version. `12.1.0` The error was happening in auth0.js, cryptojs & I also experienced it in styled-components. I found this reference to the error and disabling swcMinify does fix it. https://github.com/brix/crypto-js/issues/415 _Originally posted by @moshie in https://github.com/vercel/next.js/discussions/30237#discussioncomment-2484107_
https://github.com/vercel/next.js/issues/35811
https://github.com/vercel/next.js/pull/36187
1582e11185a4b597dd789ace255911d30802d38f
cbb64ee5544739587d8697507406b73fbf015f83
"2022-04-01T08:28:43Z"
javascript
"2022-04-15T14:34:32Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,763
[".github/workflows/build_test_deploy.yml", "packages/next/client/index.tsx"]
ReferenceError: TransformStream is not defined when running Server Components in Firefox
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:35:58 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T6000 Binaries: Node: 16.14.0 npm: 8.5.1 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.4-canary.1 react: 18.0.0 react-dom: 18.0.0 ### What browser are you using? (if relevant) Firefox 98.0.2 ### How are you deploying your application? (if relevant) next dev ### Describe the Bug Any page that has server components do not work in Firefox. ### Expected Behavior **Expected** Expected Firefox to load like Chrome. Expected 3 components to show up (each one saying I am a server component). **Actual** ReferenceError: TransformStream is not defined In production, Application error: a client-side exception has occurred (see the browser console for more information). ``` 1 of 3 unhandled errors Unhandled Runtime Error ReferenceError: TransformStream is not defined Call Stack useServerResponse node_modules/next/dist/client/index.js (685:22) ServerRoot node_modules/next/dist/client/index.js (711:43) renderWithHooks node_modules/react-dom/cjs/react-dom.development.js (16141:0) mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js (20838:0) beginWork node_modules/react-dom/cjs/react-dom.development.js (22342:0) callCallback node_modules/react-dom/cjs/react-dom.development.js (4157:0) ``` ### To Reproduce **Production** 1. Open https://next-server-components-test.vercel.app/incremental-wait in Firefox. **Development** 1. clone this repo, https://github.com/hrgui/next-server-components-test and do `npm install` 2. Run `npm run dev` 3. Open http://localhost:3000/incremental-wait
https://github.com/vercel/next.js/issues/35763
https://github.com/vercel/next.js/pull/35796
69a166b263d6ebc34055c47953891b0000b0a9ef
d165836d88d03fd3f1bde11e0473d1924c9d7a4d
"2022-03-31T05:20:09Z"
javascript
"2022-03-31T21:26:46Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,758
["packages/next/server/render.tsx", "test/development/basic/styled-components.test.ts"]
`getInitialProps` in `_document` does not produce server-side `styled-components` styles
### Verify canary release - [X] I verified that the issue exists in Next.js canary release (12.1.3 is the latest release at the time of writing) ### Provide environment information Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:35:58 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T6000 Binaries: Node: 16.14.0 npm: 8.5.0 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.3 react: 18.0.0 react-dom: 18.0.0 ### What browser are you using? (if relevant) N/A ### How are you deploying your application? (if relevant) N/A ### Describe the Bug This bug is very similar to what has already been described in https://github.com/vercel/next.js/issues/35711 and fixed in https://github.com/vercel/next.js/pull/35736. Upgrading Next from 12.1.1 to 12.1.3 breaks SSR in `styled-components` when using React 18. Initial styles are missing in page source, as if `getInitialProps` in `_document` have not been called. ``` ...<style data-styled="" data-styled-version="5.3.5">body{margin:0;padding:0;box-sizing:border-box;}/*!sc*/ data-styled.g1[id="sc-global-fvFGgF1"]{content:"sc-global-fvFGgF1,"}/*!sc*/ .hAcELG{font-size:50px;color:#0070f3;}/*!sc*/ data-styled.g2[id="pages__Title-sc-eaab758a-0"]{content:"hAcELG,"}/*!sc*/ </style></head>... ``` This may be to do with hydration too (not sure). ### Expected Behavior I expect no initial flickering in styles when opening a server-side-rendered page. ### To Reproduce 1. `yarn create next-app --example with-styled-components with-styled-components-app` 1. Upgrade React to `18.0.0` 1. Run `yarn dev` 1. Open `view-source:http://localhost:3000` 1. Observe that there is no style tag `<style data-styled="" data-styled-version="5.3.5">...</style>`. The whole page source fits one line. 1. Downgrade Next from `12.1.3` to `12.1.2` and confirm the same behavior. 1. Downgrade Next from `12.1.2` to `12.1.1`, open `view-source:http://localhost:3000` and observe the style tag. The source will span across five lines. This is expected. The example is too small to observe the actual style flickering, but it is noticeable in a real Next.js app. Relevant example code: https://github.com/vercel/next.js/blob/9f9214abe58079e92cb42d50f537587d364e58f3/examples/with-styled-components/pages/_document.js#L5-L29
https://github.com/vercel/next.js/issues/35758
https://github.com/vercel/next.js/pull/35760
2f114134484a81ae7388a2ebb6be18b307e3b637
fe012ff916db6a9e5dc5317d0fef89a18fed9775
"2022-03-30T22:12:58Z"
javascript
"2022-03-31T00:35:00Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,754
["packages/next/server/config.ts", "packages/next/server/render.tsx", "packages/next/taskfile.js", "test/development/basic/hmr.test.ts", "test/development/basic/hmr/pages/auto-export-is-ready.js", "test/development/basic/hmr/pages/gsp-is-ready.js"]
`router.isReady` is not working correctly with React 18
### Verify canary release - [x] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: OSX Arch: ARM Version: MacOS Monterey Binaries: Node: 16.14.0 npm: N/A Yarn: N/A pnpm: 6.32.3 Relevant packages: next: 12.1.3-canary.4 react: 18.0.0 react-dom: 18.0.0 ``` ### What browser are you using? (if relevant) Chrome 101.0.4951.15 ### How are you deploying your application? (if relevant) Vercel ### Describe the Bug When I boot the next.js project in local with React 18, `router.isReady` returns false if the URL has a query value. When I deploy the project with Vercel, there is no such problem. The problem only occurs in local. ### Expected Behavior The isReady query returns true when the page is loaded if the project is started in localhost. ### To Reproduce Example code: ```js import { useRouter } from 'next/router' import {useEffect, useState} from "react"; export default function Home() { const router = useRouter() const [isReady, setIsReady] = useState(router.isReady) const [hasMounted, setHasMounted] = useState(false) // Set router.isReady when the page has mounted useEffect(() => { setIsReady(router.isReady) }, [router]) // Blocking hydration warning useEffect(() => { setHasMounted(true) }, []) if (!hasMounted) { return null } const addQuery = (query) => { router.push({ pathname: '/', query: query ? {query: query} : null }).then(()=>router.reload()) } return ( <div> <h2>{ isReady ? "Route is ready" : "Route is not ready"}</h2> <button onClick={()=>addQuery("1okok3mkn3mjf7f")}>Add query to url</button> <button onClick={()=>addQuery(null)}>Delete query from url</button> </div> ) } ```
https://github.com/vercel/next.js/issues/35754
https://github.com/vercel/next.js/pull/35762
fe012ff916db6a9e5dc5317d0fef89a18fed9775
d95aed607caf8cc211a08d858ed53c74146c1d73
"2022-03-30T20:01:38Z"
javascript
"2022-03-31T02:11:00Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,721
["packages/next/build/swc/options.js", "test/development/basic/define-class-fields.test.ts", "test/development/basic/define-class-fields/pages/animal.tsx", "test/development/basic/define-class-fields/pages/derived.tsx", "test/development/basic/define-class-fields/pages/index.tsx", "test/development/basic/define-class-fields/tsconfig.json"]
Add support for useDefineForClassFields typescript option
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:34:37 PST 2022; root:xnu-8020.101.4~2/RELEASE_X86_64 Binaries: Node: 17.6.0 npm: 8.5.1 Yarn: 1.22.17 pnpm: 6.32.3 Relevant packages: next: 12.1.2 react: 16.14.0 react-dom: 16.14.0 ### What browser are you using? (if relevant) Chrome 99.0.4844.84 ### How are you deploying your application? (if relevant) next start ### Describe the Bug Mobx - observable can't be applied When I try to compile my application with next swc compiler I have this error : > Error: [MobX] Cannot apply 'observable' to '[[email protected]](mailto:[email protected])': Field not found. And if we follow what the answer in this [stackoverflow](https://stackoverflow.com/questions/67266810/error-mobx-cannot-apply-observable-to-storeuser-field-not-found) said that I need to use useDefineForClassFields which I already use. https://github.com/swc-project/swc/issues/3389 https://github.com/swc-project/swc/pull/3766 it should be fixed by swc,but next.js has't add this option ### Expected Behavior the next-swc-loader option should add "useDefineForClassFields" property , then it can compile success ![image](https://user-images.githubusercontent.com/17813559/160807692-f5471d7f-1cd6-4c69-8c07-763a300855df.png) ### To Reproduce https://codesandbox.io/s/young-star-6s4hmv
https://github.com/vercel/next.js/issues/35721
https://github.com/vercel/next.js/pull/36335
084a0ca929c61240bb488fb8176c425985210d3e
9fe2f2637c8384ae7939d5a4a30f1557a4262acb
"2022-03-30T10:16:07Z"
javascript
"2022-04-21T08:41:09Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,720
["packages/next/server/node-web-streams-helper.ts", "test/production/react-18-streaming-ssr/index.test.ts"]
Server response is broken with multi-byte characters and React 18.0.0
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:36:53 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T8101 Binaries: Node: 16.14.2 npm: 8.5.0 Yarn: 1.22.18 pnpm: N/A Relevant packages: next: 12.1.3-canary.0 react: 18.0.0 react-dom: 18.0.0 ### What browser are you using? (if relevant) Firefox 98.0.2 ### How are you deploying your application? (if relevant) next dev ### Describe the Bug The sever response with multi-byte characters seems to be broken. <img width="938" alt="image" src="https://user-images.githubusercontent.com/298748/160792279-1ab44aff-664e-4b27-99b9-32f45ff73605.png"> This causes the following hydration error: ``` Warning: Text content did not match. Server: "アイウエオアイウエオアイウエオアイウオ" Client: "アイウエオアイウエオアイウエオアイウエオ" p main div Home MyApp@webpack-internal:///./pages/_app.tsx:34:21 ErrorBoundary@webpack-internal:///./node_modules/next/dist/compiled/@next/react-dev-overlay/client.js:8:20638 ReactDevOverlay@webpack-internal:///./node_modules/next/dist/compiled/@next/react-dev-overlay/client.js:8:23177 Container@webpack-internal:///./node_modules/next/dist/client/index.js:323:24 AppContainer@webpack-internal:///./node_modules/next/dist/client/index.js:822:20 Root@webpack-internal:///./node_modules/next/dist/client/index.js:946:21 See more info here: https://nextjs.org/docs/messages/react-hydration-error ``` ### Expected Behavior The hydration error should not be occurred. The server response should not contain garbage characters. ### To Reproduce https://github.com/3c1u/nextjs-mb-error-test
https://github.com/vercel/next.js/issues/35720
https://github.com/vercel/next.js/pull/35724
0409b384cbc6ec5051740a7c3c737352663b0faf
7b3ec57c6240addf49a5cad9545488b465d442e4
"2022-03-30T08:54:29Z"
javascript
"2022-03-30T18:24:25Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,711
["packages/next/server/render.tsx", "test/development/basic/styled-components.test.ts", "test/development/basic/styled-components/next.config.js", "test/development/basic/styled-components/pages/index.js", "test/integration/react-streaming-and-server-components/test/index.test.js"]
_document.js does not work for React.JS v18
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:36:53 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T8101 Binaries: Node: 17.8.0 npm: 8.5.5 Yarn: 1.22.18 pnpm: N/A Relevant packages: next: 12.1.2 react: 18.0.0 react-dom: 18.0.0 ``` ### Describe the Bug `_document.js` does not work for React.JS `v18` ### Expected Behavior `_document.js` and components such as `next/head` should work for React.JS v18 ### To Reproduce create a basic next.js project and create a `_document.js` file in `/pages`.
https://github.com/vercel/next.js/issues/35711
https://github.com/vercel/next.js/pull/35736
cae9506fd40098f1e7d3650cd5fd074fda57e8a2
600e0b3e4ef915faa74ce7c814aa3594d7b0d763
"2022-03-30T00:56:04Z"
javascript
"2022-03-30T16:10:48Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,708
["packages/next/build/index.ts", "test/production/standalone-mode-and-optimizecss/index.test.ts"]
File copy error when building with outputStandalone + optimizeCss
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: linux Arch: x64 Version: #1 SMP Wed Mar 2 00:30:59 UTC 2022 Binaries: Node: 14.17.5 npm: 6.14.15 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.3-canary.0 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) next build ### Describe the Bug We have a next application (using styled-components) that needs to be deployed as a Docker container. Using the guidelines in the [Docker example](https://github.com/vercel/next.js/tree/canary/examples/with-docker), we've enabled `outputStandalone` in `next.config.js`. Now we're experiencing [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content), and my assumption was that this was due to the CSS been delivered from a separate file, and that the FOUC was due to the wait between the initial HTML load and the CSS loading/parsing. Thus, a way to fix this could be to inline critical CSS. I discovered that this was now possible with the experimental option `optimizeCss` and installing `critters`. However, when I do both and then run `next build`, I get this output: ``` > next build warn - You have enabled experimental feature(s). warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk. info - Checking validity of types info - Creating an optimized production build info - Compiled successfully info - Collecting page data [ ] info - Generating static pages (0/4)Time 7.591497 Time 11.398525 Time 12.087 [= ] info - Generating static pages (3/4)Inlined 476 B (4% of original 11.3 kB) of _next/static/css/fbf5f08436f8ec98.css. Time 32.824959 info - Generating static pages (4/4) info - Finalizing page optimization > Build error occurred [Error: ENOENT: no such file or directory, copyfile '/home/avlund/propstep/web-front/.next/static/css/fbf5f08436f8ec98.css' -> '/home/avlund/propstep/web-front/.next/standalone/.next/static/css/fbf5f08436f8ec98.css'] { errno: -2, code: 'ENOENT', syscall: 'copyfile', path: '/home/avlund/propstep/web-front/.next/static/css/fbf5f08436f8ec98.css', dest: '/home/avlund/propstep/web-front/.next/standalone/.next/static/css/fbf5f08436f8ec98.css' } ``` The source file exists, but the destination path doesn't (`standalone/.next` does not contain the `static` folder) and I'm guessing that's why it fails. The error makes sense as it is [clearly stated](https://nextjs.org/docs/advanced-features/output-file-tracing#automatically-copying-traced-files-experimental) that one has to manually copy the `static` folder to `standalone/.next` if needed. This is problematic, however, as the build process seems to expect that it exists before I have the opportunity to actually copy the folder. Am I doing something wrong? Or should I take an entirely different approach to fixing the FOUC? ### Expected Behavior A successful build with no errors, and eventually a page that inlines critical CSS and prevents the FOUC. ### To Reproduce 1. Have both `outputStandalone` and `optimizeCss` turned on in `next.config.js` (here's my file for reference): ``` /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, compiler: { styledComponents: true, }, experimental: { outputStandalone: true, optimizeCss: true, } }; ``` 2. Install critters: ``` npm i critters ``` 3. Run the build process: ``` next build ```
https://github.com/vercel/next.js/issues/35708
https://github.com/vercel/next.js/pull/36028
8c5797959c7d83d58c04fb51d12a844de94b8e4e
95a8f31d86f47d8d8f00534781974f143129ecfe
"2022-03-29T22:17:41Z"
javascript
"2022-04-11T21:14:28Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,703
["package.json", "packages/next/package.json", "packages/react-refresh-utils/package.json", "run-tests.js", "test/development/basic/hmr.test.ts", "test/e2e/next-head/index.test.ts", "test/e2e/next-script-worker-strategy/index.test.ts", "test/lib/next-modes/base.ts", "test/production/react-18-streaming-ssr/index.test.ts", "yarn.lock"]
Fast Refresh does not work @latest
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 Binaries: Node: 17.5.0 npm: 8.4.1 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.2 react: 18.0.0 react-dom: 18.0.0 warn - Latest canary version not detected, detected: "12.1.2", newest: "12.1.3-canary.0". 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 ### What browser are you using? (if relevant) Chrome 99.0.4844.83 (Official Build) (arm64) ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug Just installed a new project with `npx create-next-app@latest`, and fast refresh is not working. ### Expected Behavior For the browser to refresh when I save a change in my code editor. ### To Reproduce `npx create-next-app@latest` start project with `npm run dev`
https://github.com/vercel/next.js/issues/35703
https://github.com/vercel/next.js/pull/35718
a00268e70f6812529f436e870e374e34f84bb4f8
62bb3482fe40d57f7f1d3318c5d887d7f29da100
"2022-03-29T18:41:37Z"
javascript
"2022-03-30T12:16:17Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,694
["packages/next/server/web/next-url.ts", "test/unit/web-runtime/next-url.test.ts"]
Ignore locale for NextURL when pathname is an API Path
### Describe the feature you'd like to request Currently the implementation of `NextURL` includes `locale` even when the `pathname` is changed to be an API path. For example, an instance of `NextURL` for `http://localhost:3000/en/about` with configuration for `en` locale can be updated like: ```typescript url.toString() // http://localhost:3000/en/about url.locale // en url.pathname = '/api/hello' url.toString(); // http://localhost:3000/en/api/hello ``` Instead of this, since API urls shouldn't contain locale, we should simply get `http://localhost:3000/api/hello`. The locale can be still contained in the instance but it wouldn't be part of the stringified version as it is an API path it shouldn't be shown. ### Describe the solution you'd like We can change `NextURL` so that when it gets an stringified URL it does ignore the locale if the pathname is for an API Route. ### Describe alternatives you've considered I guess as an alternative we can post-process the result but it sounds more correct to simply ignore the locale for API paths.
https://github.com/vercel/next.js/issues/35694
https://github.com/vercel/next.js/pull/36118
4bf01d4ec8829fe90489f3c1aadebb5bb1e06a10
1d8165bd79c69162c69820b5fe2ac69ccfecb90c
"2022-03-29T11:57:12Z"
javascript
"2022-04-13T15:30:03Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,693
["packages/next-swc/crates/core/src/emotion/mod.rs", "packages/next-swc/crates/core/tests/fixture/emotion/compress/input.tsx", "packages/next-swc/crates/core/tests/fixture/emotion/compress/output.ts"]
Emotion interpolation bug
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64 Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 1.22.10 pnpm: N/A Relevant packages: next: 12.1.2 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug ```ts const shadowBorder = ({ width = '1px', color }) => css` box-shadow: inset 0px 0px 0px ${width} ${color}; `; const StyledInput = styled.input` ${shadowBorder({ color: 'red', width: '4px' })} `; ``` results ![image](https://user-images.githubusercontent.com/18535812/160596526-205058e2-afad-426c-b692-ca1a15763d3d.png) The space before the first interpolation was removed. ### Expected Behavior The space is not removed before the first interpolation so the result is: ```css box-shadow: inset 0px 0px 0px 4px gray; ``` ### To Reproduce - Clone this repo: https://github.com/gubi995/nextjs-emotion-interpolation-bug - npm i - npm run dev - Inspect the input element's style
https://github.com/vercel/next.js/issues/35693
https://github.com/vercel/next.js/pull/35697
d876667aef57dbe065b73132973071e6ce0dd3d9
5a5b6174c0d834da13d0ac3e2bd3ef6985dcb784
"2022-03-29T11:02:33Z"
javascript
"2022-03-30T13:14:29Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,661
["packages/next-swc/crates/napi/src/transform.rs"]
Emotion with SWC does not work with next/jest (Next 12.1.1)
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 20.6.0: Wed Jan 12 22:22:42 PST 2022; root:xnu-7195.141.19~2/RELEASE_X86_64 Binaries: Node: 16.13.2 npm: 8.1.2 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.1 react: 17.0.2 react-dom: 17.0.2 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug I've upgraded my next.js app to 12.1.1 and have enabled SWC and emotion in my next config via the `experimental: {emotion: true}` option My `jest.config.js` file looks like this: ```js const nextJest = require('next/jest'); const createJestConfig = nextJest({ dir: './src', }); const customJestConfig = {}; module.exports = createJestConfig(customJestConfig); ``` I have a component that uses the nested emotion selector that looks like this: ```js const Results = styled.div` margin: 0; padding: 0; `; const Container = styled.div` ${Results}:first-of-type { border-bottom: 1px solid #000; } `; ``` When I run the app using `next dev` or build with `next build` everything works, the SWC plugin is correctly able to handle the nested selectors. But when I run `jest`, it errors out with: ``` console.error Error: Uncaught [Error: Component selectors can only be used in conjunction with @emotion/babel-plugin.] ``` ### Expected Behavior `next/jest` correctly configures the swc emotion transform when `experimental: {emotion: true}` is set in the next config file ### To Reproduce I've set up a simple repo based on the `with-emotion-swc` example: https://github.com/pgrippi/nextjs-emotion-swc-jest-bug * Clone repo * `yarn install` * `yarn test` to see the jest failure * `yarn dev` / `yarn build` to see that the application works
https://github.com/vercel/next.js/issues/35661
https://github.com/vercel/next.js/pull/36500
9168b386ce3d0c2f574571e9b6a101d00593ec09
3ee42236d53f88294aca300f1d02087efbd21126
"2022-03-28T13:05:58Z"
javascript
"2022-04-28T02:09:49Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,607
["packages/create-next-app/index.ts", "test/integration/create-next-app/index.test.ts"]
Next.js - 12.1.1 -> not allowing npx create-next-app
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information 'next' is not recognized as an internal or external command, operable program or batch file. ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug after updating the `create-next-app` by `npm install -g create-next-app` after that when I am running the below command to start a Nextjs App, I am getting below error. ``` C:\Users\Dhaval Vira\Desktop\Coursera Learning\Next_Prisma>npx create-next-app demotwo Creating a new Next.js app in C:\Users\Dhaval Vira\Desktop\Coursera Learning\Next_Prisma\demotwo. Using yarn. Installing dependencies: - react - react-dom - next 'yarn' is not recognized as an internal or external command, operable program or batch file. node:events:504 throw er; // Unhandled 'error' event ^ Error: spawn yarn ENOENT at notFoundError (C:\Users\Dhaval Vira\AppData\Roaming\npm\node_modules\create-next-app\dist\index.js:100:3828) at verifyENOENT (C:\Users\Dhaval Vira\AppData\Roaming\npm\node_modules\create-next-app\dist\index.js:100:4207) at ChildProcess.e.emit (C:\Users\Dhaval Vira\AppData\Roaming\npm\node_modules\create-next-app\dist\index.js:100:4062) at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) Emitted 'error' event on ChildProcess instance at: at ChildProcess.e.emit (C:\Users\Dhaval Vira\AppData\Roaming\npm\node_modules\create-next-app\dist\index.js:100:4103) at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) { code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn yarn', path: 'yarn', spawnargs: [ 'add', '--exact', '--cwd', 'C:\\Users\\Dhaval Vira\\Desktop\\Coursera Learning\\Next_Prisma\\demotwo', 'react', 'react-dom', 'next' ] } ``` ### Expected Behavior after updating `create-next-app` to 12.1.1, `npx create-next-app appname` is not creating the Next app ### To Reproduce I tried `npx create-next-app@latest appname` but it's throwing the same error. even I tried to uninstall the `create-next-app` & reinstalled it but it's throwing the same error. and I install `yarn` globally then `npx create-next-app appname` run command properly without any error
https://github.com/vercel/next.js/issues/35607
https://github.com/vercel/next.js/pull/35608
d41f8a5ecf652ef1b9ee6e53aa7d543f2fc85cf6
3a313a4ca662846b6ed87cde7312e9cd7b3348eb
"2022-03-26T03:17:39Z"
javascript
"2022-03-26T08:29:52Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,599
["packages/create-next-app/index.ts", "test/integration/create-next-app/index.test.ts"]
create-next-app not working
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information node and npm version ![image](https://user-images.githubusercontent.com/83547807/160184976-f82fc108-e16d-4081-8f84-19232ebdd869.png) operating system windows 10 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug I try creating a next project with npx but in windows console this error: "'yarn' is not recognized as an internal or external command, operable program or batch file." ### Expected Behavior I'll intent build a nextjs project ### To Reproduce ### with @latest - ![image](https://user-images.githubusercontent.com/83547807/160184126-2b8d55d4-dc61-46e7-8d23-43573e477477.png) ### without @latest - ![image](https://user-images.githubusercontent.com/83547807/160184570-9d57e897-d366-482a-82c8-cce3fccf06ff.png)
https://github.com/vercel/next.js/issues/35599
https://github.com/vercel/next.js/pull/35608
d41f8a5ecf652ef1b9ee6e53aa7d543f2fc85cf6
3a313a4ca662846b6ed87cde7312e9cd7b3348eb
"2022-03-25T19:04:47Z"
javascript
"2022-03-26T08:29:52Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,573
["test/unit/web-runtime/next-response.test.ts"]
Middleware NextResponse duplication fails in dev
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 20.6.0: Wed Nov 10 22:23:07 PST 2021; root:xnu-7195.141.14~1/RELEASE_X86_64 Binaries: Node: 14.19.0 npm: 6.14.16 Yarn: 1.22.15 pnpm: N/A Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) vercel ### Describe the Bug The below example will return a valid response when deployed to Vercel. But when running locally you will get `[object Object]`. You may want to convert a response into a `NextResponse` in order to mutate headers, and access builtin `NextResponse` methods like `nextUrl` or `.cookie()`. ```javascript async function middleware() { const response = await fetch('https://www.vercel.com'); const clonedResponse = new NextResponse(response.body, response); return clonedResponse; } ``` Just using native `Response` works in both environments. ```javascript async function middleware() { const response = await fetch('https://www.vercel.com'); const clonedResponse = new Response(response.body, response); return clonedResponse; } ``` ### Expected Behavior I should be able to convert a `Response` into a `NextResponse` in both local dev AND when deployed to vercel. ### To Reproduce See code snippet above.
https://github.com/vercel/next.js/issues/35573
https://github.com/vercel/next.js/pull/37883
ee7648ae0aa4625a1af41834e1704872f2f24e9b
ff55e4a7f32cb9d109dec6810bdc208066117f16
"2022-03-24T13:30:33Z"
javascript
"2022-06-21T16:39:40Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,525
["examples/with-emotion-swc/pages/index.js", "examples/with-emotion-swc/shared/styles.js", "packages/next-swc/crates/core/src/emotion/mod.rs", "packages/next-swc/crates/core/tests/fixture/emotion/css-in-callback/input.tsx", "packages/next-swc/crates/core/tests/fixture/emotion/css-in-callback/output.ts"]
Component selector is not working on nested styled components
First of all thank you for the great work! Not sure if I should open another issue but I'm still having a problem after trying out the emotion transform. `Component selectors can only be used in conjunction with @emotion/babel-plugin` Here is an example repo with the issue. https://github.com/macko911/next-swc-emotion-component-selector Basically I've added only this component to the with-emotion-swc example from the Next.js repo. ```js export const ComponentSelectors = styled.div` ${Basic} { color: red; }` ``` Is this a feature that might come later, or will I have to refactor my code so that it doesn't rely on the component selector API? _Originally posted by @macko911 in https://github.com/vercel/next.js/issues/30804#issuecomment-1070964535_
https://github.com/vercel/next.js/issues/35525
https://github.com/vercel/next.js/pull/35527
ebe1b4cb47e2680cab214710aea4d782b885f405
59905c10018e08d50c319978d67fb6811575241a
"2022-03-22T15:11:37Z"
javascript
"2022-03-23T20:47:44Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,523
["docs/basic-features/data-fetching/incremental-static-regeneration.md"]
On-demand ISR do not work correctly
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` npx next info /bin/sh: pnpm: command not found Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 warn - Latest canary version not detected, detected: "12.1.0", newest: "12.1.1-canary.16". 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 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) Vercel ### Describe the Bug We have a NextJS front end and Sanity.io for the back end. I implement the on-demand ISR API on the `/api/revalidate` path, which is called whenever Sanity content changed. Before this, we use the time-based ISR, but I have removed that part of the code. When deploy on Vercel, I tested by modifying the content in Sanity and it works correctly: the API is called and the page is updated, but if I make the next changes within a few minutes or so, the page won't update, even though the API is called properly in the log without catching any error. This happens most of the time, but not all the time. Sometimes, I try to trigger the API call from Insomnia, the page update again with the latest info. But most of the time, I have to wait a few mins, change the content in Sanity and `Publish` again for it to work. If I wait for a few minutes after the first revalidation and call the API again, most of the time, the page is updated correctly. But still, not all the time. I wonder if this has anything to do with the fact that we used time-based revalidation before. Maybe some caching laying around, not sure. On an addition note, when I test the revalidate API call from Insomnia, for both local prod build or Vercel deployed build, sometimes, it takes a whole minute to resolve the query. So one of the possibility is that Vercel has a timeout config for a function call. Also another quick note that might help others: we use [Next middleware auth](https://github.com/vercel/examples/blob/main/edge-functions/basic-auth-password/pages/_middleware.ts) to block people from visiting our development page, when I call the `revalidation` API, it is blocked by the popup therefore only always throw errors. The error message was only `Failed to revalidate ${urlPath}` and I was only able to fix it by deep-dive into the function. Maybe throwing the error with the actual result of the `fetch` instead would be more helpful? :) Thank you! ### Expected Behavior Whenever the `/api/revalidate` API call, force update the page content ### To Reproduce ![image](https://user-images.githubusercontent.com/14198542/159480104-d252a71c-3093-4a1a-862a-75dc498a63fd.png) ![image](https://user-images.githubusercontent.com/14198542/159480461-68a13a29-453c-45d0-a65e-032acc84111e.png)
https://github.com/vercel/next.js/issues/35523
https://github.com/vercel/next.js/pull/38014
f4fb3e0377909516b864d5c3114312745f124132
a148d1426d0b0fa80458971389bff0d4458a3857
"2022-03-22T12:26:54Z"
javascript
"2022-06-25T16:26:12Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,519
["packages/next/server/web/next-url.ts"]
NextRequest.nextUrl is an empty object {} when deployed on Vercel
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.4.0: Mon Feb 21 20:35:58 PST 2022; root:xnu-8020.101.4~2/RELEASE_ARM64_T6000 Binaries: Node: 14.19.1 npm: 6.14.16 Yarn: 1.22.18 pnpm: 6.11.0 Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 warn - Latest canary version not detected, detected: "12.1.0", newest: "12.1.1-canary.16". 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 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug According to [docs](https://nextjs.org/docs/api-reference/next/server#nextrequest), `NextRequest.nextUrl` should contain > nextUrl - Includes an extended, parsed, URL object that gives you access to Next.js specific properties such as pathname, basePath, trailingSlash and i18n but the following prints `{}` in console.log ``` // pages/_middleware.ts import type { NextFetchEvent, NextRequest } from 'next/server' export function middleware(req: NextRequest, ev: NextFetchEvent) { console.log(req.nextUrl) return new Response('Hello, world!') } ``` Tested on `next@latest` and `[email protected]`. ### Expected Behavior ``` // pages/_middleware.ts import type { NextFetchEvent, NextRequest } from 'next/server' export function middleware(req: NextRequest, ev: NextFetchEvent) { console.log(req.nextUrl) return new Response('Hello, world!') } ``` seems to be working when `yarn dev`: ``` NextURL { [Symbol(NextURLInternal)]: { url: URL { href: 'http://localhost:3001/robots.txt?1647936635339', origin: 'http://localhost:3001', protocol: 'http:', username: '', password: '', host: 'localhost:3001', hostname: 'localhost', port: '3001', pathname: '/robots.txt', search: '?1647936635339', searchParams: URLSearchParams { '1647936635339' => '' }, hash: '' }, options: { basePath: '', headers: [Object], i18n: null, trailingSlash: false }, basePath: '' } } ``` ### To Reproduce Create new Next.js project, add the following `_middleware` and deploy on Vercel: ``` // pages/_middleware.ts import type { NextFetchEvent, NextRequest } from 'next/server' export function middleware(req: NextRequest, ev: NextFetchEvent) { console.log(req.nextUrl) return new Response('Hello, world!') } ``` ### Related Issues: 1. https://github.com/vercel/next.js/issues/35273#issuecomment-1071032527
https://github.com/vercel/next.js/issues/35519
https://github.com/vercel/next.js/pull/36097
da6f271d9be8eb96727d8a8079d0b01aabb36faa
46d3f0e216c44d551f899bf53779dc0789525e6a
"2022-03-22T08:57:18Z"
javascript
"2022-04-12T15:31:29Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,518
["package.json", "packages/next/package.json", "packages/react-refresh-utils/package.json", "run-tests.js", "test/development/basic/hmr.test.ts", "test/e2e/next-head/index.test.ts", "test/e2e/next-script-worker-strategy/index.test.ts", "test/lib/next-modes/base.ts", "test/production/react-18-streaming-ssr/index.test.ts", "yarn.lock"]
Fast refresh/hot reloading not working on latest canary release with react 18 (WSL, Windows 10)
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` /bin/sh: 1: yarn: not found /bin/sh: 1: pnpm: not found Operating System: Platform: linux Arch: x64 Version: #1 SMP Tue Jun 23 12:58:10 UTC 2020 Binaries: Node: 16.14.2 npm: 8.5.0 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.1-canary.16 react: 18.0.0-rc.3 react-dom: 18.0.0-rc.3 ``` ### What browser are you using? (if relevant) Chrome Version 99.0.4844.82 (Official Build) (64-bit) ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug Fast refresh/hot reloading does not refresh the page when saving components/pages on latest canary release of next with latest release candidates of react (react18), running on WSL Ubuntu20.04LTS (Windows 10). I also tried on WSL Ubuntu18.04LTS and the same problem occurred. Since, I also found this discussion about [Fast Refresh not working on WSL Windows 10](https://github.com/vercel/next.js/issues/new?assignees=&labels=template%3A+bug&template=1.bug_report.yml), I tried running the development server as suggested in that discussion`next dev -H ::`, but that didn't fix it. Linked discussions/issues: - https://github.com/vercel/next.js/discussions/22214 - https://github.com/vercel/next.js/pull/20409 ### Expected Behavior Fast refresh should update the content of the page without having to manually reload the page. As a comparison, I tried running latest stable release of next with react 17.0.2 and the fast refresh works as expected and content gets updated when file is saved. ``` /bin/sh: 1: yarn: not found /bin/sh: 1: pnpm: not found Operating System: Platform: linux Arch: x64 Version: #1 SMP Tue Jun 23 12:58:10 UTC 2020 Binaries: Node: 16.14.2 npm: 8.5.0 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 warn - Latest canary version not detected, detected: "12.1.0", newest: "12.1.1-canary.16". 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 ``` ### To Reproduce First install the correct versions ``` npx create-next-app next-fast-refresh npm install next@canary react@rc react-dom@rc npm run dev ``` Then the steps: 1. Initial loading ![image](https://user-images.githubusercontent.com/395669/159431950-1451d393-3ecb-4b41-a8f0-9ce0433fc71c.png) 2. Edit index.js (changed the text of the title to "Welcome to Next.js!!!!") ![image](https://user-images.githubusercontent.com/395669/159432281-368d448c-ce90-40da-93fb-82be96c88d25.png) 3. Although there are network updates, the text does not change ![image](https://user-images.githubusercontent.com/395669/159432655-3dbd809f-e5f5-4201-8fd6-c1e08d498c13.png) http://localhost:3000/_next/static/webpack/pages/index.dfce9c9e68b9cbf0.hot-update.js ``` "use strict"; /* * ATTENTION: An "eval-source-map" devtool has been used. * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ self["webpackHotUpdate_N_E"]("pages/index",{ /***/ "./pages/index.js": /*!************************!*\ !*** ./pages/index.js ***! \************************/ /***/ (function(module, __webpack_exports__, __webpack_require__) { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ Home; }\n/* harmony export */ });\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ \"./node_modules/react/jsx-dev-runtime.js\");\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var next_head__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! next/head */ \"./node_modules/next/head.js\");\n/* harmony import */ var next_head__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_head__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! next/image */ \"./node_modules/next/image.js\");\n/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../styles/Home.module.css */ \"./styles/Home.module.css\");\n/* harmony import */ var _styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\nfunction Home() {\n return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().container),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_head__WEBPACK_IMPORTED_MODULE_1___default()), {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"title\", {\n children: \"Create Next App\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 9,\n columnNumber: 9\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"meta\", {\n name: \"description\",\n content: \"Generated by create next app\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 10,\n columnNumber: 9\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"link\", {\n rel: \"icon\",\n href: \"/favicon.ico\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 11,\n columnNumber: 9\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 8,\n columnNumber: 7\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"main\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().main),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h1\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().title),\n children: [\n \"Welcome to \",\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: \"https://nextjs.org\",\n children: \"Next.js!!!!\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 16,\n columnNumber: 22\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 15,\n columnNumber: 9\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().description),\n children: [\n \"Get started by editing\",\n ' ',\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"code\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().code),\n children: \"pages/index.js\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 21,\n columnNumber: 11\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 19,\n columnNumber: 9\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().grid),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: \"https://nextjs.org/docs\",\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().card),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h2\", {\n children: \"Documentation →\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 26,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n children: \"Find in-depth information about Next.js features and API.\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 27,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 25,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: \"https://nextjs.org/learn\",\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().card),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h2\", {\n children: \"Learn →\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 31,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n children: \"Learn about Next.js in an interactive course with quizzes!\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 32,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 30,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: \"https://github.com/vercel/next.js/tree/canary/examples\",\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().card),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h2\", {\n children: \"Examples →\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 39,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n children: \"Discover and deploy boilerplate example Next.js projects.\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 40,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 35,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: \"https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app\",\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().card),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h2\", {\n children: \"Deploy →\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 47,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n children: \"Instantly deploy your Next.js site to a public URL with Vercel.\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 48,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 43,\n columnNumber: 11\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 24,\n columnNumber: 9\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 14,\n columnNumber: 7\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"footer\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().footer),\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: \"https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app\",\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n children: [\n \"Powered by\",\n ' ',\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().logo),\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {\n src: \"/vercel.svg\",\n alt: \"Vercel Logo\",\n width: 72,\n height: 16\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 63,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 62,\n columnNumber: 11\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 56,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 55,\n columnNumber: 7\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 7,\n columnNumber: 5\n }, this);\n};\n_c = Home;\nvar _c;\n$RefreshReg$(_c, \"Home\");\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9wYWdlcy9pbmRleC5qcy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7O0FBQTRCO0FBQ0U7QUFDZ0I7QUFFL0IsUUFBUSxDQUFDRyxJQUFJLEdBQUcsQ0FBQztJQUM5QixNQUFNLDZFQUNIQyxDQUFHO1FBQUNDLFNBQVMsRUFBRUgsMEVBQWdCOzt3RkFDN0JGLGtEQUFJOztnR0FDRk8sQ0FBSztrQ0FBQyxDQUFlOzs7Ozs7Z0dBQ3JCQyxDQUFJO3dCQUFDQyxJQUFJLEVBQUMsQ0FBYTt3QkFBQ0MsT0FBTyxFQUFDLENBQThCOzs7Ozs7Z0dBQzlEQyxDQUFJO3dCQUFDQyxHQUFHLEVBQUMsQ0FBTTt3QkFBQ0MsSUFBSSxFQUFDLENBQWM7Ozs7Ozs7Ozs7Ozt3RkFHckNDLENBQUk7Z0JBQUNULFNBQVMsRUFBRUgscUVBQVc7O2dHQUN6QmEsQ0FBRTt3QkFBQ1YsU0FBUyxFQUFFSCxzRUFBWTs7NEJBQUUsQ0FDaEI7d0dBQUNjLENBQUM7Z0NBQUNILElBQUksRUFBQyxDQUFvQjswQ0FBQyxDQUFXOzs7Ozs7Ozs7Ozs7Z0dBR3BESSxDQUFDO3dCQUFDWixTQUFTLEVBQUVILDRFQUFrQjs7NEJBQUUsQ0FDVjs0QkFBQyxDQUFHO3dHQUN6QmlCLENBQUk7Z0NBQUNkLFNBQVMsRUFBRUgscUVBQVc7MENBQUUsQ0FBYzs7Ozs7Ozs7Ozs7O2dHQUc3Q0UsQ0FBRzt3QkFBQ0MsU0FBUyxFQUFFSCxxRUFBVzs7d0dBQ3hCYyxDQUFDO2dDQUFDSCxJQUFJLEVBQUMsQ0FBeUI7Z0NBQUNSLFNBQVMsRUFBRUgscUVBQVc7O2dIQUNyRG9CLENBQUU7a0RBQUMsQ0FBb0I7Ozs7OztnSEFDdkJMLENBQUM7a0RBQUMsQ0FBeUQ7Ozs7Ozs7Ozs7Ozt3R0FHN0RELENBQUM7Z0NBQUNILElBQUksRUFBQyxDQUEwQjtnQ0FBQ1IsU0FBUyxFQUFFSCxxRUFBVzs7Z0hBQ3REb0IsQ0FBRTtrREFBQyxDQUFZOzs7Ozs7Z0hBQ2ZMLENBQUM7a0RBQUMsQ0FBMEQ7Ozs7Ozs7Ozs7Ozt3R0FHOURELENBQUM7Z0NBQ0FILElBQUksRUFBQyxDQUF3RDtnQ0FDN0RSLFNBQVMsRUFBRUgscUVBQVc7O2dIQUVyQm9CLENBQUU7a0RBQUMsQ0FBZTs7Ozs7O2dIQUNsQkwsQ0FBQztrREFBQyxDQUF5RDs7Ozs7Ozs7Ozs7O3dHQUc3REQsQ0FBQztnQ0FDQUgsSUFBSSxFQUFDLENBQTRHO2dDQUNqSFIsU0FBUyxFQUFFSCxxRUFBVzs7Z0hBRXJCb0IsQ0FBRTtrREFBQyxDQUFhOzs7Ozs7Z0hBQ2hCTCxDQUFDO2tEQUFDLENBRUg7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozt3RkFLTE0sQ0FBTTtnQkFBQ2xCLFNBQVMsRUFBRUgsdUVBQWE7c0dBQzdCYyxDQUFDO29CQUNBSCxJQUFJLEVBQUMsQ0FBd0c7b0JBQzdHVyxNQUFNLEVBQUMsQ0FBUTtvQkFDZlosR0FBRyxFQUFDLENBQXFCOzt3QkFDMUIsQ0FDVzt3QkFBQyxDQUFHO29HQUNiYSxDQUFJOzRCQUFDcEIsU0FBUyxFQUFFSCxxRUFBVztrSEFDekJELG1EQUFLO2dDQUFDMEIsR0FBRyxFQUFDLENBQWE7Z0NBQUNDLEdBQUcsRUFBQyxDQUFhO2dDQUFDQyxLQUFLLEVBQUUsRUFBRTtnQ0FBRUMsTUFBTSxFQUFFLEVBQUU7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFNNUUsQ0FBQztLQWhFdUIzQixJQUFJIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vX05fRS8uL3BhZ2VzL2luZGV4LmpzP2JlZTciXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IEhlYWQgZnJvbSAnbmV4dC9oZWFkJ1xuaW1wb3J0IEltYWdlIGZyb20gJ25leHQvaW1hZ2UnXG5pbXBvcnQgc3R5bGVzIGZyb20gJy4uL3N0eWxlcy9Ib21lLm1vZHVsZS5jc3MnXG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIEhvbWUoKSB7XG4gIHJldHVybiAoXG4gICAgPGRpdiBjbGFzc05hbWU9e3N0eWxlcy5jb250YWluZXJ9PlxuICAgICAgPEhlYWQ+XG4gICAgICAgIDx0aXRsZT5DcmVhdGUgTmV4dCBBcHA8L3RpdGxlPlxuICAgICAgICA8bWV0YSBuYW1lPVwiZGVzY3JpcHRpb25cIiBjb250ZW50PVwiR2VuZXJhdGVkIGJ5IGNyZWF0ZSBuZXh0IGFwcFwiIC8+XG4gICAgICAgIDxsaW5rIHJlbD1cImljb25cIiBocmVmPVwiL2Zhdmljb24uaWNvXCIgLz5cbiAgICAgIDwvSGVhZD5cblxuICAgICAgPG1haW4gY2xhc3NOYW1lPXtzdHlsZXMubWFpbn0+XG4gICAgICAgIDxoMSBjbGFzc05hbWU9e3N0eWxlcy50aXRsZX0+XG4gICAgICAgICAgV2VsY29tZSB0byA8YSBocmVmPVwiaHR0cHM6Ly9uZXh0anMub3JnXCI+TmV4dC5qcyEhISE8L2E+XG4gICAgICAgIDwvaDE+XG5cbiAgICAgICAgPHAgY2xhc3NOYW1lPXtzdHlsZXMuZGVzY3JpcHRpb259PlxuICAgICAgICAgIEdldCBzdGFydGVkIGJ5IGVkaXRpbmd7JyAnfVxuICAgICAgICAgIDxjb2RlIGNsYXNzTmFtZT17c3R5bGVzLmNvZGV9PnBhZ2VzL2luZGV4LmpzPC9jb2RlPlxuICAgICAgICA8L3A+XG5cbiAgICAgICAgPGRpdiBjbGFzc05hbWU9e3N0eWxlcy5ncmlkfT5cbiAgICAgICAgICA8YSBocmVmPVwiaHR0cHM6Ly9uZXh0anMub3JnL2RvY3NcIiBjbGFzc05hbWU9e3N0eWxlcy5jYXJkfT5cbiAgICAgICAgICAgIDxoMj5Eb2N1bWVudGF0aW9uICZyYXJyOzwvaDI+XG4gICAgICAgICAgICA8cD5GaW5kIGluLWRlcHRoIGluZm9ybWF0aW9uIGFib3V0IE5leHQuanMgZmVhdHVyZXMgYW5kIEFQSS48L3A+XG4gICAgICAgICAgPC9hPlxuXG4gICAgICAgICAgPGEgaHJlZj1cImh0dHBzOi8vbmV4dGpzLm9yZy9sZWFyblwiIGNsYXNzTmFtZT17c3R5bGVzLmNhcmR9PlxuICAgICAgICAgICAgPGgyPkxlYXJuICZyYXJyOzwvaDI+XG4gICAgICAgICAgICA8cD5MZWFybiBhYm91dCBOZXh0LmpzIGluIGFuIGludGVyYWN0aXZlIGNvdXJzZSB3aXRoIHF1aXp6ZXMhPC9wPlxuICAgICAgICAgIDwvYT5cblxuICAgICAgICAgIDxhXG4gICAgICAgICAgICBocmVmPVwiaHR0cHM6Ly9naXRodWIuY29tL3ZlcmNlbC9uZXh0LmpzL3RyZWUvY2FuYXJ5L2V4YW1wbGVzXCJcbiAgICAgICAgICAgIGNsYXNzTmFtZT17c3R5bGVzLmNhcmR9XG4gICAgICAgICAgPlxuICAgICAgICAgICAgPGgyPkV4YW1wbGVzICZyYXJyOzwvaDI+XG4gICAgICAgICAgICA8cD5EaXNjb3ZlciBhbmQgZGVwbG95IGJvaWxlcnBsYXRlIGV4YW1wbGUgTmV4dC5qcyBwcm9qZWN0cy48L3A+XG4gICAgICAgICAgPC9hPlxuXG4gICAgICAgICAgPGFcbiAgICAgICAgICAgIGhyZWY9XCJodHRwczovL3ZlcmNlbC5jb20vbmV3P3V0bV9zb3VyY2U9Y3JlYXRlLW5leHQtYXBwJnV0bV9tZWRpdW09ZGVmYXVsdC10ZW1wbGF0ZSZ1dG1fY2FtcGFpZ249Y3JlYXRlLW5leHQtYXBwXCJcbiAgICAgICAgICAgIGNsYXNzTmFtZT17c3R5bGVzLmNhcmR9XG4gICAgICAgICAgPlxuICAgICAgICAgICAgPGgyPkRlcGxveSAmcmFycjs8L2gyPlxuICAgICAgICAgICAgPHA+XG4gICAgICAgICAgICAgIEluc3RhbnRseSBkZXBsb3kgeW91ciBOZXh0LmpzIHNpdGUgdG8gYSBwdWJsaWMgVVJMIHdpdGggVmVyY2VsLlxuICAgICAgICAgICAgPC9wPlxuICAgICAgICAgIDwvYT5cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L21haW4+XG5cbiAgICAgIDxmb290ZXIgY2xhc3NOYW1lPXtzdHlsZXMuZm9vdGVyfT5cbiAgICAgICAgPGFcbiAgICAgICAgICBocmVmPVwiaHR0cHM6Ly92ZXJjZWwuY29tP3V0bV9zb3VyY2U9Y3JlYXRlLW5leHQtYXBwJnV0bV9tZWRpdW09ZGVmYXVsdC10ZW1wbGF0ZSZ1dG1fY2FtcGFpZ249Y3JlYXRlLW5leHQtYXBwXCJcbiAgICAgICAgICB0YXJnZXQ9XCJfYmxhbmtcIlxuICAgICAgICAgIHJlbD1cIm5vb3BlbmVyIG5vcmVmZXJyZXJcIlxuICAgICAgICA+XG4gICAgICAgICAgUG93ZXJlZCBieXsnICd9XG4gICAgICAgICAgPHNwYW4gY2xhc3NOYW1lPXtzdHlsZXMubG9nb30+XG4gICAgICAgICAgICA8SW1hZ2Ugc3JjPVwiL3ZlcmNlbC5zdmdcIiBhbHQ9XCJWZXJjZWwgTG9nb1wiIHdpZHRoPXs3Mn0gaGVpZ2h0PXsxNn0gLz5cbiAgICAgICAgICA8L3NwYW4+XG4gICAgICAgIDwvYT5cbiAgICAgIDwvZm9vdGVyPlxuICAgIDwvZGl2PlxuICApXG59XG4iXSwibmFtZXMiOlsiSGVhZCIsIkltYWdlIiwic3R5bGVzIiwiSG9tZSIsImRpdiIsImNsYXNzTmFtZSIsImNvbnRhaW5lciIsInRpdGxlIiwibWV0YSIsIm5hbWUiLCJjb250ZW50IiwibGluayIsInJlbCIsImhyZWYiLCJtYWluIiwiaDEiLCJhIiwicCIsImRlc2NyaXB0aW9uIiwiY29kZSIsImdyaWQiLCJjYXJkIiwiaDIiLCJmb290ZXIiLCJ0YXJnZXQiLCJzcGFuIiwibG9nbyIsInNyYyIsImFsdCIsIndpZHRoIiwiaGVpZ2h0Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./pages/index.js\n"); /***/ }) }); ``` http://localhost:3000/_next/static/webpack/webpack.dfce9c9e68b9cbf0.hot-update.js ``` "use strict"; /* * ATTENTION: An "eval-source-map" devtool has been used. * This devtool is neither made for production nor for readable output files. * It uses "eval()" calls to create a separate source file with attached SourceMaps in the browser devtools. * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) * or disable the default devtool with "devtool: false". * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). */ self["webpackHotUpdate_N_E"]("pages/index",{ /***/ "./pages/index.js": /*!************************!*\ !*** ./pages/index.js ***! \************************/ /***/ (function(module, __webpack_exports__, __webpack_require__) { eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ Home; }\n/* harmony export */ });\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-dev-runtime */ \"./node_modules/react/jsx-dev-runtime.js\");\n/* harmony import */ var react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var next_head__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! next/head */ \"./node_modules/next/head.js\");\n/* harmony import */ var next_head__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(next_head__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! next/image */ \"./node_modules/next/image.js\");\n/* harmony import */ var next_image__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_image__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../styles/Home.module.css */ \"./styles/Home.module.css\");\n/* harmony import */ var _styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\nfunction Home() {\n return /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().container),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_head__WEBPACK_IMPORTED_MODULE_1___default()), {\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"title\", {\n children: \"Create Next App\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 9,\n columnNumber: 9\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"meta\", {\n name: \"description\",\n content: \"Generated by create next app\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 10,\n columnNumber: 9\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"link\", {\n rel: \"icon\",\n href: \"/favicon.ico\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 11,\n columnNumber: 9\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 8,\n columnNumber: 7\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"main\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().main),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h1\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().title),\n children: [\n \"Welcome to \",\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: \"https://nextjs.org\",\n children: \"Next.js!!!!\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 16,\n columnNumber: 22\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 15,\n columnNumber: 9\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().description),\n children: [\n \"Get started by editing\",\n ' ',\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"code\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().code),\n children: \"pages/index.js\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 21,\n columnNumber: 11\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 19,\n columnNumber: 9\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"div\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().grid),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: \"https://nextjs.org/docs\",\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().card),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h2\", {\n children: \"Documentation →\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 26,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n children: \"Find in-depth information about Next.js features and API.\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 27,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 25,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: \"https://nextjs.org/learn\",\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().card),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h2\", {\n children: \"Learn →\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 31,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n children: \"Learn about Next.js in an interactive course with quizzes!\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 32,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 30,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: \"https://github.com/vercel/next.js/tree/canary/examples\",\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().card),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h2\", {\n children: \"Examples →\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 39,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n children: \"Discover and deploy boilerplate example Next.js projects.\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 40,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 35,\n columnNumber: 11\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: \"https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app\",\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().card),\n children: [\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"h2\", {\n children: \"Deploy →\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 47,\n columnNumber: 13\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"p\", {\n children: \"Instantly deploy your Next.js site to a public URL with Vercel.\"\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 48,\n columnNumber: 13\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 43,\n columnNumber: 11\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 24,\n columnNumber: 9\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 14,\n columnNumber: 7\n }, this),\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"footer\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().footer),\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"a\", {\n href: \"https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app\",\n target: \"_blank\",\n rel: \"noopener noreferrer\",\n children: [\n \"Powered by\",\n ' ',\n /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)(\"span\", {\n className: (_styles_Home_module_css__WEBPACK_IMPORTED_MODULE_3___default().logo),\n children: /*#__PURE__*/ (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxDEV)((next_image__WEBPACK_IMPORTED_MODULE_2___default()), {\n src: \"/vercel.svg\",\n alt: \"Vercel Logo\",\n width: 72,\n height: 16\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 63,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 62,\n columnNumber: 11\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 56,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 55,\n columnNumber: 7\n }, this)\n ]\n }, void 0, true, {\n fileName: \"/home/a/projects/next-latest/pages/index.js\",\n lineNumber: 7,\n columnNumber: 5\n }, this);\n};\n_c = Home;\nvar _c;\n$RefreshReg$(_c, \"Home\");\n\n\n;\n // Wrapped in an IIFE to avoid polluting the global scope\n ;\n (function () {\n var _a, _b;\n // Legacy CSS implementations will `eval` browser code in a Node.js context\n // to extract CSS. For backwards compatibility, we need to check we're in a\n // browser context before continuing.\n if (typeof self !== 'undefined' &&\n // AMP / No-JS mode does not inject these helpers:\n '$RefreshHelpers$' in self) {\n // @ts-ignore __webpack_module__ is global\n var currentExports = module.exports;\n // @ts-ignore __webpack_module__ is global\n var prevExports = (_b = (_a = module.hot.data) === null || _a === void 0 ? void 0 : _a.prevExports) !== null && _b !== void 0 ? _b : null;\n // This cannot happen in MainTemplate because the exports mismatch between\n // templating and execution.\n self.$RefreshHelpers$.registerExportsForReactRefresh(currentExports, module.id);\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (self.$RefreshHelpers$.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update so we can compare the boundary\n // signatures.\n module.hot.dispose(function (data) {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n // @ts-ignore importMeta is replaced in the loader\n module.hot.accept();\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (self.$RefreshHelpers$.shouldInvalidateReactRefreshBoundary(prevExports, currentExports)) {\n module.hot.invalidate();\n }\n else {\n self.$RefreshHelpers$.scheduleUpdate();\n }\n }\n }\n else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n var isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n }\n })();\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9wYWdlcy9pbmRleC5qcy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7O0FBQTRCO0FBQ0U7QUFDZ0I7QUFFL0IsUUFBUSxDQUFDRyxJQUFJLEdBQUcsQ0FBQztJQUM5QixNQUFNLDZFQUNIQyxDQUFHO1FBQUNDLFNBQVMsRUFBRUgsMEVBQWdCOzt3RkFDN0JGLGtEQUFJOztnR0FDRk8sQ0FBSztrQ0FBQyxDQUFlOzs7Ozs7Z0dBQ3JCQyxDQUFJO3dCQUFDQyxJQUFJLEVBQUMsQ0FBYTt3QkFBQ0MsT0FBTyxFQUFDLENBQThCOzs7Ozs7Z0dBQzlEQyxDQUFJO3dCQUFDQyxHQUFHLEVBQUMsQ0FBTTt3QkFBQ0MsSUFBSSxFQUFDLENBQWM7Ozs7Ozs7Ozs7Ozt3RkFHckNDLENBQUk7Z0JBQUNULFNBQVMsRUFBRUgscUVBQVc7O2dHQUN6QmEsQ0FBRTt3QkFBQ1YsU0FBUyxFQUFFSCxzRUFBWTs7NEJBQUUsQ0FDaEI7d0dBQUNjLENBQUM7Z0NBQUNILElBQUksRUFBQyxDQUFvQjswQ0FBQyxDQUFXOzs7Ozs7Ozs7Ozs7Z0dBR3BESSxDQUFDO3dCQUFDWixTQUFTLEVBQUVILDRFQUFrQjs7NEJBQUUsQ0FDVjs0QkFBQyxDQUFHO3dHQUN6QmlCLENBQUk7Z0NBQUNkLFNBQVMsRUFBRUgscUVBQVc7MENBQUUsQ0FBYzs7Ozs7Ozs7Ozs7O2dHQUc3Q0UsQ0FBRzt3QkFBQ0MsU0FBUyxFQUFFSCxxRUFBVzs7d0dBQ3hCYyxDQUFDO2dDQUFDSCxJQUFJLEVBQUMsQ0FBeUI7Z0NBQUNSLFNBQVMsRUFBRUgscUVBQVc7O2dIQUNyRG9CLENBQUU7a0RBQUMsQ0FBb0I7Ozs7OztnSEFDdkJMLENBQUM7a0RBQUMsQ0FBeUQ7Ozs7Ozs7Ozs7Ozt3R0FHN0RELENBQUM7Z0NBQUNILElBQUksRUFBQyxDQUEwQjtnQ0FBQ1IsU0FBUyxFQUFFSCxxRUFBVzs7Z0hBQ3REb0IsQ0FBRTtrREFBQyxDQUFZOzs7Ozs7Z0hBQ2ZMLENBQUM7a0RBQUMsQ0FBMEQ7Ozs7Ozs7Ozs7Ozt3R0FHOURELENBQUM7Z0NBQ0FILElBQUksRUFBQyxDQUF3RDtnQ0FDN0RSLFNBQVMsRUFBRUgscUVBQVc7O2dIQUVyQm9CLENBQUU7a0RBQUMsQ0FBZTs7Ozs7O2dIQUNsQkwsQ0FBQztrREFBQyxDQUF5RDs7Ozs7Ozs7Ozs7O3dHQUc3REQsQ0FBQztnQ0FDQUgsSUFBSSxFQUFDLENBQTRHO2dDQUNqSFIsU0FBUyxFQUFFSCxxRUFBVzs7Z0hBRXJCb0IsQ0FBRTtrREFBQyxDQUFhOzs7Ozs7Z0hBQ2hCTCxDQUFDO2tEQUFDLENBRUg7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozt3RkFLTE0sQ0FBTTtnQkFBQ2xCLFNBQVMsRUFBRUgsdUVBQWE7c0dBQzdCYyxDQUFDO29CQUNBSCxJQUFJLEVBQUMsQ0FBd0c7b0JBQzdHVyxNQUFNLEVBQUMsQ0FBUTtvQkFDZlosR0FBRyxFQUFDLENBQXFCOzt3QkFDMUIsQ0FDVzt3QkFBQyxDQUFHO29HQUNiYSxDQUFJOzRCQUFDcEIsU0FBUyxFQUFFSCxxRUFBVztrSEFDekJELG1EQUFLO2dDQUFDMEIsR0FBRyxFQUFDLENBQWE7Z0NBQUNDLEdBQUcsRUFBQyxDQUFhO2dDQUFDQyxLQUFLLEVBQUUsRUFBRTtnQ0FBRUMsTUFBTSxFQUFFLEVBQUU7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFNNUUsQ0FBQztLQWhFdUIzQixJQUFJIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vX05fRS8uL3BhZ2VzL2luZGV4LmpzP2JlZTciXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IEhlYWQgZnJvbSAnbmV4dC9oZWFkJ1xuaW1wb3J0IEltYWdlIGZyb20gJ25leHQvaW1hZ2UnXG5pbXBvcnQgc3R5bGVzIGZyb20gJy4uL3N0eWxlcy9Ib21lLm1vZHVsZS5jc3MnXG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIEhvbWUoKSB7XG4gIHJldHVybiAoXG4gICAgPGRpdiBjbGFzc05hbWU9e3N0eWxlcy5jb250YWluZXJ9PlxuICAgICAgPEhlYWQ+XG4gICAgICAgIDx0aXRsZT5DcmVhdGUgTmV4dCBBcHA8L3RpdGxlPlxuICAgICAgICA8bWV0YSBuYW1lPVwiZGVzY3JpcHRpb25cIiBjb250ZW50PVwiR2VuZXJhdGVkIGJ5IGNyZWF0ZSBuZXh0IGFwcFwiIC8+XG4gICAgICAgIDxsaW5rIHJlbD1cImljb25cIiBocmVmPVwiL2Zhdmljb24uaWNvXCIgLz5cbiAgICAgIDwvSGVhZD5cblxuICAgICAgPG1haW4gY2xhc3NOYW1lPXtzdHlsZXMubWFpbn0+XG4gICAgICAgIDxoMSBjbGFzc05hbWU9e3N0eWxlcy50aXRsZX0+XG4gICAgICAgICAgV2VsY29tZSB0byA8YSBocmVmPVwiaHR0cHM6Ly9uZXh0anMub3JnXCI+TmV4dC5qcyEhISE8L2E+XG4gICAgICAgIDwvaDE+XG5cbiAgICAgICAgPHAgY2xhc3NOYW1lPXtzdHlsZXMuZGVzY3JpcHRpb259PlxuICAgICAgICAgIEdldCBzdGFydGVkIGJ5IGVkaXRpbmd7JyAnfVxuICAgICAgICAgIDxjb2RlIGNsYXNzTmFtZT17c3R5bGVzLmNvZGV9PnBhZ2VzL2luZGV4LmpzPC9jb2RlPlxuICAgICAgICA8L3A+XG5cbiAgICAgICAgPGRpdiBjbGFzc05hbWU9e3N0eWxlcy5ncmlkfT5cbiAgICAgICAgICA8YSBocmVmPVwiaHR0cHM6Ly9uZXh0anMub3JnL2RvY3NcIiBjbGFzc05hbWU9e3N0eWxlcy5jYXJkfT5cbiAgICAgICAgICAgIDxoMj5Eb2N1bWVudGF0aW9uICZyYXJyOzwvaDI+XG4gICAgICAgICAgICA8cD5GaW5kIGluLWRlcHRoIGluZm9ybWF0aW9uIGFib3V0IE5leHQuanMgZmVhdHVyZXMgYW5kIEFQSS48L3A+XG4gICAgICAgICAgPC9hPlxuXG4gICAgICAgICAgPGEgaHJlZj1cImh0dHBzOi8vbmV4dGpzLm9yZy9sZWFyblwiIGNsYXNzTmFtZT17c3R5bGVzLmNhcmR9PlxuICAgICAgICAgICAgPGgyPkxlYXJuICZyYXJyOzwvaDI+XG4gICAgICAgICAgICA8cD5MZWFybiBhYm91dCBOZXh0LmpzIGluIGFuIGludGVyYWN0aXZlIGNvdXJzZSB3aXRoIHF1aXp6ZXMhPC9wPlxuICAgICAgICAgIDwvYT5cblxuICAgICAgICAgIDxhXG4gICAgICAgICAgICBocmVmPVwiaHR0cHM6Ly9naXRodWIuY29tL3ZlcmNlbC9uZXh0LmpzL3RyZWUvY2FuYXJ5L2V4YW1wbGVzXCJcbiAgICAgICAgICAgIGNsYXNzTmFtZT17c3R5bGVzLmNhcmR9XG4gICAgICAgICAgPlxuICAgICAgICAgICAgPGgyPkV4YW1wbGVzICZyYXJyOzwvaDI+XG4gICAgICAgICAgICA8cD5EaXNjb3ZlciBhbmQgZGVwbG95IGJvaWxlcnBsYXRlIGV4YW1wbGUgTmV4dC5qcyBwcm9qZWN0cy48L3A+XG4gICAgICAgICAgPC9hPlxuXG4gICAgICAgICAgPGFcbiAgICAgICAgICAgIGhyZWY9XCJodHRwczovL3ZlcmNlbC5jb20vbmV3P3V0bV9zb3VyY2U9Y3JlYXRlLW5leHQtYXBwJnV0bV9tZWRpdW09ZGVmYXVsdC10ZW1wbGF0ZSZ1dG1fY2FtcGFpZ249Y3JlYXRlLW5leHQtYXBwXCJcbiAgICAgICAgICAgIGNsYXNzTmFtZT17c3R5bGVzLmNhcmR9XG4gICAgICAgICAgPlxuICAgICAgICAgICAgPGgyPkRlcGxveSAmcmFycjs8L2gyPlxuICAgICAgICAgICAgPHA+XG4gICAgICAgICAgICAgIEluc3RhbnRseSBkZXBsb3kgeW91ciBOZXh0LmpzIHNpdGUgdG8gYSBwdWJsaWMgVVJMIHdpdGggVmVyY2VsLlxuICAgICAgICAgICAgPC9wPlxuICAgICAgICAgIDwvYT5cbiAgICAgICAgPC9kaXY+XG4gICAgICA8L21haW4+XG5cbiAgICAgIDxmb290ZXIgY2xhc3NOYW1lPXtzdHlsZXMuZm9vdGVyfT5cbiAgICAgICAgPGFcbiAgICAgICAgICBocmVmPVwiaHR0cHM6Ly92ZXJjZWwuY29tP3V0bV9zb3VyY2U9Y3JlYXRlLW5leHQtYXBwJnV0bV9tZWRpdW09ZGVmYXVsdC10ZW1wbGF0ZSZ1dG1fY2FtcGFpZ249Y3JlYXRlLW5leHQtYXBwXCJcbiAgICAgICAgICB0YXJnZXQ9XCJfYmxhbmtcIlxuICAgICAgICAgIHJlbD1cIm5vb3BlbmVyIG5vcmVmZXJyZXJcIlxuICAgICAgICA+XG4gICAgICAgICAgUG93ZXJlZCBieXsnICd9XG4gICAgICAgICAgPHNwYW4gY2xhc3NOYW1lPXtzdHlsZXMubG9nb30+XG4gICAgICAgICAgICA8SW1hZ2Ugc3JjPVwiL3ZlcmNlbC5zdmdcIiBhbHQ9XCJWZXJjZWwgTG9nb1wiIHdpZHRoPXs3Mn0gaGVpZ2h0PXsxNn0gLz5cbiAgICAgICAgICA8L3NwYW4+XG4gICAgICAgIDwvYT5cbiAgICAgIDwvZm9vdGVyPlxuICAgIDwvZGl2PlxuICApXG59XG4iXSwibmFtZXMiOlsiSGVhZCIsIkltYWdlIiwic3R5bGVzIiwiSG9tZSIsImRpdiIsImNsYXNzTmFtZSIsImNvbnRhaW5lciIsInRpdGxlIiwibWV0YSIsIm5hbWUiLCJjb250ZW50IiwibGluayIsInJlbCIsImhyZWYiLCJtYWluIiwiaDEiLCJhIiwicCIsImRlc2NyaXB0aW9uIiwiY29kZSIsImdyaWQiLCJjYXJkIiwiaDIiLCJmb290ZXIiLCJ0YXJnZXQiLCJzcGFuIiwibG9nbyIsInNyYyIsImFsdCIsIndpZHRoIiwiaGVpZ2h0Il0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./pages/index.js\n"); /***/ }) }); ```
https://github.com/vercel/next.js/issues/35518
https://github.com/vercel/next.js/pull/35718
a00268e70f6812529f436e870e374e34f84bb4f8
62bb3482fe40d57f7f1d3318c5d887d7f29da100
"2022-03-22T07:55:57Z"
javascript
"2022-03-30T12:16:17Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,514
["packages/next/server/image-optimizer.ts", "test/integration/image-optimizer/test/util.js"]
Content-length header missing from NextJS optimized images
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Platform: win32 Arch: x64 Version: Windows 10 Pro Binaries: Node: 16.13.1 npm: 8.3.0 Yarn: 3.1.1 pnpm: N/A Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) Firefox ### How are you deploying your application? (if relevant) 98.0.1 ### Describe the Bug Image served through cdn domain has a content-length image that doesnt get passed after its optimized by next/image. Example: https://sittingonclouds.net/cdn/album/2199.png https://www.sittingonclouds.net/_next/image?url=https%3A%2F%2Fcdn.sittingonclouds.net%2Falbum%2F2199.png&w=1920&q=75 ### Expected Behavior Content-length header on next/image images. ### To Reproduce Included examples on bug description
https://github.com/vercel/next.js/issues/35514
https://github.com/vercel/next.js/pull/36581
c838b5f50d8008ed65bffaf3a1227a52e4d82d4e
7998b63a389cf6cabc54bdf55210eeff0a91e70b
"2022-03-22T04:01:40Z"
javascript
"2022-04-30T01:50:42Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,402
["packages/next/shared/lib/router/utils/resolve-rewrites.ts", "test/integration/custom-routes/next.config.js", "test/integration/custom-routes/pages/_sport/[slug]/index.js", "test/integration/custom-routes/pages/_sport/[slug]/test.js", "test/integration/custom-routes/pages/nav.js", "test/integration/custom-routes/test/index.test.js"]
Wildcard rewrites (/x/:path*) are causing page reloads
### Verify canary release - [X] I verified that the issue exists in 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: 16.13.2 npm: 8.1.2 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.1-canary.13 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug Given the rewrite ``` rewrites: async ()=>{ return { beforeFiles: [ { source: '/nfl/:path*', destination: '/_sport/nfl/:path*' }, ] } } ``` Clicking the following link triggers a refresh ``` <Link href="/nfl">Link</Link> <Link href="/nfl/test">Link</Link> ``` However, If I add the following to the rewrites it doesn't ``` rewrites: async ()=>{ return { beforeFiles: [ { source: '/nfl', destination: '/_sport/nfl' }, { source: '/nfl/test', destination: '/_sport/nfl/test' }, ] } } ``` ### Expected Behavior I'd expect next to be able to pick up the relevant paths, I'm in a situation where I can't control the hrefs and need rewriting to happen without refreshes. ### To Reproduce https://github.com/kyle-ssg/nextjs-rewrite-issue
https://github.com/vercel/next.js/issues/35402
https://github.com/vercel/next.js/pull/36317
864d401ee16ef9711c7e1165aa96f3d55a0e189b
6da71321df76381491cfd812445e57d2eb0e98b6
"2022-03-17T14:35:31Z"
javascript
"2022-04-21T14:58:43Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,309
["packages/next/server/api-utils/node.ts", "packages/next/server/image-optimizer.ts", "packages/next/server/lib/mock-request.ts", "packages/next/server/next-server.ts"]
On-demand ISR unable to revalidate page after build using Node 17
### Verify canary release - [X] I verified that the issue exists in 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: 17.0.1 npm: 8.1.0 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug The `unstable_revalidate` function throws an error when accessing the route after running `yarn build` when using Node 17 ``` Error: Failed to revalidate / at unstable_revalidate (/Users/lydiahallie/Desktop/ondemand-isr/node_modules/next/dist/server/api-utils/node.js:236:11) ... ``` The `fetch` within this function is unable to connect to the page to revalidate, and throws a `FetchError` ### Expected Behavior The `unstable_revalidate` function should be able to revalidate the necessary pages after running `yarn build`. ### To Reproduce 1. Clone the [reprod example](https://github.com/lydiahallie/ondemand-isr-bug-reprod) `git clone https://github.com/lydiahallie/ondemand-isr-bug-reprod.git` 2. Run `yarn build` 3. Run `yarn start` 4. Navigate to `http://localhost:3000/api/revalidate`
https://github.com/vercel/next.js/issues/35309
https://github.com/vercel/next.js/pull/35386
24f450e8aa08cf648eaac86522e7e6237c0b703e
d3a53a6f018d572371f3ca41d0148c8329b59b33
"2022-03-14T16:39:53Z"
javascript
"2022-03-17T17:06:44Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,286
["packages/next/client/image.tsx", "packages/next/client/link.tsx", "packages/next/client/use-intersection.tsx", "test/integration/image-component/default/pages/lazy-src-change.js", "test/integration/image-component/default/test/index.test.js"]
`next/image` will not lazyload image when the component is being reused across updates
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: linux Arch: x64 Version: Ubuntu 20.4.0 LTS Sun Mar 13 2022 20:10:45 GMT+0800 (China Standard Time) Binaries: Node: 14.19.0 npm: 7.17.0 Yarn: 1.22.10 pnpm: N/A Relevant packages: next: 12.1.1-canary.10 react: 17.0.2 react-dom: 17.0.2 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug When navigating within the same `page` (E.g. the previous page and the current page are both `/pages/[id].js`), the React tree won't get a full update, causing the `next/image` component's `intersected` state not getting reset, causing the lazyload to fail. ### Expected Behavior The image not in view should never be loaded. ### To Reproduce I have provided a minimum reproduction on Stackblitz: https://stackblitz.com/edit/github-evf8rw 0. Open the Browser's Dev Tools, switch to `Network` Tab 1. Click link `Image1` 2. The image is not loaded (instead only a data URI gif is loaded), because the image is not in the viewport 3. Scroll down, the image is now loaded 4. Click link `Image2` 5. The new image is loaded even it is not in the viewport.
https://github.com/vercel/next.js/issues/35286
https://github.com/vercel/next.js/pull/35287
4db8c49cc31e4fc182391fae6903fb5ef4e8c66e
081e7b00278395c205532a70a5da1be5c8f363eb
"2022-03-13T12:23:31Z"
javascript
"2022-04-04T18:18:49Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,280
["packages/next/server/base-server.ts", "packages/next/shared/lib/router/router.ts"]
Build fails when consuming application uses TS exactOptionalPropertyTypes.
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: win32 Arch: x64 Version: Windows 10 Home Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 3.1.1 pnpm: N/A Relevant packages: next: 12.1.1-canary.10 react: 17.0.2 react-dom: 17.0.2 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug An error is thrown when running `next build` on any TypeScript+Next app where TS's `compilerOptions.exactOptionalPropertyTypes` is set to `true`. ![image](https://user-images.githubusercontent.com/343837/158046859-db903b89-a35e-4256-93f5-6b9bb5022233.png) ### Expected Behavior I expect the build is complete successfully, as you can see in this screenshot after I patched it with the accompanying pull request: ![image](https://user-images.githubusercontent.com/343837/158046975-7393f818-be1a-4d03-99db-643e88595657.png) ### To Reproduce Set `compilerOptions.exactOptionalPropertyTypes` to `true` on any Next app, then run `next build`.
https://github.com/vercel/next.js/issues/35280
https://github.com/vercel/next.js/pull/35281
0d80b113a3d17ba86b273c8d7cef7a7a20cde95b
f9ed7954bf151bcace8cf731d29f537c1d164103
"2022-03-13T05:53:11Z"
javascript
"2022-05-23T05:26:44Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,273
["docs/advanced-features/i18n-routing.md"]
Docs: i18n doc needs to be updated for to use with url absolute & nextUrl clone
### What is the improvement or update you wish to see? i18n: docs example is deprecated: at _middleware: https://nextjs.org/docs/advanced-features/i18n-routing#prefixing-the-default-locale Now with 12.1, nextjs suggest to use clone() of nextUrl and replace relative URLs by absolute. "URLs is malformed. Please use only absolute URLs" https://nextjs.org/docs/messages/middleware-relative-urls ### Is there any context that might help us understand? Can't use Nextjs example code at docs with url relatives: ``` const res = redirect(`/${ localeOrGeoCookie }${ nextUrl.pathname }`) // without clone it ``` I think to use clone will help: ``` const url = request.nextUrl.clone() const res = NextResponse.redirect( `${url.origin}/${localeOrGeoCookie}` ) res.cookie('GEO_COUNTRY', country) // optional, I need to store geo country name return res ``` ### Does the docs page already exist? Please link to it. https://nextjs.org/docs/advanced-features/i18n-routing#prefixing-the-default-locale
https://github.com/vercel/next.js/issues/35273
https://github.com/vercel/next.js/pull/35874
9805399faa6b0ec95d3b1c2d702627680368203c
07723be8b3debd159f096be34327b79326443995
"2022-03-12T03:32:41Z"
javascript
"2022-04-06T15:00:39Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,235
["packages/next/build/utils.ts", "test/integration/pnpm-support/app-multi-page/.npmrc", "test/integration/pnpm-support/app-multi-page/next.config.js", "test/integration/pnpm-support/app/next.config.js", "test/integration/pnpm-support/test/index.test.js"]
standalone not works with pnpm in docker
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64 Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 1.22.17 pnpm: 6.32.3 Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug The generated standalone with pnpm are symbolink. In step docker build, it will not contain the pnpm node_modules ### Expected Behavior Use non symbol link in standalone output. ### To Reproduce https://github.com/vercel/next.js/tree/canary/examples/with-docker just execute the example with pnpm
https://github.com/vercel/next.js/issues/35235
https://github.com/vercel/next.js/pull/35535
aaeb349ce3e8c4c3435a43a29af4379266818e7b
5a785e45c73c00223f6c51c475b6e9a06ca81a15
"2022-03-11T05:17:53Z"
javascript
"2022-04-15T12:35:47Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,227
["packages/next/client/index.tsx", "packages/next/shared/lib/router/router.ts", "test/e2e/middleware-general/app/middleware.js", "test/e2e/middleware-general/app/pages/ssg/[slug].js", "test/e2e/middleware-general/test/index.test.ts", "test/e2e/middleware-rewrites/app/pages/index.js", "test/integration/dynamic-routing/test/index.test.js", "test/integration/dynamic-routing/test/middleware.test.js", "test/integration/middleware-prefetch/tests/index.test.js"]
Middleware rewrite doesn't work when directly accessing a page or doing a full refresh of a page
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: win32 Arch: x64 Version: Windows 10 Enterprise Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 1.22.15 pnpm: N/A Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) Chrome ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug When accessing a page directly or doing a full refresh of a page, a middleware rewrite doesn't work. When navigating between pages with next/link it does work though. ### Expected Behavior Middleware rewrite is working when accessing a page directly or doing a full refresh of a page. ### To Reproduce The bug is reproduced in the following code sandbox https://codesandbox.io/s/dawn-surf-ory5le If you access the index page directly you'll see "Hello" instead of "Hello toto". If you navigate between the index and the about pages, you'll start seeing "Hello toto" on the index page.
https://github.com/vercel/next.js/issues/35227
https://github.com/vercel/next.js/pull/37784
c2b80064853301e746ca100b6a49de04b8f5b593
85e643be83f8ff009463e5700c436c39fb0ea11e
"2022-03-10T23:13:40Z"
javascript
"2022-06-17T15:28:25Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,219
["packages/next/compiled/cssnano-simple/index.js", "packages/next/package.json", "yarn.lock"]
css border shorthand incorrectly minified in production
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: linux Arch: x64 Version: #33~20.04.1-Ubuntu SMP Mon Feb 7 14:25:10 UTC 2022 Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 1.22.17 pnpm: 6.30.0 Relevant packages: next: 12.1.1-canary.9 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug currently, the css minifier (i think this is the compiled-in cssnano-simple) produces invalid css from the following: ```css h1 { --border-width: 8px 2px; border-width: var(--border-width); border-style: solid; border-color: hotpink; } ``` results in: ```css h1{--border-width:8px 2px;border:var(--border-width) solid hotpink} ``` which is invalid. note that this is currently also handled incorrectly in upstream `cssnano` with the default preset, but works correctly with the "lite" preset. cf. https://github.com/cssnano/cssnano/issues/1354 ### Expected Behavior don't collapse border properties into shorthand when custom properties are encountered ### To Reproduce - checkout https://github.com/stefanprobst/next-issue-css-shorthand and compare the results of `yarn dev` vs `yarn build && yarn start`
https://github.com/vercel/next.js/issues/35219
https://github.com/vercel/next.js/pull/35258
d7deb852bd91e0fc2246d645e0087af648c97dbc
91455653fe8a9f9a12682c22f3dd36eaccd3b7f4
"2022-03-10T18:46:25Z"
javascript
"2022-03-11T16:25:18Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,138
["docs/api-reference/next/router.md"]
Docs: "manually ensure the state is updated using useEffect" is vague and hidden
### What is the improvement or update you wish to see? [In the docs for next/router](https://nextjs.org/docs/api-reference/next/router) I read: > Note: When navigating to the same page in Next.js, the page's state will not be reset by default, as the top-level React component is the same. You can manually ensure the state is updated using useEffect. I think there are two problems here: 1. The advice "ensure the state is updated using useEffect" is too vague. Where should I put this `useEffect`? What should it do, and when? Is there an example anywhere? 2. This should be less of a buried "Note", and more of a prominent "Warning". I spent two hours tracking down this mysterious bug. I only stumbled onto the "Note" while searching for a bug report for this behavior. ### Is there any context that might help us understand? Here is a minimal test case that I expected to work: ```jsx // pages/[pageTitle].jsx import Link from "next/link"; import * as React from "react"; export const getServerSideProps = async ({ params }) => ({ props: { pageTitle: params["pageTitle"] } }); const MyPage = ({ pageTitle }) => { const [title] = React.useState(pageTitle); return ( <div> <h1>{title}</h1> <Link href="/one"> <a>one</a> </Link>{" "} <Link href="/two"> <a>two</a> </Link> </div> ); }; export default MyPage; ``` I expected that navigating between `/one` and `two` would refresh the state. However, it does not, and so the page title remains the title of the initially loaded page. My expectation came from the assuming that the identity (or React key) of the current component is the current URL. In other words, I expected the default `app.tsx` to look something like this: ```tsx import { AppProps } from "next/app"; import { useRouter } from "next/router"; function MyApp({ Component, pageProps }: AppProps) { const router = useRouter(); return <Component key={router.asPath} {...pageProps} />; } export default MyApp; ``` In fact, using the above as my `_app.ts` seems to fix the issue. What problems are there with this approach? ### Does the docs page already exist? Please link to it. https://nextjs.org/docs/api-reference/next/router
https://github.com/vercel/next.js/issues/35138
https://github.com/vercel/next.js/pull/35651
3ae571d97b429e9d7b57fb21d5e4dab4f39735e7
a2e65ac6d80bc4b5e4536db52fb826d165707ce6
"2022-03-08T12:56:40Z"
javascript
"2022-04-16T02:56:38Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,135
["packages/next/client/index.tsx", "test/integration/react-streaming-and-server-components/app/components/nav.server.js", "test/integration/react-streaming-and-server-components/app/pages/index.server.js", "test/integration/react-streaming-and-server-components/app/pages/next-api/link.server.js", "test/integration/react-streaming-and-server-components/app/pages/streaming-rsc.server.js", "test/integration/react-streaming-and-server-components/test/rsc.js"]
`Link` pointing to built pages no longer works on canary
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 Binaries: Node: 16.14.0 npm: 8.5.3 Yarn: 1.22.17 pnpm: 6.30.1 Relevant packages: next: 12.1.1-canary.7 react: 18.0.0-rc.1 react-dom: 18.0.0-rc.1 ``` ### What browser are you using? (if relevant) Chrome 98.0.4758.109 ### How are you deploying your application? (if relevant) Vercel ### Describe the Bug With version `12.1.1-canary.7` of `next`, a `Link` pointing to a route on which you've initially entered the application longer does anything when clicked. It's possible to reach any route via `Link`, just not the page on which you've loaded the app initially. The URL in the address bar of the browser is set to the correct URL, but no page transition occurs. I also checked the console, but there aren't any errors. Same for the terminal. Note that I'm using React Server Components on the Edge Runtime. ### Expected Behavior I'd expect a `Link` that points to a page on which I've loaded the app initially to still work. ### To Reproduce 1. On any page of your app, add a `Link` with `href` set to any other route 1. Stop your devserver 2. Clean your cache with `rm -rf .next` (just to be sure) 3. Start your devserver 4. Load the app on the URL that you've defined as `href` for the `Link` 5. Navigate to the route that contains the `Link` 6. Click the `Link` 7. Notice that the URL in the address bar changes to the value of `href`, but no page transition occurs.
https://github.com/vercel/next.js/issues/35135
https://github.com/vercel/next.js/pull/35344
33aa51ab267481df24f1099d9a81bca974157f5b
60ad1dee76dac03d948977cddee01818a7682d6d
"2022-03-08T10:38:52Z"
javascript
"2022-03-16T22:04:34Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,117
["packages/next/build/webpack/config/blocks/css/plugins.ts", "test/production/postcss-plugin-config-as-string/index.test.ts"]
PostCSS configuration error with `tailwindcss/nesting` together with `postcss-nesting`
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ```bash Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64 Binaries: Node: 16.13.1 npm: 8.3.0 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.1-canary.6 react: 17.0.2 react-dom: 17.0.2 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug Using the `postcss-nesting` nesting plugin as described in the [Tailwind documentation](https://tailwindcss.com/docs/using-with-preprocessors#nesting) (see section about `postcss-nesting`) results in an error: ```Error: A PostCSS Plugin was passed as an array but did not provide its configuration ('tailwindcss/nesting').``` The PostCSS configuration used is the following: ```js // postcss.config.js module.exports = { plugins: { 'postcss-import': {}, 'tailwindcss/nesting': 'postcss-nesting', tailwindcss: {}, 'postcss-preset-env': { features: { 'nesting-rules': false }, }, }, }; ``` It looks like it does not resolve `postcss-nesting` to a valid config for `tailwindcss/nesting` or there is a check in place to force plugin values to be objects instead of a strings. I also tried the following without luck: ```js // postcss.config.js module.exports = { plugins: { 'postcss-import': {}, 'tailwindcss/nesting': {'postcss-nesting' : {}}, tailwindcss: {}, 'postcss-preset-env': { features: { 'nesting-rules': false }, }, }, }; ``` the above results in a tailwind error: `Error: tailwindcss/nesting should be loaded with a nesting plugin.` The configuration as provided in the tailwind docs has worked for me when using other non next.js setups, so I asume the issue is with next.js and the way it handles postcss.config.js ### Expected Behavior For the configuration to work as expected. ### To Reproduce Go to this sandbox: https://codesandbox.io/s/white-snow-um2w00 see the error in the terminal. To test, remove the config file and the css import in `pages/_app.js` and all works fine.
https://github.com/vercel/next.js/issues/35117
https://github.com/vercel/next.js/pull/35173
3d4f4c6995587145c19c13892f84cae81d2eb334
f4fbb83d4a7b3f567c4a5f8f0a14515746a06449
"2022-03-07T17:18:41Z"
javascript
"2022-04-08T16:58:50Z"
closed
vercel/next.js
https://github.com/vercel/next.js
35,115
["packages/next/client/image.tsx", "test/integration/image-component/basic/pages/loader-prop.js", "test/integration/image-component/basic/test/index.test.js"]
The `config` arg should not be passed to user-defined `loader` function in `next/image
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: win32 Arch: x64 Version: Windows 10 Pro Binaries: Node: 14.17.6 npm: 6.14.15 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug The bug for next.config.js not considered for node_modeles was discussed here: [https://github.com/vercel/next.js/issues/31065](url) **Fixed in PR**:[https://github.com/vercel/next.js/pull/33559](url) After the above fix when trying to build the next app the `config` argument passed in the custom loader function resolves to the default next variables. ### Expected Behavior The config argument in the loader function should return the variables configured in the next.config.js coming from the node_modules when trying to build the app statically. ### To Reproduce 1) Create the next app 2) The app should use a next.config.js for the 3rd party packages inside node_modules that import next/image(which uses a custom loader function). 3) Build the app `next build` The config argument in the loader function returns default next.config variables set by vercel.
https://github.com/vercel/next.js/issues/35115
https://github.com/vercel/next.js/pull/36013
a0924fc7c763797b2927b4c3cb0f321ead49e645
0a04ab7478bdb67600999e425d0786f57f41e50e
"2022-03-07T16:42:23Z"
javascript
"2022-04-08T22:19:25Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,929
["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"]
res.hasHeader is not a function
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: win32 Arch: x64 Version: Windows 10 Home Binaries: Node: 17.4.0 npm: 8.3.1 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.1-canary.4 react: 17.0.2 react-dom: 17.0.2 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) next start and next dev ### Describe the Bug Some function on the res object throws the following error: ``` TypeError: res.hasHeader is not a function at Object.setRevalidateHeaders (C:\Users\Erik de Vlaam\Desktop\personal-website\node_modules\next\dist\server\send-payload\revalidate-headers.js:8:37) at Object.sendRenderResult (C:\Users\Erik de Vlaam\Desktop\personal-website\node_modules\next\dist\server\send-payload\index.js:43:33) ``` ### Expected Behavior I guess it is expected for the functions to just work(?) and not throw an error ### To Reproduce The following page should be good to reproduce. The folder structure should be easy to resolve from this code. ``` import fs from "fs"; import { GetServerSideProps } from "next"; import path from "path"; import { FunctionComponent } from "react"; export const getServerSideProps: GetServerSideProps = async (context) => { const id = context.params!.id!.toString(); const filePath = path.join("images", id); if(!fs.existsSync(filePath)) { return { notFound: true } } context.res.setHeader("content-type", "image/png"); context.res.write(fs.readFileSync(path.join("images", id))); context.res.end(); return { props: { } } } const Images: FunctionComponent = () => { return <></> } export default Images;" ```
https://github.com/vercel/next.js/issues/34929
https://github.com/vercel/next.js/pull/45681
e36fb42e30e7b69f6484275df960bc91ab81ee86
434a8cb7d0764993b8cb39fe1ec520eb667de703
"2022-03-01T18:07:10Z"
javascript
"2023-02-08T01:51:26Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,811
["packages/next-swc/Cargo.lock", "packages/next-swc/crates/core/Cargo.toml", "packages/next-swc/crates/emotion/Cargo.toml", "packages/next-swc/crates/modularize_imports/Cargo.toml", "packages/next-swc/crates/napi/Cargo.toml", "packages/next-swc/crates/styled_components/Cargo.toml", "packages/next-swc/crates/styled_jsx/Cargo.toml", "packages/next-swc/crates/styled_jsx/tests/fixture/transform-css-complex-selector/output.js", "packages/next-swc/crates/styled_jsx/tests/fixture/transform-css/output.js", "packages/next-swc/crates/wasm/Cargo.toml"]
SWC minify not working with styled-components
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) Chrome ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug 1. add styled component (layout) in _app 2. add styled component in pages 3. import createHash from crypto in _app and console.log or use it ### Expected Behavior It should work without error and if setting swcMinify to false, it works. ### To Reproduce https://github.com/vip30/next-reproduce 1. `yarn && yarn build && yarn start` 2. open the browser An endless loop error in console <img width="2240" alt="image" src="https://user-images.githubusercontent.com/4260833/155751836-356691ef-8bbf-45ab-92ff-a0bd0803766e.png">
https://github.com/vercel/next.js/issues/34811
https://github.com/vercel/next.js/pull/36187
1582e11185a4b597dd789ace255911d30802d38f
cbb64ee5544739587d8697507406b73fbf015f83
"2022-02-25T16:33:59Z"
javascript
"2022-04-15T14:34:32Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,807
["package.json", "packages/next/compiled/is-animated/index.js", "test/integration/image-optimizer/app/public/animated2.png", "test/integration/image-optimizer/test/util.js", "yarn.lock"]
Image component change animated files to static ones
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information 'yarn' is not recognized as an internal or external command, operable program or batch file. 'pnpm' is not recognized as an internal or external command, operable program or batch file. Operating System: Platform: win32 Arch: x64 Version: Windows 10 Home Binaries: Node: 14.18.1 npm: 7.20.3 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) All main web browsers except Safari (I don't have Safari). ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug I have a component for animited photos and I use <Image />. When this one show animated photo, I have static one, but when I change on <img />, the files are animited (e. g. eyes are moving). For example: https://pronama.jp/images/animated.png ### Expected Behavior When Image get animited files (apng, gif or animited webp and avif), Image should know this isn't static photo, yet animited one, so files should move. That files should be converting to avif or webp when web browser support that formats, especially gif format. Gif format must be converted to avif, webp or apng format by the performance of that format. ### To Reproduce I change to img tag: it work. I added "unoptimized": it work too. I added Image without unoptimized: it doesn't work. I wanted to add apng or gif format in next.config file, but I get the same errors:" Error: Specified images.formats must be length 1 or 2, received length (3), please reduce the length of the array to continue. or Error: Specified images.formats should be an Array of mime type strings, received invalid values (image/apng). " "image/apng" is in headers request. My components for images: https://github.com/jukialen/portal_for_artists_in_next/blob/main/components/atoms/Photos/Photos.tsx My next.config: https://github.com/jukialen/portal_for_artists_in_next/blob/main/next.config.js
https://github.com/vercel/next.js/issues/34807
https://github.com/vercel/next.js/pull/35120
0e5e8881c08d2f13f2604327f3940776cc5c6a42
b25f7f84b1e638a8564805a5bdc0d77ae5244d0b
"2022-02-25T12:11:53Z"
javascript
"2022-03-07T20:29:11Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,718
["packages/next-env/index.ts", "packages/next-env/package.json", "test/development/dotenv-default-expansion/index.test.ts", "yarn.lock"]
dotenv-expand' "default" expansion not working
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 3.2.0 pnpm: N/A Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 warn - Latest canary version not detected, detected: "12.1.0", newest: "12.1.1-canary.1". 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 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug If I add a fallback/default value to one of my dotenv variable expansions the operation doesn't succeed. ``` NEXT_PUBLIC_TEST=${KEY:-default} ``` Results in: ``` > console.log(process.env.NEXT_PUBLIC_TEST); < ":-default}" ``` ### Expected Behavior ``` > console.log(process.env.NEXT_PUBLIC_TEST); < "default" ``` This is explained in the dotenv-expand documentation here: https://github.com/motdotla/dotenv-expand#what-rules-does-the-expansion-engine-follow ### To Reproduce Add the above config to `.env` and run `yarn build`. I noticed that the compiled source of @next/env is missing several parts of the dotenv-expand package (that is for some reason bundled in rather than referenced as external)
https://github.com/vercel/next.js/issues/34718
https://github.com/vercel/next.js/pull/34765
5fb6980c4435d05a6d3d31ae4a57aaf4940f0abd
728d82663c9c65b12c22c02de815297c56a3ff53
"2022-02-23T11:46:05Z"
javascript
"2022-03-03T16:52:20Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,715
["packages/next-swc/Cargo.lock", "packages/next-swc/crates/core/Cargo.toml", "packages/next-swc/crates/emotion/Cargo.toml", "packages/next-swc/crates/modularize_imports/Cargo.toml", "packages/next-swc/crates/napi/Cargo.toml", "packages/next-swc/crates/styled_components/Cargo.toml", "packages/next-swc/crates/styled_jsx/Cargo.toml", "packages/next-swc/crates/styled_jsx/tests/fixture/transform-css-complex-selector/output.js", "packages/next-swc/crates/styled_jsx/tests/fixture/transform-css/output.js", "packages/next-swc/crates/wasm/Cargo.toml"]
react-map-gl layer crash when using swcMinify
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:24 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T8101 Binaries: Node: 14.17.6 npm: 6.14.15 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.1-canary.1 react: 17.0.2 react-dom: 17.0.2 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug Mapbox Layer is not working when using `swcMinfiy:true`. After running `next build` and `next start`, the following errors were returned when viewing in browsers: `Given varint doesn't fit into 10 bytes` ![image](https://user-images.githubusercontent.com/8063319/155304187-b1b2822a-1684-46c4-a920-4470fb68df52.png) ### Expected Behavior We should see mapbox layer as it's working in `yarn dev` ### To Reproduce https://github.com/cungminh2710/nextjs-swc-mapbox - `yarn && yarn build` - `yarn start` then navigate to localhost:3000 - layers not showing and errors were logged in console
https://github.com/vercel/next.js/issues/34715
https://github.com/vercel/next.js/pull/36187
1582e11185a4b597dd789ace255911d30802d38f
cbb64ee5544739587d8697507406b73fbf015f83
"2022-02-23T10:47:45Z"
javascript
"2022-04-15T14:34:32Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,711
["packages/next/server/dev/hot-reloader.ts", "packages/next/server/dev/next-dev-server.ts"]
EACCES: permission denied, mkdir '../../dist'
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` $ npx --no-install next info /bin/sh: 1: yarn: not found Operating System: Platform: linux Arch: x64 Version: #1 SMP Wed Aug 25 23:20:18 UTC 2021 Binaries: Node: 16.13.1 npm: 8.5.1 Yarn: N/A pnpm: 6.31.0 Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 ``` ### What browser are you using? (if relevant) Chrome ### How are you deploying your application? (if relevant) nx.dev ### Describe the Bug when run command `npx nx run blog:serve` I get the next error: ``` > Executing task: npx nx serve blog < > nx run blog:serve EACCES: permission denied, mkdir '../../dist' ——————————————————————— > NX Running target "blog:serve" failed Failed tasks: - blog:serve Hint: run the command with --verbose for more details. The terminal process "/usr/bin/bash '-c', 'npx nx serve blog'" terminated with exit code: 1. ``` ### Expected Behavior when run command `npx nx run blog:serve` to not have any error as it does with next: **12.0.7**. ### To Reproduce ``` git clone https://github.com/sincovschi/sincovschi-website.git cd sincovschi-website npm install npm install next@latest npx nx run blog:serve ```
https://github.com/vercel/next.js/issues/34711
https://github.com/vercel/next.js/pull/34795
aecfe4dc498caebf3a80847bb89e00f0bc645fa6
3d5dd58251a9ffd47741a7c81061fc71a9246621
"2022-02-23T09:04:13Z"
javascript
"2022-02-25T12:40:24Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,693
["docs/basic-features/font-optimization.md"]
Documented use of Google Fonts via next/head generates a warning in development mode
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T6000 Binaries: Node: 14.18.1 npm: 6.14.15 Yarn: N/A pnpm: N/A Relevant packages: next: 12.1.0 react: 17.0.2 react-dom: 17.0.2 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) next start ### Describe the Bug When a Google Fonts stylesheet is included in a page by following the [font optimization documentation](https://nextjs.org/docs/basic-features/font-optimization), a warning is generated in the browser console in development mode: `Do not add stylesheets using next/head (see <link rel="stylesheet"> tag`. ### Expected Behavior I would expect any of: * an exemption in the code for Google Fonts or TypeKit here, similar to the font optimization trigger in [next/head](https://github.com/vercel/next.js/blob/d7de7deb70e58de84db16d8ae04010f306ec0d32/packages/next/shared/lib/head.tsx#L146-L152) * the [font optimization documentation](https://nextjs.org/docs/basic-features/font-optimization) to omit usage on a page and only describe its use in `Document` * the ability to disable the warning in the browser console (For my use case, never warning on hosted fonts and/or ignoring the warning would be ideal, as I'd like to be able to allow different fonts on a per-page basis, and because the failure cases are unlikely to apply.) ### To Reproduce Include ```tsx <Head> <link href="https://fonts.googleapis.com/css2?family=Inter&display=optional" rel="stylesheet" /> </Head> ``` in a page in development mode. Observe the warning in the console.
https://github.com/vercel/next.js/issues/34693
https://github.com/vercel/next.js/pull/34694
037f79d51fcd4a61761b06c840bc190a1eaa8cf0
b3f2b388443a7b94dddaa112665892816f144542
"2022-02-22T18:54:33Z"
javascript
"2022-02-22T23:17:01Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,629
["packages/next/client/image.tsx", "packages/next/client/index.tsx", "packages/next/server/base-server.ts", "packages/next/server/config-shared.ts", "packages/next/server/config.ts", "packages/next/server/render.tsx", "packages/next/shared/lib/image-config-context.ts", "packages/next/shared/lib/image-config.ts"]
Image config from server (not transpiled) being imported in client
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64 Binaries: Node: 14.17.6 npm: 6.14.15 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.1.1-canary.1 react: 17.0.2 react-dom: 17.0.2 ``` ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug The file `server/image-config` is being imported in `next/dist/client/image.js`. This injects non transpiled content into the main chunk file which in turn makes the client build not safe for ES5 and not working in IE11. ### Expected Behavior Only transpiled to ES5 (IE11) content in client builds. ### To Reproduce Create a new project from scratch: ``` npx create-next-app --example image-component image-app cd image-app npx --no-install next build ``` Run es-check against `.next` folder: `npx es-check es5 '.next/static/**/*.js' -v` The following error appears: ``` error: ES-Check: there were 1 ES version matching errors. info: ES-Check Error: ---- · erroring file: .next/static/chunks/main-01df828e572375b9.js · error: SyntaxError: The keyword 'const' is reserved (1:99549) · see the printed err.stack below for context ---- SyntaxError: The keyword 'const' is reserved (1:99549) ```
https://github.com/vercel/next.js/issues/34629
https://github.com/vercel/next.js/pull/34677
8f65c38e20ce3c4e76b3388f89a9156fca272fe3
6178e7cf6d8822f6f29014c5410c455ca7bafbc2
"2022-02-21T10:34:26Z"
javascript
"2022-02-22T14:27:18Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,594
["packages/next/build/webpack-config.ts", "packages/next/build/webpack/loaders/next-flight-client-loader.ts", "packages/next/build/webpack/loaders/next-flight-server-loader.ts", "packages/next/build/webpack/plugins/flight-manifest-plugin.ts", "test/integration/react-streaming-and-server-components/app/components/client.client.js", "test/integration/react-streaming-and-server-components/app/components/shared.client.js", "test/integration/react-streaming-and-server-components/app/components/shared.js", "test/integration/react-streaming-and-server-components/app/pages/shared.server.js", "test/integration/react-streaming-and-server-components/test/rsc.js", "yarn.lock"]
Shared components need to be able to import client components
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 Binaries: Node: 17.5.0 npm: 8.4.1 Yarn: 1.22.15 pnpm: 6.11.0 Relevant packages: next: 12.1.1-canary.1 react: 0.0.0-experimental-13036bfbc-20220121 react-dom: 0.0.0-experimental-13036bfbc-20220121 ### What browser are you using? (if relevant) _No response_ ### How are you deploying your application? (if relevant) _No response_ ### Describe the Bug Importing a Client Component from a Shared (via Server) component runs it in the Server environment. But it should turn it into a Module Reference instead. So `index.server.js` -> `components.js` -> `thing.client.js` tries to run `<Thing />` *in the SC environment*. But it should treat it as a client import, and "skip" over it. https://github.com/gaearon/sc-bug-repro/blob/df693017248e13c2c59829a27aa7ff6b63aad341/pages/index.server.js#L3-L8 In other words, imports to Client files only seem to be replaced with Module References inside `.server.js` files. But they should be replaced with Module References in all files. ### Expected Behavior It should work ### To Reproduce ``` git clone https://github.com/gaearon/sc-bug-repro.git cd sc-bug-repro git checkout shared-client npm install npm run dev ``` See `pages/index.server.js` for two snippets that should be equivalent but aren't.
https://github.com/vercel/next.js/issues/34594
https://github.com/vercel/next.js/pull/34692
175e081e862b503d2daf4c2d07d589f86d037f06
8ba2aec022f88b8d773013c8188fe284779bba8c
"2022-02-19T22:31:19Z"
javascript
"2022-02-28T15:00:28Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,527
["packages/next/server/next-server.ts", "test/production/react-18-streaming-ssr/index.test.ts"]
Enabling trailingSlash will hang the request in RSC
### Verify canary release - [X] I verified that the issue exists in 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:24 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T8101 Binaries: Node: 14.17.0 npm: 8.1.4 Yarn: 1.22.15 pnpm: 6.11.0 Relevant packages: next: 12.1.0 react: 18.0.0-rc.0 react-dom: 18.0.0-rc.0 Done in 0.60s. ### What browser are you using? (if relevant) Chrome 98 ### How are you deploying your application? (if relevant) local testing ### Describe the Bug Testing https://github.com/vercel/next-rsc-demo with `trailingSlash` config enabled, RSC pages requests are hanged in dev mode and returning 404 in prod mode (next build + start). Related to https://github.com/vercel/next-react-server-components/issues/22 . WebServer doens't respond correctly. ### Expected Behavior RSC pages should work like normal pages with `trailingSlash` enabled, appending slash to the pathname if necessary ### To Reproduce 1. clone https://github.com/vercel/next-rsc-demo 2. add `trailingSlash: true` in `next.config.js` 3. run `yarn dev` 4. request `localhost:3000/rsc`
https://github.com/vercel/next.js/issues/34527
https://github.com/vercel/next.js/pull/34544
a4f5463eb55482dcb28f8469671a0a7c03fabf72
6ed281df8edea5d5af914e49b3b61a40f2f8f1e0
"2022-02-18T11:01:34Z"
javascript
"2022-02-18T22:39:28Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,523
["packages/next/build/webpack-config.ts", "packages/next/build/webpack/plugins/middleware-source-maps-plugin.ts", "packages/next/server/config-shared.ts", "test/production/generate-middleware-source-maps/index.test.ts"]
Generate Source Maps for Middleware
Currently we don't generate source maps specifically for Middleware. We should generate them when the user opts-in into it.
https://github.com/vercel/next.js/issues/34523
https://github.com/vercel/next.js/pull/34409
cc5345bba852077c332ddc0b75279a0f96d4321a
1a0d149c9ff6afa061b902c32b51aa848141cefd
"2022-02-18T10:44:18Z"
javascript
"2022-02-24T15:56:40Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,521
["errors/manifest.json", "errors/middleware-request-page.md", "packages/next/server/web/adapter.ts", "packages/next/server/web/error.ts", "packages/next/server/web/spec-extension/fetch-event.ts", "packages/next/server/web/spec-extension/request.ts", "test/integration/middleware-general/middleware.js", "test/integration/middleware-general/test/index.test.js", "test/production/middleware-typescript/app/middleware.ts"]
Deprecate `page` parameter for Middleware
Currently, in Middleware, `NextRequest` holds a `page` property that can be used to _foresee_ if the incoming request will match a page or not. This feature is intended to help users detect if a certain page will be render and, in the case of dynamic routes, which ones are the parameters that they will be matching. This information is based on simply checking if there is a static/dynamic page route that matches the request. The problem is that when the request matches a static file, it will still check if there is a page match and it is not possible to detect if there is a static file that matches at that specific stage. This feature can be replaced by using [path-to-regexp](https://github.com/pillarjs/path-to-regexp) or any other library or regexp and it is adding logic to the middleware bundle that many users may not need, growing its size when there is no need to. We should entirely remove the feature so that when `request.page` is accessed we can fail with an error and a link that provides a code snippet with an alternative to the feature.
https://github.com/vercel/next.js/issues/34521
https://github.com/vercel/next.js/pull/37349
1420dd9a098d29a49376cfa1d0ed493b7462413b
129052dc98fac4ddc8e77ba5e3cd1708c911f15c
"2022-02-18T10:09:41Z"
javascript
"2022-06-01T20:06:37Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,464
["packages/next/client/index.tsx", "test/integration/react-streaming-and-server-components/app/pages/index.server.js", "test/integration/react-streaming-and-server-components/test/rsc.js"]
`Link`s will sometimes hide the entire page when clicked
### Verify canary release - [X] I verified that the issue exists in Next.js canary release ### Provide environment information ``` Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 Binaries: Node: 16.14.0 npm: 8.3.1 Yarn: 1.22.17 pnpm: 6.30.1 Relevant packages: next: 12.0.11-canary.20 react: 18.0.0-rc.0 react-dom: 18.0.0-rc.0 ``` ### What browser are you using? (if relevant) Chrome 98.0.4758.80 (arm64) ### How are you deploying your application? (if relevant) Vercel ### Describe the Bug Clicking a `Link` that happens to have the same `href` as the current page causes the entire page to empty. Here's an example: https://user-images.githubusercontent.com/6170607/154454937-1dc1c3db-5faf-48ee-8ab9-599157287ccb.mp4 This problem only seems to happen with React Server Components enabled. ### Expected Behavior Clicking a `Link` that happens to have the same `href` as the current page should not cause the entire page to go empty. Instead, it should behave exactly like without React Server Components enabled: You just continue to see the current page without any problems. ### To Reproduce 1. Clone the Vercel's [next-react-server-components](https://github.com/vercel/next-react-server-components) example 2. Add `<Link href="/rsc">This link points to the current page</Link>` in `pages/rsc.server.js` 3. Click the link and watch the whole page go empty
https://github.com/vercel/next.js/issues/34464
https://github.com/vercel/next.js/pull/34475
eddabd98f8e4e5a82f4341bc1d8926959327919a
1c167afa589264df6d1a58632a5e5a171de25dce
"2022-02-17T10:18:17Z"
javascript
"2022-02-17T18:57:53Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,342
["packages/next/client/dev/on-demand-entries-client.js", "packages/next/server/base-server.ts", "packages/next/server/render.tsx", "packages/next/server/request-meta.ts", "packages/next/shared/lib/utils.ts", "test/development/gssp-notfound/index.test.ts"]
WebSocket connection to 'ws://localhost:3000/_next/webpack-hmr' failed: init @ websocket.js?a9be:46
### What example does this report relate to? GetServerSideProps axios and return notFound: true, ### What version of Next.js are you using? 12.0.10 ### What version of Node.js are you using? 16.13.0 ### What browser are you using? Chrome ### What operating system are you using? Windows ### How are you deploying your application? next dev ### Describe the Bug On the client side, in the browser it shows me the following error repeatedly without stopping: WebSocket connection to 'ws://localhost:3093/_next/webpack-hmr' failed: init @ websocket.js?a9be:46 and in the powershell it shows me the following message repeatedly without stopping: Error: Request failed with status code 404 at createError (C:\Users\slema\source\repos\upfuller-client\node_modules\axios\lib\core\createError.js:16:15) at settle (C:\Users\slema\source\repos\upfuller-client\node_modules\axios\lib\core\settle.js:17:12) at IncomingMessage.handleStreamEnd (C:\Users\slema\source\repos\upfuller-client\node_modules\axios\lib\adapters\http.js:322:11) at IncomingMessage.emit (node:events:402:35) at IncomingMessage.emit (node:domain:475:12) at endReadableNT (node:internal/streams/readable:1343:12) at processTicksAndRejections (node:internal/process/task_queues:83:21) ### Expected Behavior that errors are not repeated many times. It seems that it enters an infinite loop of errors ### To Reproduce 1) create a project with npx create-next-app@latest --ts 2) in page/index.tsx is added getServerSideProps: `export const getServerSideProps: GetServerSideProps = async ({ params, res, locale, }) => { try { const { data } = await axios.get( "https://jsonplaceholder.typicode.com/todos/sppsppspsps" ); console.log(data); return { props: { ...data }, }; } catch (error: any) { res.statusCode = 404; console.log(error); console.log("error"); return { notFound: true, props: {}, }; } };` 3) run next dev and access to http://localhost:300/ ![carbon (1)](https://user-images.githubusercontent.com/68788866/153944271-d33aa25f-e127-4f70-9b5e-94e9eeea901f.png) ![err2](https://user-images.githubusercontent.com/68788866/153944278-76f9a283-bf0d-4c33-9003-cadb78b22f43.jpg) ![err1](https://user-images.githubusercontent.com/68788866/153944280-c227d7f2-b07b-4a49-830b-e800337c5571.jpg) Repository: https://github.com/slemac/my-app-2
https://github.com/vercel/next.js/issues/34342
https://github.com/vercel/next.js/pull/34352
7e93a89ba05c70078647c6bb4dfd62372053fead
9639fe704cf5c4a5a477bdc0c43219514c811601
"2022-02-14T20:53:29Z"
javascript
"2022-02-16T18:53:48Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,274
["packages/next/shared/lib/router/router.ts", "test/integration/middleware/with-i18n-preflight/next.config.js", "test/integration/middleware/with-i18n-preflight/pages/_middleware.js", "test/integration/middleware/with-i18n-preflight/pages/index.js", "test/integration/middleware/with-i18n-preflight/test/index.test.js", "test/lib/browsers/base.ts", "test/lib/browsers/playwright.ts", "test/lib/browsers/selenium.ts", "test/lib/next-webdriver.ts"]
Middleware Use Breaks Locale Routing on `/` Path on Vercel if autodetected locale is not default locale
### Run `next info` (available from version 12.0.8 and up) ``` /bin/sh: pnpm: command not found Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 20.5.0: Sat May 8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64 Binaries: Node: 14.17.5 npm: 6.14.14 Yarn: 1.22.5 pnpm: N/A Relevant packages: next: 12.0.10 react: 17.0.2 react-dom: 17.0.2 ``` ### What version of Next.js are you using? 12.0.10 ### What version of Node.js are you using? 14.17.5 ### What browser are you using? Chrome ### What operating system are you using? macOS ### How are you deploying your application? Vercel ### Describe the Bug When using automatic locale detection, and the detected locale is NOT the default locale, trying to route to another locale on `/` results in a failed prefetch error and doesn't complete routing. In my case my locales are `["ja","en"]` and my defaultLocale is `ja`. My browser language is set to english, and with the automatic locale detection, I'm taken to the `/en` route. When I try to route to the `ja` locale in `yarn dev` or `yarn build && yarn start` everything works fine. However when I deploy to Vercel I get: ``` Uncaught (in promise) Error: Failed to preflight request ``` And routing is cancelled. My Japanese users with a japanese langauge setting have no issue moving between the two locales. and if I disable the automatic locale detection I will be taken to `/` with a `ja` locale as expected, and I can freely route between the two locales. ### Expected Behavior I'm expecting to not get a preflight failure from Vercel, and routing to complete successfully. This might be related to https://github.com/vercel/next.js/issues/34199 ### To Reproduce I've created a minimum reproducable repo here using `create-next-app` and the official example at: https://github.com/vercel/examples/tree/main/edge-functions/basic-auth-password Repo/Commits on Github: https://github.com/sollective/next-locale-bug-repro/commits/main I also have it hosted on Vercel here: https://next-locale-bug-repro.vercel.app/en (Credentials are `admin`/`password`) (Please set your primary language to English in browser)
https://github.com/vercel/next.js/issues/34274
https://github.com/vercel/next.js/pull/35911
ad997344893403948a70edb47b0d056658458e39
633050402f8706cb06c1874338ab9d5e6aec1107
"2022-02-12T17:13:33Z"
javascript
"2022-04-07T11:39:49Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,246
["docs/advanced-features/output-file-tracing.md"]
Output File Tracing not working for ISR page
### Run `next info` (available from version 12.0.8 and up) Operating System: Platform: linux Arch: x64 Version: #31-Ubuntu SMP Thu Jan 13 17:41:06 UTC 2022 Binaries: Node: 14.18.2 npm: 8.5.0 Yarn: 1.22.17 pnpm: 6.30.1 Relevant packages: next: 12.0.9 react: 17.0.2 react-dom: 17.0.2 ### What version of Next.js are you using? 12.0.9 ### What version of Node.js are you using? 14.18.2 ### What browser are you using? chromium-based ### What operating system are you using? Kubuntu ### How are you deploying your application? vercel ### Describe the Bug I am currently (with the help of Vercel Support, who also advised me to open an Issue here) debugging why ISR is not working for my project and we've narrowed down the issue to Output File Tracing not catching any of the filesystem calls in my `getStaticProps` function as they are wrapped in convenience functions specifically written for next.js (in the `@foxkit/node-util` module that I wrote for this purpose). Even after specifically including `unstable_includeFiles: ["assets/data", "public/assets/backgrounds"]` in the `next.config.mjs` file none of the calls are recognized and the directory available during ISR revalidation remains basically empty other than the `.next` directory (which btw does *not* contain a directory called `cache` anymore). I have also made a little test app that scans the working directory which somehow has the same issue despite not using the `@foxkit/node-util` package: https://nextjs-playground-mitsunee.vercel.app/ This app imports `fs from "fs/promises"` and uses the `readdir` and `stat` methods, neither of which appear to get recognized by Output File Tracing. ### Expected Behavior for fgo-tools: The entire directories `assets/data` and `public/assets/backgrounds` are available in the working directory of all serverless functions as per configuration file. for the test app: The entire directory excluding node_modules was touched using fs.promises.stat and should thus be available. ### To Reproduce I am honestly not entirely sure. I have a [PR on my fgo-tools repo](https://github.com/Mitsunee/fgo-tools/pull/61) with the issue as well as the [test app's repo](https://github.com/Mitsunee/nextjs-playground)
https://github.com/vercel/next.js/issues/34246
https://github.com/vercel/next.js/pull/34269
c051af85289a67856d692cf3db2540495718e87c
2351e5b70198279c2bfcb59891ee0e0b1e587ff5
"2022-02-11T21:34:36Z"
javascript
"2022-02-12T15:30:20Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,199
["packages/next/server/dev/next-dev-server.ts", "packages/next/shared/lib/router/router.ts", "test/integration/middleware/core/pages/errors/_middleware.js", "test/integration/middleware/core/pages/errors/index.js", "test/integration/middleware/core/pages/errors/throw-on-preflight.js", "test/integration/middleware/core/test/index.test.js"]
Preflight request failures should not block navigation
When the Next.js application shows a `Link` to a route that holds a middleware in its routing path, we run what is called a "preflight" request. This is intended to know how the client should behave when navigating to that location. This points to the bundle that should be preload, the redirection target if any, etc. Currently, when this request fails, the client is no longer able to navigate and clicking the `Link` would just not work. In such cases, the client should control the error and instead perform a hard navigation to the link once it is clicked.
https://github.com/vercel/next.js/issues/34199
https://github.com/vercel/next.js/pull/35145
d3cd00cfcf5ae05ad2e2edea7aaa2facc93a5c16
9e4724dea24e8b3bee20dfd18a648f1fb387c1d5
"2022-02-10T19:49:13Z"
javascript
"2022-03-08T19:51:08Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,134
["packages/next/server/next-server.ts", "test/production/required-server-files.test.ts"]
`Error: Cannot find module './image-optimizer'` from serverless functions (12.0.11-canary.10)
### Run `next info` (available from version 12.0.8 and up) ``` Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_ARM64_T8101 Binaries: Node: 16.13.2 npm: 8.1.2 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.0.11-canary.10 react: 17.0.2 react-dom: 17.0.2 ``` ### What version of Next.js are you using? 12.0.11-canary.10 ### What version of Node.js are you using? 16.13.2 (14.x on Vercel) ### What browser are you using? Chrome ### What operating system are you using? macOS ### How are you deploying your application? Vercel ### Describe the Bug After upgrading from 12.0.11-canary.9 to canary.10, I'm getting 500 errors from many of my serverless functions (and SSR pages) and this exception in the logs: ``` 2022-02-09T16:23:26.321Z undefined ERROR Uncaught Exception {"errorType":"Runtime.ImportModuleError","errorMessage":"Error: Cannot find module './image-optimizer' Require stack: - /var/task/node_modules/next/dist/server/next-server.js - /var/task/___next_launcher.js - /var/runtime/UserFunction.js - /var/runtime/index.js","stack":["Runtime.ImportModuleError: Error: Cannot find module './image-optimizer'","Require stack:","- /var/task/node_modules/next/dist/server/next-server.js","- /var/task/___next_launcher.js","- /var/runtime/UserFunction.js","- /var/runtime/index.js"," at _loadUserApp (/var/runtime/UserFunction.js:202:13)"," at Object.module.exports.load (/var/runtime/UserFunction.js:242:17)"," at Object.<anonymous> (/var/runtime/index.js:43:30)"," at Module._compile (internal/modules/cjs/loader.js:1085:14)"," at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)"," at Module.load (internal/modules/cjs/loader.js:950:32)"," at Function.Module._load (internal/modules/cjs/loader.js:790:12)"," at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)"," at internal/main/run_main_module.js:17:47"]} Unknown application error occurred Runtime.ImportModuleError ``` I assume this has to do with #34075 ? I'm not doing any image processing in these functions but maybe I'm doing something else crazy and unsupported... Source code and logs are linked to below. Thanks in advance! ### Expected Behavior No `image-optimizer` errors where images aren't being optimized would be my first thought, but not familiar enough with what's going on in #34075 to make a more educated guess... 😬 ### To Reproduce My source code is public and a good example is at: https://github.com/jakejarvis/jarv.is/blob/dependabot/npm_and_yarn/next-12.0.11-canary.10/pages/feed.xml.ts I believe my Vercel logs are public too, if you try to request this page at: https://jarvis-git-dependabot-npmandyarnnext-12011-canary10-jakejarvis.vercel.app/feed.xml ...and view the logs at https://vercel.com/jakejarvis/jarvis/AG74op91Fv9CnaHZDeJETjvg8XtS/functions --- edit: Forgot to add that I'm not getting this error locally with `next dev`, which makes sense but thought I should mention it.
https://github.com/vercel/next.js/issues/34134
https://github.com/vercel/next.js/pull/34141
2e0598d02bf944bcea766120aa79ae1d82c2d95b
28f65ff4116824d888f0b29c17b08173a27d751f
"2022-02-09T16:36:08Z"
javascript
"2022-02-09T18:37:55Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,086
["packages/next/compiled/sass-loader/cjs.js", "packages/next/package.json", "yarn.lock"]
Possible to request for node-sass@^7.0.0 support
### Describe the feature you'd like to request Currently there's a peerDep for node-sass support up till 6. Possible to add the 7.0 dep to peerDeps? Reason: when using Node17, node-sass v6 no longer supported. ### Describe the solution you'd like To add node-sass@^7.0.0 as peerDependencies ### Describe alternatives you've considered Possible to remove node-sass as peerDeps as it is already deprecated
https://github.com/vercel/next.js/issues/34086
https://github.com/vercel/next.js/pull/34107
76d274dbec6d970669107f1945be620bdb919b2b
7ac9c484c32e9a488c060e998f44dccda58c6ee1
"2022-02-08T08:25:39Z"
javascript
"2022-02-11T21:14:09Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,077
["examples/with-firebase/pages/index.js"]
Next.js w/ Firebase Server-Side bug - simple fix
### What example does this report relate to? with-firebase ### What version of Next.js are you using? 12.0.10 ### What version of Node.js are you using? 14.15.4 ### What browser are you using? Chrome ### What operating system are you using? macOS ### How are you deploying your application? firebase ### Describe the Bug Data from firestore does not appear in the example page http://localhost:3000/profile/nextjs_user Changing line 27 in pages/profile/[username].js fixed it for me. Thought this may be helpful to others from: `const profile = await getProfileData(username)` to: `const { profile } = await getProfileData(username)` ### Expected Behavior this data should be displayed on http://localhost:3000/profile/nextjs_user ``` <p>{profile.username}</p> <p>{profile.message}</p> ``` ### To Reproduce 1. Configure app as shown in the readme 2. Run `yarn dev` 3. Use button on page to create user 4. go to http://localhost:3000/profile/nextjs_user
https://github.com/vercel/next.js/issues/34077
https://github.com/vercel/next.js/pull/34457
f3c3810addff3cf19d66f2cbb4b6ddb61d241aa1
ba78437cfff866c02468b6b180f8ea72979ef76e
"2022-02-08T02:41:37Z"
javascript
"2022-02-17T04:04:29Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,064
["packages/next/build/webpack-config.ts", "packages/next/build/webpack/plugins/nextjs-ssr-import.ts"]
`next build` fails with `The "path" argument must be of type string` with WebWorker within workspaces
### Run `next info` (available from version 12.0.8 and up) Operating System: Platform: linux Arch: x64 Version: #1 SMP Debian 5.15.5-2~bpo11+1 (2022-01-02) Binaries: Node: 16.13.2 npm: 8.1.2 Yarn: 1.22.17 pnpm: 6.30.0 Relevant packages: next: 12.0.10 react: 17.0.2 react-dom: 17.0.2 ### What version of Next.js are you using? 12.0.10 ### What version of Node.js are you using? 16.13.2 ### What browser are you using? Chrome, Safari, ... ### What operating system are you using? Linux ### How are you deploying your application? next build ### Describe the Bug With the setup described at https://github.com/andreypopp/next-repro-25484 `next build` command fails with: ``` webpack/runtime/compat The "path" argument must be of type string. Received undefined ``` ### Expected Behavior `next build` is expected to build this correctly ### To Reproduce This is using `pnpm` and workspaces. Note that I was able to reproduce this with `yarn` workspaces as well but in some configurations. Here I can reliably reproduce it with `pnpm`. ``` git clone [email protected]:andreypopp/next-repro-25484.git cd ./next-repro-25484 pnpm install (cd with-web-worker/ && pnpm run build) ```
https://github.com/vercel/next.js/issues/34064
https://github.com/vercel/next.js/pull/34087
40329a70a5b4680e71c5ee1d9a7e59b10d80f113
451dfa14f145d0499f39d932eddad39f66328f54
"2022-02-07T16:52:01Z"
javascript
"2022-02-08T15:20:00Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,062
["packages/next/client/image.tsx"]
Issue with <Image /> component in old versions of Chrome
### Run `next info` (available from version 12.0.8 and up) ``` Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.3.0: Wed Jan 5 21:37:58 PST 2022; root:xnu-8019.80.24~20/RELEASE_X86_64 Binaries: Node: 16.13.1 npm: 8.3.0 Yarn: 1.22.17 pnpm: N/A Relevant packages: next: 12.0.10 react: 17.0.2 react-dom: 17.0.2 ``` ### What version of Next.js are you using? 12.0.10 ### What version of Node.js are you using? 16.13.1 ### What browser are you using? Chrome/65.0.3325.181, Chrome/68.0.3440.84 ### What operating system are you using? MacOS 12.2, Windows 10 ### How are you deploying your application? Custom Docker container running in Azure ### Describe the Bug I have the misfortune of having to support a number of very old Chrome versions (65 and 68 currently) on a project that uses Next.js. We are currently running Next.js version `11.1.3` in production without issue but would like to upgrade to Next.js 12. I've already successfully jumped through some other hoops in order for that to work and was about to merge our upgrade branch when I stumbled upon an additional issue. The `next/image` component in version 12 is using the `PerformanceObserver` API in a way that does not work in a Chrome version this old—attempting to display an `<Image />` on any page throws the below error: ``` Failed to execute 'observe' on 'PerformanceObserver': required member entryTypes is undefined ``` I have found [this W3C discussion](https://github.com/w3c/performance-timeline/issues/87) that tells me (if I'm reading it right) this issue is fixed in newer browser versions, but it still affects mine. I have also seen [issue #30322](https://github.com/vercel/next.js/issues/30322) which comes close to my problem but does not quite fix it. Based on the comments in that issue, my current workaround for the problem is [a custom hook](https://gist.github.com/jpkempf/968a140b833520ae7cf3b5d039568314) that mocks the `PerformanceObserver` API in any component where this is required, and restores it afterwards. I don't know whether there's anything that can or should be done about this issue, but I wanted to at least raise awareness of it. ### Expected Behavior I would expect the `<Image />` component to render properly instead of throwing an error, even when the `PerformanceObserver` API is not fully supported. ### To Reproduce This should work in recent browsers and fail in Chrome 65: https://stackblitz.com/edit/nextjs-6nehqb?file=pages%2Findex.js
https://github.com/vercel/next.js/issues/34062
https://github.com/vercel/next.js/pull/35202
0355e5f63f87db489f36db8d814958cb4c2b828b
ea87415fd9fa56014a1b100d2ea22a3673cef1b9
"2022-02-07T15:57:37Z"
javascript
"2022-03-10T16:06:50Z"
closed
vercel/next.js
https://github.com/vercel/next.js
34,025
["packages/next/server/render.tsx", "test/development/watch-config-file/index.test.ts", "test/integration/mixed-ssg-serverprops-error/test/index.test.js"]
Inaccurate error message when getStaticProps exported from page without a page component
### Run `next info` (available from version 12.0.8 and up) ``` /bin/sh: 1: pnpm: not found Operating System: Platform: linux Arch: x64 Version: #109-Ubuntu SMP Wed Jan 12 16:49:16 UTC 2022 Binaries: Node: 16.13.2 npm: 8.1.2 Yarn: 1.22.5 pnpm: N/A Relevant packages: next: 12.0.11-canary.6 react: 17.0.2 react-dom: 17.0.2 ``` ### What version of Next.js are you using? 12.0.11-canary.6 ### What version of Node.js are you using? 16.13.2 ### What browser are you using? Firefox ### What operating system are you using? Ubuntu ### How are you deploying your application? next dev ### Describe the Bug When you have a page file which has a `getStaticProps` function exported, but no default export for a page component: ```js export const getStaticProps = async (context) => ({ redirect: { destination: "https://example.com", permanent: false } }); ``` You get this server error: > Error: page /pageName getStaticProps can not be attached to a page's component and must be exported from the page. See more info here: https://nextjs.org/docs/messages/gssp-component-member Even though the `getStaticProps` is correctly exported from the page. ### Expected Behavior Ideally having no page component export would be allowed and not cause an error (it's useful in cases where you'd only ever return a redirect or an error), but if this isn't supported the error message should say something like > Error: page /pageName does not have a default export page component. If the page won't ever render, export a function that returns null. ### To Reproduce 1. Create a page that has a getStaticProps function but no default page component export, like the example in the "describe the bug" section 2. Run `next dev` 3. Navigate to the page in your browser
https://github.com/vercel/next.js/issues/34025
https://github.com/vercel/next.js/pull/34287
90ada64d058c19827b4e856b77a495b026e77234
b4089f3732bd1746451ef0b25b217e26c83e2c2c
"2022-02-06T00:42:45Z"
javascript
"2022-05-22T21:50:21Z"
closed
vercel/next.js
https://github.com/vercel/next.js
33,942
["packages/next/shared/lib/router/router.ts", "test/integration/middleware/core/pages/rewrites/_middleware.js", "test/integration/middleware/core/pages/rewrites/index.js", "test/integration/middleware/core/test/index.test.js"]
Middleware NextResponse.rewrite does not work for client side routing using next/link
### Run `next info` (available from version 12.0.8 and up) ``` Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 20.5.0: Sat May 8 05:10:31 PDT 2021; root:xnu-7195.121.3~9/RELEASE_ARM64_T8101 Binaries: Node: 14.18.3 npm: 6.14.15 Yarn: 1.22.11 pnpm: N/A Relevant packages: next: 12.0.11-canary.3 react: 17.0.2 react-dom: 17.0.2 ``` ### What version of Next.js are you using? 12.0.11-canary.3 ### What version of Node.js are you using? v14.18.3 ### What browser are you using? Edge ### What operating system are you using? macOS (m1) ### How are you deploying your application? n/a bug is reproducible locally ### Describe the Bug When clicking on a `next/link` and href of the `next/link` has a corresponding page in `/pages` and `NextResponse.rewrite()` is called within the middleware of the page (confirmed by console logging just before the call) then the browser routes to the corresponding page in `/pages` however if refreshing on this page or navigating to it from another means (address bar, for example) then the rewrite is successfully applied ### Expected Behavior When clicking on a `next/link` and href of the `next/link` has a corresponding page in `/pages` and `NextResponse.rewrite()` is called within the middleware of the page then the browser rewrites the request and the rewritten url content is displayed ### To Reproduce [example repo here](https://github.com/JackOddy/client_side_rewrites_not_working) spin up the next.js project by running `yarn dev` navigate to localhost:3000 on the browser click the text on the page (wrapped in next/link) see that the browser has navigated to `/overwritten` see that the content displayed is not that of the overwritten url
https://github.com/vercel/next.js/issues/33942
https://github.com/vercel/next.js/pull/33962
0b1d5e17bc304ba9bbc2cafc9b370bc66e359e7d
103d3ab4fc0a724e7329ab4a4b184b9c85da4117
"2022-02-03T12:01:59Z"
javascript
"2022-02-04T19:32:30Z"
closed
vercel/next.js
https://github.com/vercel/next.js
33,915
["packages/next/build/babel/preset.ts", "packages/next/build/swc/options.js", "test/unit/next-babel-loader-prod.test.ts"]
[regression] next throws away my optional chaining and gives me a prerender error instead
### Run `next info` (available from version 12.0.8 and up) ``` 'yarn' is not recognized as an internal or external command, operable program or batch file. 'pnpm' is not recognized as an internal or external command, operable program or batch file. Operating System: Platform: win32 Arch: x64 Version: Windows 10 Pro Binaries: Node: 16.13.1 npm: 8.1.2 Yarn: N/A pnpm: N/A Relevant packages: next: 12.0.11-canary.1 react: 17.0.2 react-dom: 17.0.2 ``` ### What version of Next.js are you using? 12.0.11-canary.1 ### What version of Node.js are you using? v16.13.1 ### What browser are you using? Unrelated ### What operating system are you using? Windows 11 ### How are you deploying your application? Unrelated ### Describe the Bug With a super simple page like this ```js import { value } from "../value" export default function Home() { return ( <div> {value?.not?.existed?.property} </div> ) } ``` and `value.js` ```js export const value = {}; ``` `next build` works with version 12.0.7, but not with 12.0.8 and later ``` info - Checking validity of types info - Creating an optimized production build info - Compiled successfully info - Collecting page data [ ] info - Generating static pages (0/3) Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error TypeError: Cannot read properties of undefined (reading 'existed') at Home (<project_folder>\.next\server\pages\index.js:29:29) at d (<project_folder>\node_modules\react-dom\cjs\react-dom-server.node.production.min.js:33:498) at bb (<project_folder>\node_modules\react-dom\cjs\react-dom-server.node.production.min.js:36:16) at a.b.render (<project_folder>\node_modules\react-dom\cjs\react-dom-server.node.production.min.js:42:43) at a.b.read (<project_folder>\node_modules\react-dom\cjs\react-dom-server.node.production.min.js:41:83) at Object.exports.renderToString (<project_folder>\node_modules\react-dom\cjs\react-dom-server.node.production.min.js:52:138) at Object.renderPage (<project_folder>\node_modules\next\dist\server\render.js:736:46) at Object.defaultGetInitialProps (<project_folder>\node_modules\next\dist\server\render.js:368:51) at Function.getInitialProps (<project_folder>\.next\server\pages\_document.js:530:20) at Object.loadGetInitialProps (<project_folder>\node_modules\next\dist\shared\lib\utils.js:69:29) info - Generating static pages (3/3) > Build error occurred Error: Export encountered errors on following paths: / at <project_folder>\node_modules\next\dist\export\index.js:499:19 at runMicrotasks (<anonymous>) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Span.traceAsyncFn (<project_folder>\node_modules\next\dist\trace\trace.js:75:20) at async <project_folder>\node_modules\next\dist\build\index.js:1014:17 at async Span.traceAsyncFn (<project_folder>\node_modules\next\dist\trace\trace.js:75:20) at async <project_folder>\node_modules\next\dist\build\index.js:888:13 at async Span.traceAsyncFn (<project_folder>\node_modules\next\dist\trace\trace.js:75:20) at async Object.build [as default] (<project_folder>\node_modules\next\dist\build\index.js:82:25) ``` --- `<project_folder>\.next\server\pages\index.js` produced by 12.0.7: ```js function Home() { var ref, ref1; return(/*#__PURE__*/ jsx_runtime_namespaceObject.jsx("div", { children: value === null || value === void 0 ? void 0 : (ref = value.not) === null || ref === void 0 ? void 0 : (ref1 = ref.existed) === null || ref1 === void 0 ? void 0 : ref1.property })); }; ``` by 12.0.8 ```js function Home() { return(/*#__PURE__*/ jsx_runtime_namespaceObject.jsx("div", { children: value.not.existed.property })); }; ``` ### Expected Behavior It builds. ### To Reproduce ``` git clone https://github.com/yume-chan/next-ssg-regression.git cd next-ssg-regression npm i npm run build ```
https://github.com/vercel/next.js/issues/33915
https://github.com/vercel/next.js/pull/35976
fe6e74dc57a811f83a4908bc2a138ce087b31be3
3ae571d97b429e9d7b57fb21d5e4dab4f39735e7
"2022-02-02T14:45:48Z"
javascript
"2022-04-16T02:48:43Z"
closed
vercel/next.js
https://github.com/vercel/next.js
33,895
["docs/advanced-features/output-file-tracing.md"]
`outputStandalone` option does not include public directory in monorepo setup
### Run `next info` (available from version 12.0.8 and up) Operating System: Platform: linux Arch: x64 Version: #103-Ubuntu SMP Fri Nov 26 16:13:00 UTC 2021 Binaries: Node: 16.12.0 npm: 8.1.0 Yarn: 1.22.15 pnpm: N/A Relevant packages: next: 12.0.9 react: 17.0.2 react-dom: 17.0.2 ### What version of Next.js are you using? 12.0.9 ### What version of Node.js are you using? 16.12.0 ### What browser are you using? Chromium Edge ### What operating system are you using? Linux ### How are you deploying your application? next build with `outputStandalone: true` ### Describe the Bug `outputStandalone` server does not include the public directory in a monorepo with multiple referencing packages, so files such as `robots.txt` and `favicon.ico` that live in those directories are not present. ### Expected Behavior `outputStandalone` should include the public directory in the server it creates ### To Reproduce Have a monorepo with multiple packages referencing each other. I am using Turborepo. Build with output standalone and notice that server.js is output to standalone/apps/web/server.js instead of the root of the standalone dir. ### Workaround Copy the public directory to standalone/apps/web. Sorry for the lack of a repro - hopefully someone with a ton more knowledge of the inner workings of this experiment can trivially pinpoint this. Thanks for all of y'alls work!
https://github.com/vercel/next.js/issues/33895
https://github.com/vercel/next.js/pull/34646
5c8e787803af7337f8b7665bceb8b90be78dff5a
411a9b84d8f7dec29ddb0d249c161400bda5f02d
"2022-02-02T03:41:27Z"
javascript
"2022-02-21T18:14:11Z"
closed
vercel/next.js
https://github.com/vercel/next.js
33,879
["packages/next/build/entries.ts", "packages/next/build/webpack/loaders/next-serverless-loader/index.ts", "packages/next/export/index.ts", "packages/next/server/base-server.ts", "packages/next/server/render.tsx"]
React.lazy() content HTML does not get included in SSG output
### Run `next info` (available from version 12.0.8 and up) Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64 Binaries: Node: 16.13.0 npm: 8.1.0 Yarn: 1.22.0 pnpm: N/A Relevant packages: next: 12.0.10 react: 0.0.0-experimental-fa816be7f-20220128 react-dom: 0.0.0-experimental-fa816be7f-20220128 ### What version of Next.js are you using? 12.0.10 ### What version of Node.js are you using? 16.13.0 ### What browser are you using? Chrome ### What operating system are you using? macOS ### How are you deploying your application? next start ### Describe the Bug @devknoll asked me to file an issue for this. Basically, I'm observing that with React experimental versions, SSG doesn't wait for `lazy()` to be resolved and outputs the Suspense fallback HTML. Whereas I would've expected it to include content in SSG. I'm not sure if this means `import()` needs to be compiled differently, or something. A similar issue is that in SSR mode, the first hit will get fallback HTML and the next hits will get content HTML. Because the module is cached now. ### Expected Behavior HTML output of SSG includes the SSR content of the lazy child. ### To Reproduce Create a new clean project. Add experimental React versions to it. Page code: ```js import {lazy, Suspense} from 'react' import Head from 'next/head' const Child = lazy(() => import('../components/Child')) export default function Home() { return ( <div> <Head> <title>Create Next App</title> <meta name="description" content="Generated by create next app" /> <link rel="icon" href="/favicon.ico" /> </Head> <main> <h1> Welcome to <a href="https://nextjs.org">Next.js!</a> </h1> <Suspense fallback={<p style={{ color: 'red' }}>Loading...</p>}> <Child /> </Suspense> </main> </div> ) } ``` Component code: ```js // Some heavy lib to simulate loading a large chunk import {marked} from 'marked' export default function Child() { return <div dangerouslySetInnerHTML={{ __html: marked(`# hello, world!`) }} /> } ``` Run `yarn build` and then `yarn start`. Observe that the served HTML does **not** include `hello, world!` but does include `Loading...`.
https://github.com/vercel/next.js/issues/33879
https://github.com/vercel/next.js/pull/34106
fb80055a1fc46ef8716318f79c9ff68bcdbe43e8
df29561ae3ad28961f808d1735dcfb7907f2c920
"2022-02-01T21:20:44Z"
javascript
"2022-02-08T19:39:27Z"