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
23,525
["docs/api-reference/next/link.md"]
Using next/link prefetch={false} still prefetches on hover with SSG
### What version of Next.js are you using? 10.1.1 ### What version of Node.js are you using? 16.6 ### What browser are you using? Chrome ### What operating system are you using? Windows ### How are you deploying your application? Vercel ### Describe the Bug When hovering over a `next/link` component having set `prefetch={false}` does try to prefetch the json file. ### Expected Behavior `prefetch={false}` should never prefetch ### To Reproduce ``` <Link href={route} prefetch={false}> <a>Test</a> </Link ```
https://github.com/vercel/next.js/issues/23525
https://github.com/vercel/next.js/pull/24171
fe0583edea83c42332f1b65485f93f6096f317bd
6e22a440e284628ed768a1a92a2936b9f5b1f380
"2021-03-30T06:56:48Z"
javascript
"2021-04-17T16:08:06Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,467
["packages/next/next-server/lib/router/router.ts", "test/integration/i18n-support-same-page-hash-change/next.config.js", "test/integration/i18n-support-same-page-hash-change/pages/about.js", "test/integration/i18n-support-same-page-hash-change/pages/posts/[...slug].js", "test/integration/i18n-support-same-page-hash-change/test/index.test.js"]
Navigating to the same page in a different locale with a hash does not update props
### What version of Next.js are you using? 10.0.9 ### What version of Node.js are you using? 14.16.0 ### What browser are you using? Chromium Edge ### What operating system are you using? macOS ### How are you deploying your application? Vercel ### Describe the Bug For a language switcher, I only change the locale for the page and nothing in the url. Using `router.push` with the Url object representing the current page and setting `hash` to the hash of the current page, there is only a `hashChangeStart` and subsequent `hashChangeComplete` event and not a props update. ### Expected Behavior There should be a page update (for fetching new translations etc.) while keeping the hash in the url. ### To Reproduce https://codesandbox.io/s/heuristic-blackburn-jpu7g In the demo, go the "About Page" or the "Post Page". Click on the "Change Language" button. The value of the locale in `useRouter` updates while the props do not. There are also the `hashChange` events in the console. Setting `router.push` to not set the `hash` (in `components/demo`) causes a props update as expected but removes the hash.
https://github.com/vercel/next.js/issues/23467
https://github.com/vercel/next.js/pull/26205
f6e5a816e2855ae0b271eeaf87ac94c0caf83ab4
be62f023b684072c1b80e265318f12e02e67ca82
"2021-03-27T23:57:00Z"
javascript
"2021-06-23T19:04:31Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,436
["packages/next/next-server/server/image-optimizer.ts", "test/integration/image-optimizer/test/index.test.js"]
Race condition with Image Loader makes it unusable in a production environment
### What version of Next.js are you using? 10.0.9 ### What version of Node.js are you using? v12.19.0, v14.16.0 ### What browser are you using? Any browser ### What operating system are you using? Any OS ### How are you deploying your application? AWS ### Describe the Bug The default image loader at present seems to suffer from a race condition. Unfortunately this issue has now meant that for us, the pretty awesome functionality, cannot be used at all. Assuming the image cache does not contain the given image, when making a request the loader will go off and do it's thing and then return the given image and add it to its cache. The problem comes when you have real traffic. Example scenario: Lets assume you have a simple page that has 3 images that are utilising next/image. The page has an average traffic of 10 req/s for a given screen size. This page is brand new and the images have never been server before (ie the image's do not yet exist in the cache). Currently when this above scenario happens, c.30 calls to the original image URL happen. Each one of these images then resolves, gets transformed and then placed into the cache and returned to the user. The important note here is that we now have a cache folder that contains 10 cached files of the same image three times. When we replicate the above scenario but in more realistic terms (12 images on a new page with average traffic of 25 req/s) this means that we suddenly have a cache folder that contains 25 images x 12 (300 total). This is because when the first request comes in, the code says hey you're not in the cache, lets go get you. The second request comes in and says, hey you're not in the cache (because the first one is still processing), let's go get you and so on and so on. So why does this cause the container to die? It doesn't; writing and reading from disk is not the only thing that the loader is doing. Http requests, FS, Image manipulation. These things are heavy on not only memory but CPU too. In the above example we're asking a container to not only go and fetch 300 images per second, we're also manipulating, writing to file storage, serving back. The chances are then by the time these have finished, the next second comes around with another 300 requests, the chances are probably the images still aren't in the cache because the the CPU is rocketed and so has the memory so things just start to back up and get worse and worse until the container falls over completely. TL;DR: Requests to non cached images are not aware of each other which means there's a race condition when the same image is requested from the same user within the same time period of it not being in the cache. This then (with enough traffic) spirals into a horrible loop that is non escapable and leads to the containers falling over. ### Expected Behavior I'd expect that when parallel requests are made, that the image loader is directly only called once and is sat behind some sort of batching mechanism (similar to DataLoader) that removes duplicates and is aware of parallel requests and then maps the responses accordingly. This means that the site could require 500 images per second of the same image, but only do all of the hardware intensive stuff once. ### To Reproduce - Create simple page with a single (or multiple) image(s) utilising next/image - Deploy/run the container so you can see memory/cpu usage - Start simultaneous request - Notice Memory/CPU usage climbing - Notice cache folder starting to drastically grow in size - If persisted, eventually hardware limitations will be met
https://github.com/vercel/next.js/issues/23436
https://github.com/vercel/next.js/pull/24000
25ca1b5babe41033f4a2c9e5bbc98c384c8f8660
b610db830ef1ef2458c3c75ba1955b57b7291264
"2021-03-26T21:04:55Z"
javascript
"2021-04-12T22:38:51Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,318
["packages/next/export/index.ts"]
CIRCLE_NODE_TOTAL isn't used when running next export
### What version of Next.js are you using? 10.06 ### What version of Node.js are you using? 14.7 ### What browser are you using? Chrome ### What operating system are you using? macOS ### How are you deploying your application? next export ### Describe the Bug The default config for `next build` will use the `CIRCLE_NODE_TOTAL` env var if it is available https://github.com/vercel/next.js/blob/canary/packages/next/next-server/server/config-shared.ts#L67 ```js cpus: Math.max( 1, (Number(process.env.CIRCLE_NODE_TOTAL) || (os.cpus() || { length: 1 }).length) - 1 ), ``` but when running `next export` it does not do the same check. ### Expected Behavior `next export` should set number threads the same way as `next build` ```js cpus: Math.max( 1, (Number(process.env.CIRCLE_NODE_TOTAL) || (os.cpus() || { length: 1 }).length) - 1 ), ``` ### To Reproduce run `export CIRCLE_NODE_TOTAL=4; next export` and you should see the log ```bash Launching {os.cpus().length - 1} workers ``` instead of ```bash Launching 4 workers ```
https://github.com/vercel/next.js/issues/23318
https://github.com/vercel/next.js/pull/24180
646a881183132b0756818bc48484360c1fa12cf8
432c9ee5fcf7687e0dae2252a7eed2277c954d16
"2021-03-23T16:23:05Z"
javascript
"2021-04-17T20:09:26Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,312
["packages/next/next-server/server/image-optimizer.ts", "test/integration/image-optimizer/public/text.txt", "test/integration/image-optimizer/test/index.test.js"]
next/image serves files other than images from public dir
### What version of Next.js are you using? 10.0.7 ### What version of Node.js are you using? 14.15.1 ### What browser are you using? chrome ### What operating system are you using? linux ### How are you deploying your application? next start ### Describe the Bug `next/image` package should not serve other files rather then only images excluding svg ### Expected Behavior only image are allowed, excluding svg - it is responsive by it self ### To Reproduce 1. create simple nextjs app 2. add simple json file to `public/locales/en-GB/common.json` with some sample json content 3. run `npm build` 4. run `npm start` 5. navigate to `http://localhost:3000/_next/image?url=/locales/en-GB/common.json&w=640&q=75` ![image](https://user-images.githubusercontent.com/468006/112150482-d0ff5500-8be8-11eb-9665-8a1e55b1c38a.png)
https://github.com/vercel/next.js/issues/23312
https://github.com/vercel/next.js/pull/23366
1dae2288779656853310e15b14e750f096f5ba26
98211405a60d286a8769dc1b76723016153355a6
"2021-03-23T13:02:46Z"
javascript
"2021-03-24T17:59:00Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,299
["examples/blog/package.json", "examples/blog/pages/index.mdx"]
`blog` in examples seems like there needs some package dependency fix while doing `npm i`
### What version of Next.js are you using? latest ### What version of Node.js are you using? 14.16.0 ### What browser are you using? Chrome ### What operating system are you using? Linux - PopOS ### How are you deploying your application? -- ### Describe the Bug While doing `npm i`, issue occurs with different versions of react being used in dependencies..! ### Expected Behavior `npm i` should succeed. ### To Reproduce ```bash cd next.js/examples/blog npm i ``` ![image](https://user-images.githubusercontent.com/31458531/112117649-8fb77700-8be1-11eb-906f-65a82cfc0d19.png)
https://github.com/vercel/next.js/issues/23299
https://github.com/vercel/next.js/pull/23317
48dd9954d8b8cf257e5f1f47709c5dfe8c428345
361b56b2c2373012051266332905b1dcef085251
"2021-03-23T08:40:55Z"
javascript
"2021-03-23T20:02:03Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,252
["packages/next/client/link.tsx", "test/integration/client-navigation/pages/nav/index.js", "test/integration/client-navigation/test/index.test.js", "test/lib/browsers/base.ts", "test/lib/browsers/playwright.ts"]
<Link /> inside an SVG won't allow user to cmd+click and open page in new tab
### What version of Next.js are you using? 10.0.9 ### What version of Node.js are you using? 10.23.0 ### What browser are you using? chrome ### What operating system are you using? macOS ### How are you deploying your application? N/A ### Describe the Bug Command+click on a `<Link />` which is rendered inside an SVG does not open the link in a new tab/window. ### Expected Behavior Command+click on a link rendered inside an SVG should open the link in a new tab/window. ### To Reproduce Here's a simple codesandbox with the issue: https://codesandbox.io/s/compassionate-morning-ql359 1. create an SVG as follows: ```tsx <svg> <Link href="/about"> <a> <rect width={100} height={100} /> </a> </Link> </svg> ``` 2. Command+click on the `rect` in order to see the window navigate to the link instead of opening a new tab with that link. I can confirm that disabling javascript will have the expected result (open new tab), which I think means the click handlers of the Link component are the culprit.
https://github.com/vercel/next.js/issues/23252
https://github.com/vercel/next.js/pull/23272
6090101581620416ae653d519608f03dc966be9f
b39e49eca93ba9144f024189e18bada8e8dacd72
"2021-03-21T20:37:43Z"
javascript
"2022-02-06T20:53:03Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,240
["packages/next/build/index.ts"]
Add separate log line for type checking
To separate out the type checking from building the app.
https://github.com/vercel/next.js/issues/23240
https://github.com/vercel/next.js/pull/23226
ebfbbdb331f8f93d92650cb4689807f67219833d
8c72806aced6bd1a9e06d7e9289e691f7fa5ed49
"2021-03-20T18:45:22Z"
javascript
"2021-03-20T19:11:45Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,201
["packages/next/client/image.tsx", "test/integration/image-component/base-path/test/index.test.js", "test/integration/image-component/default/test/index.test.js"]
VoiceOver support in next/image
### What version of Next.js are you using? 10.0.6 ### What version of Node.js are you using? 12.20.1 ### What browser are you using? Chrome ### What operating system are you using? macOS 11 ### How are you deploying your application? next start + Vercel ### Describe the Bug When using `next/image` images that are below the fold, the images are loaded using `visibility: none`. This causes screenreaders to ignore the element and not read it, even though scrolling the element into the viewport would display the element for sighted users. ### Expected Behavior VoiceOver should read and scroll to `next/image` images below the fold. ### To Reproduce See repo here: https://github.com/myplanetdigital/voiceover-next-image-bug and deployment here: https://voiceover-next-image-shanly-myplanet.vercel.app/ Steps to reproduce: 1. Go to the deployment with VoiceOver on 2. Try to navigate using the voiceover cursor (VO+left, VO+right) 3. Note that the UL is announced as having four items, but only one (the one above the fold) is read. I believe this is due to the use of `visibility: hidden`, which prevents screen readers from parsing an element. I don't understand the purpose of that rule as the images are already defaulting to lazy loading.
https://github.com/vercel/next.js/issues/23201
https://github.com/vercel/next.js/pull/23278
f384cd103b6031e6555237ae9f4eddf67004adbe
c8680a344f2872e4640c4096c2ddaf6cb8581e5f
"2021-03-18T17:26:58Z"
javascript
"2021-03-22T19:20:52Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,169
["packages/next/build/webpack-config.ts", "packages/next/package.json", "test/integration/basic/pages/node-browser-polyfills.js", "test/integration/basic/test/index.test.js", "yarn.lock"]
Missing webpack fallbacks for http and https
### What version of Next.js are you using? 10.0.9 ### What version of Node.js are you using? v15.11.0 ### What browser are you using? Chrome ### What operating system are you using? macOS ### How are you deploying your application? N/A ### Describe the Bug The `resolve.fallback` option to webpack is missing `http`, `https`, and several other of the Node.js built-ins. Here is what I get: ```js { extensions: [ '.mjs', '.js', '.jsx', '.json', '.wasm' ], modules: [ 'node_modules' ], alias: { next: '/Users/feross/code/sync/node_modules/next', 'private-next-pages': '/Users/feross/code/sync/pages', 'private-dot-next': '/Users/feross/code/sync/.next', 'unfetch$': '/Users/feross/code/sync/node_modules/next/dist/build/polyfills/fetch/index.js', 'isomorphic-unfetch$': '/Users/feross/code/sync/node_modules/next/dist/build/polyfills/fetch/index.js', 'whatwg-fetch$': '/Users/feross/code/sync/node_modules/next/dist/build/polyfills/fetch/whatwg-fetch.js', 'object-assign$': '/Users/feross/code/sync/node_modules/next/dist/build/polyfills/object-assign.js', 'object.assign/auto': '/Users/feross/code/sync/node_modules/next/dist/build/polyfills/object.assign/auto.js', 'object.assign/implementation': '/Users/feross/code/sync/node_modules/next/dist/build/polyfills/object.assign/implementation.js', 'object.assign$': '/Users/feross/code/sync/node_modules/next/dist/build/polyfills/object.assign/index.js', 'object.assign/polyfill': '/Users/feross/code/sync/node_modules/next/dist/build/polyfills/object.assign/polyfill.js', 'object.assign/shim': '/Users/feross/code/sync/node_modules/next/dist/build/polyfills/object.assign/shim.js', url: '/Users/feross/code/sync/node_modules/native-url/dist/index.js', '/Users/feross/code/sync/node_modules/next/dist/next-server/lib/router/utils/resolve-rewrites.js': '/Users/feross/code/sync/node_modules/next/dist/next-server/lib/router/utils/resolve-rewrites-noop.js' }, fallback: { buffer: 'buffer', crypto: '/Users/feross/code/sync/node_modules/crypto-browserify/index.js', path: '/Users/feross/code/sync/node_modules/path-browserify/index.js', stream: '/Users/feross/code/sync/node_modules/stream-browserify/index.js', vm: '/Users/feross/code/sync/node_modules/vm-browserify/index.js' }, mainFields: [ 'browser', 'module', 'main' ], plugins: [] } ``` ### Expected Behavior I expected to see the other Node.js builtins. ### To Reproduce N/A
https://github.com/vercel/next.js/issues/23169
https://github.com/vercel/next.js/pull/23316
361b56b2c2373012051266332905b1dcef085251
c219c1d9ceba30111501dd6203890d61b34dc6ae
"2021-03-17T19:59:48Z"
javascript
"2021-03-23T20:59:42Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,167
["packages/next/export/worker.ts", "test/integration/i18n-support/pages/gsp/fallback/[slug].js", "test/integration/i18n-support/test/shared.js"]
Default values for fallback dynamic routes differ between development and production
Provided reproduction: https://github.com/vvo/test-nextjs-routes-bug-locales When visiting `/some-path/github` in development the `query.login` value is undefined on initial render although when running `next build && next start` and visiting the same path the value will be `[login]` instead. We should ensure these default values match between production and development for consistency.
https://github.com/vercel/next.js/issues/23167
https://github.com/vercel/next.js/pull/23675
0d98cd9037bb51c749e22fe9cf3e97e66e004055
88fd76f4d2a212860fe4ad2f5b19cf545e791ddc
"2021-03-17T19:33:31Z"
javascript
"2021-04-04T14:09:20Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,157
["packages/next/next-server/server/image-optimizer.ts", "packages/next/next-server/server/lib/squoosh/impl.ts", "packages/next/next-server/server/lib/squoosh/main.ts"]
Handle image optimization operations in one worker thread
### Describe the feature you'd like to request Next.js currently spins up to 4 worker threads to handle 1 image optimization request, which are decode, rotate, resize, encode. This is pretty wasteful because it needs multiple passes of data serialization/deserialization in between. Since these steps will always run in a row and we don't need to result before all of them are finished, we can handle all these 4 steps in one worker. ### Describe the solution you'd like We can pass the operations with their arguments as an array to the worker, in which we run all those tasks and return the final result directly. ### Describe alternatives you've considered No alternatives.
https://github.com/vercel/next.js/issues/23157
https://github.com/vercel/next.js/pull/23188
70d306e0ac4fedfc9caecd5743b433b99a866903
241a916e03df4f032ec715ad518d01292652815c
"2021-03-17T16:15:47Z"
javascript
"2021-03-18T15:51:36Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,143
["packages/next/next-server/server/config-utils.ts", "test/integration/build-output/test/index.test.js", "test/integration/next-plugins/test/index.test.js"]
Enable webpack 5 by default when there is no custom webpack config
The webpack 5 support is ready to be enabled by default for apps that do not have custom webpack configuration. For users that do have custom webpack configuration we'll show a warning that they can upgrade to using webpack 5 but expect some breaking of their configuration. We're going to maintain backwards compat with webpack 4 for a while to give everyone the time to enable it.
https://github.com/vercel/next.js/issues/23143
https://github.com/vercel/next.js/pull/23810
d302a52bc6c242dba1956fd2466894ad8a9824c4
2dba861ea346b87d2ad8a100d25fe9f1cf6e73a7
"2021-03-17T10:18:21Z"
javascript
"2021-04-12T17:52:43Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,130
["packages/next/build/webpack-config.ts", "test/integration/externals/next.config.js", "test/integration/externals/node_modules/esm-package/correct.js", "test/integration/externals/node_modules/esm-package/package.json", "test/integration/externals/node_modules/esm-package/wrong.mjs", "test/integration/externals/pages/ssg.js", "test/integration/externals/pages/ssr.js", "test/integration/externals/pages/static.js", "test/integration/externals/test/index.test.js"]
Webpack 5 mode does not work yet with custom configurations
### What version of Next.js are you using? canary ### What version of Node.js are you using? 15 ### What browser are you using? Chrome ### What operating system are you using? macOS ### How are you deploying your application? none ### Describe the Bug Webpack's aliases configuration does not yet work with `future.webpack5 = true`. ### Expected Behavior Aliases and other configurations to properly work with webpack5. ### To Reproduce I made a simple test repo that showcases the issue: https://github.com/PepijnSenders/nextjs-aliases-issue. Just run `yarn && yarn next` and load localhost:3000 to view the error.
https://github.com/vercel/next.js/issues/23130
https://github.com/vercel/next.js/pull/24603
7c7e86454e41997c4ffe0853da995c9ee012cbad
33e09dffb2d477bf147046a04811c3453748f9b9
"2021-03-17T00:20:32Z"
javascript
"2021-05-07T16:32:33Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,128
["packages/next/build/index.ts", "packages/next/next-server/server/next-server.ts", "test/integration/500-page/test/index.test.js"]
Error occurred prerendering page "/500"
### What version of Next.js are you using? 10.0.9 ### What version of Node.js are you using? 12.16.3 ### What browser are you using? Chrome ### What operating system are you using? Linux Mint ### How are you deploying your application? next start ### Describe the Bug After upgrading to next 10.0.9 (I was using 10.0.5) during the build phase it is trying to create a 500 page I suppose. In my application it's not possible, I've a complex `_app.getInitialProps` so I tried to create a 500.js (https://github.com/vercel/next.js/pull/22887). It's still trying to create a 500 page, my static 500.js is ignored. ### Expected Behavior Use my static 500.js. ### To Reproduce I've some logic in my _getInitialProps. Everything works in next 10.0.5, but in 10.0.9 I can't compile anymore.
https://github.com/vercel/next.js/issues/23128
https://github.com/vercel/next.js/pull/23586
eddf5e0de9af1f07cf079da6cd6ed8c173351ca8
0402fc459eb12a775372172a351f3a3f4fee83e3
"2021-03-16T21:21:29Z"
javascript
"2021-06-11T09:29:40Z"
closed
vercel/next.js
https://github.com/vercel/next.js
23,125
["packages/next/bundles/yarn.lock", "packages/next/compiled/webpack/bundle5.js"]
PostCSS/webpack5: registering newly-created dependency causes initial dev build to hang
### What version of Next.js are you using? `10.0.9` / `10.0.10-canary.0` ### What version of Node.js are you using? 14.5.0 ### What browser are you using? Chrome ### What operating system are you using? macOS 11.0.1 ### How are you deploying your application? N/A ### Describe the Bug When using webpack5 (`future.webpack5` = `true`) the Next.js dev server hangs when a PostCSS plugin registers a dependency which has just been created. ```js // Create a new file fs.closeSync(fs.openSync(dependency, 'w')) // Register that file as a dependency result.messages.push({ type: 'dependency', plugin: PLUGIN_NAME, parent: result.opts.from, file: dependency, }) ``` This issue does not seem to exist prior to #22737 when webpack5 was upgraded to `v5.24.3`. Additionally, the dev server only hangs on the initial build (i.e. when the `.next` folder does not exist) ### Expected Behavior The dev server should not hang. ### To Reproduce 1. Clone https://github.com/bradlc/next-postcss-issue 2. Run `npm install` 3. Ensure that the `.next` folder does not exist 4. Run `npm run dev`
https://github.com/vercel/next.js/issues/23125
https://github.com/vercel/next.js/pull/23224
8e4123e9d90409b84acf9276586f341db3bff5a3
c9a2e5b8f0ce4ddeeff195cf978e7dd4a362f307
"2021-03-16T18:42:14Z"
javascript
"2021-03-22T09:21:51Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,994
["packages/next/build/index.ts", "packages/next/export/index.ts", "test/integration/500-page/test/index.test.js"]
[ =] info - Generating static pages (0/0) never completes
### What version of Next.js are you using? npm i [email protected] ### What version of Node.js are you using? 12.19.1 ### What browser are you using? Chrome Version 89.0.4389.82 ### What operating system are you using? CentOS 7 ### How are you deploying your application? next build ### Describe the Bug After running into problems similar in nature to #22815 and #22907 I upgraded to `10.0.9-canary.6`. This seemed to resolve the issue with it blowing when running `next build` however when it gets to the "Generating static pages" section there are 0 static pages and this seems to cause some sort of infinite loop. I walked away for 45 minutes while it sat there doing `[ =] info - Generating static pages (0/0)` but nothing changed. I had to abort back to 10.0.7 (before the issues in #22815 and #22907) ### Expected Behavior I'd expect it to be able to complete generating static pages (of which there are none) ### To Reproduce Not sure of the exact steps to reproduce other than what was mentioned in #22815 and #22907
https://github.com/vercel/next.js/issues/22994
https://github.com/vercel/next.js/pull/22996
2af5a0e47cb2246cc373736c05e8d76778f73c36
7e63bd7d54901103681e64982282990cb5a8c2d6
"2021-03-11T23:00:16Z"
javascript
"2021-03-12T08:36:28Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,929
["packages/next/next-server/server/lib/squoosh/png/squoosh_png.js", "packages/next/next-server/server/lib/squoosh/png/squoosh_png_bg.wasm", "test/integration/image-optimizer/public/grayscale.png", "test/integration/image-optimizer/test/index.test.js"]
10.0.8 next/image double images
### What version of Next.js are you using? 10.0.8 ### What version of Node.js are you using? 15.2.0 ### What browser are you using? Chrom, Safari, Firefox ### What operating system are you using? macOS ### How are you deploying your application? next start ### Describe the Bug Many of the images show up duplicated after being compressed from next/image and also have a greenish hue to them, this fixes itself if unoptimized is set to true, can also be reproduced in 10.0.9-canary.4 but not in 10.0.7. Possibly related to #22253 ### Expected Behavior Image just appearing once in the correct size and colours as they used to ### To Reproduce The code below is able to reproduce the issue ```jsx import Image from "next/image"; export default function Demo() { return ( <Image src={"https://i.imgur.com/WCcL3Ip.png"} alt={""} width={36} height={36}/> ) } ``` Image before conversion ![https://i.imgur.com/WCcL3Ip.png](https://i.imgur.com/WCcL3Ip.png) Image after conversion ![https://i.imgur.com/dHE5BPB.png](https://i.imgur.com/dHE5BPB.png)
https://github.com/vercel/next.js/issues/22929
https://github.com/vercel/next.js/pull/23393
65c22167c8b797ae8282c9c5301499301a54ff74
2ed54cddfa213b4353696214994025792e27c64a
"2021-03-10T05:44:44Z"
javascript
"2021-04-01T15:16:26Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,925
["packages/next/next-server/server/image-optimizer.ts", "packages/next/next-server/server/lib/squoosh/impl.ts", "packages/next/next-server/server/lib/squoosh/main.ts"]
10.0.8 next/image high memory use
### What version of Next.js are you using? 10.0.8 ### 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? next start ### Describe the Bug With v10.0.8 on pages with lots of next/image components seeing much higher memory use compared to 10.0.7. Possibly related to https://github.com/vercel/next.js/pull/22253 ### Expected Behavior less memory use ### To Reproduce checkout branch `nextjs-leak` https://github.com/scttcper/xmplaylist/tree/nextjs-leak run `yarn && yarn build && cd frontend && npx next start` open localhost:3000 and just refresh the root/home page a few times (the backend is not required for this page). Memory should shoot up to 400-500mb. In production this was consuming 2gb (all memory available) Production version is - https://xmplaylist.com/ you can see the home page has a good set of images.
https://github.com/vercel/next.js/issues/22925
https://github.com/vercel/next.js/pull/23188
70d306e0ac4fedfc9caecd5743b433b99a866903
241a916e03df4f032ec715ad518d01292652815c
"2021-03-10T00:49:31Z"
javascript
"2021-03-18T15:51:36Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,815
["packages/next/build/index.ts", "packages/next/build/utils.ts", "test/integration/500-page/test/index.test.js"]
Next 10.0.8 attempts to generate static error pages despite `_error` with `getInitialProps`
### What version of Next.js are you using? 10.0.8 ### What version of Node.js are you using? 12.13.0 ### What browser are you using? All ### What operating system are you using? macOS ### How are you deploying your application? Own infra ### Describe the Bug We have an `_error` component with `getInitialProps` (as does our `_app` component) and no `/404` or `/500` components, as we need dynamism on these routes for i18n, tracking, etc. Under 10.0.7, this correctly opted all error paths out of static optimization during build: ``` Warning: You have opted-out of Automatic Static Optimization due to `getInitialProps` in `pages/_app`. This does not opt-out pages with `getStaticProps` Read more: https://err.sh/next.js/opt-out-auto-static-optimization info - Collecting page data Page Size First Load JS ┌ λ / 306 B 429 kB ├ /_app 0 B 296 kB ├ λ /404 308 B 429 kB ├ λ /login 309 B 429 kB ├ λ /not-found 309 B 429 kB ...etc ``` Under 10.0.8, `next build` attempts to erroneously generate static pages, which fails because they rely on dynamism (specifically data collected from our custom server and transported into Next via the `req` object): ``` Warning: You have opted-out of Automatic Static Optimization due to `getInitialProps` in `pages/_app`. This does not opt-out pages with `getStaticProps` Read more: https://err.sh/next.js/opt-out-auto-static-optimization info - Collecting page data [ ==] info - Generating static pages (0/3) Error occurred prerendering page "/404". Read more: https://err.sh/next.js/prerender-error ... Error occurred prerendering page "/404.html". Read more: https://err.sh/next.js/prerender-error ... Error occurred prerendering page "/500". Read more: https://err.sh/next.js/prerender-error ... info - Generating static pages (3/3) > Build error occurred Error: Export encountered errors on following paths: /404 /404.html /500 ``` I'm guessing this was introduced alongside the new static `/500` component introduction? ### Expected Behavior `next build` won't attempt to generate static pages for 404/500 paths when `_error` has `getInitialProps` defined and no static `404` or `500` components are defined ### To Reproduce Attempt to build a next app with `_error` with `getInitialProps` defined and no `500` or `404` components
https://github.com/vercel/next.js/issues/22815
https://github.com/vercel/next.js/pull/22887
635a98e2fd8113ccb9c2b0086dff103d9c01e6e2
d951b2385f29ac8646b3e90f43a28185dfbc140f
"2021-03-06T03:36:29Z"
javascript
"2021-03-09T09:55:28Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,750
["packages/next/next-server/server/config-utils.ts", "packages/next/next-server/server/next-server.ts", "test/integration/required-server-files/pages/[slug].js", "test/integration/required-server-files/test/index.test.js"]
Router is mistaking index route for a dynamic route with fallback
### What version of Next.js are you using? 10.0.7 ### What version of Node.js are you using? 14.12.0 ### What browser are you using? Chrome, Safari, Firefox ### What operating system are you using? macOS ### How are you deploying your application? Vercel ### Describe the Bug The Next.js router is mistaking the index.js route as a dynamic route with a query of "index". I have 2 pages: - pages/index.js - pages/[page].js with fallback Occasionally when loading the index route, I am getting directed to the [page].js route which is returning as an error page. The router at this point is looking like this: ``` { "pathname": "/[page]", "route": "/[page]", "query": { "page": "index" }, "asPath": "/", "components": { "/[page]": { "initial": true, "props": { "pageProps": { "preview": false, "pageData": {} }, "__N_SSG": true }, "__N_SSG": true }, "/_app": { "styleSheets": [] } }, "isFallback": false, "basePath": "", "isReady": true, "isLocaleDomain": false, "events": {} } ``` ### Expected Behavior The index route should load consistently ### To Reproduce Create an `index.js` page and a dynamic route page with `fallback: true`. Load the index route in the browser and refresh until it does not display. My site can also be viewed for an example: [https://cappellazzo-website-cvrquuxk8-homestudio.vercel.app/](https://cappellazzo-website-cvrquuxk8-homestudio.vercel.app/)
https://github.com/vercel/next.js/issues/22750
https://github.com/vercel/next.js/pull/22783
1f5c2c851333b5601cc1e9463253fdad0f0d8883
3417164c1db8e968e255e35efb5685edb02b8a1c
"2021-03-04T00:06:45Z"
javascript
"2021-03-04T22:09:45Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,747
["packages/next/build/index.ts", "packages/next/client/page-loader.ts", "packages/next/export/index.ts", "packages/next/export/worker.ts", "test/integration/i18n-support-base-path/pages/mixed.js", "test/integration/i18n-support/pages/mixed.js", "test/integration/i18n-support/test/index.test.js", "test/integration/i18n-support/test/shared.js"]
asPath does not contain trailing slash when enabled during prerendering
We need to ensure the `asPath` value used during prerendering/auto-export contains a trailing slash when `trailingSlash: true` is configured to prevent a hydration mis-match.
https://github.com/vercel/next.js/issues/22747
https://github.com/vercel/next.js/pull/22746
c1b2b3f91fd8b858e76353a631c7890a95db6875
9afcdfcbc417f28b869d6ecf80312cbb0cf0945c
"2021-03-03T23:22:50Z"
javascript
"2021-03-14T12:58:34Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,733
["packages/next/client/link.tsx", "test/integration/client-navigation/pages/absolute-url.js", "test/integration/client-navigation/test/index.test.js"]
next/link: onMouseEnter etc. not called on inner <a> tag when href is external
### What version of Next.js are you using? 10.0.7 ### What version of Node.js are you using? 12.18.3 ### What browser are you using? Chrome ### What operating system are you using? Windows ### How are you deploying your application? next build - currently running locally ### Describe the Bug When using next/link's `<Link/>` to wrap an anchor tag with an onMouseEnter prop, this is only fired when the href is a local link such as "/" or "/messages", and not when the href is external like "https://google.com" or "mailto:[email protected]". ### Expected Behavior I expected onMouseEnter calls to fire regardless of the nature of the href link. This affects intended features like hover effects, etc. ### To Reproduce ``` <Link href="https://google.com"> <a onMouseEnter={() => console.log('External link - onMouseEnter')}>External</a> </Link> ``` ``` <Link href="/"> <a onMouseEnter={() => console.log('Local link - onMouseEnter')}>Local</a> </Link> ``` Have a hover around - you'll only see 'Local link - onMouseEnter' in the logs. Tie mouseEnter/mouseLeave etc. state to opacity and only the local link will change opacity.
https://github.com/vercel/next.js/issues/22733
https://github.com/vercel/next.js/pull/32012
332cd06c7d67aa5681c01437dca60ab49e46f5d1
f2251793782e272e5a74f97bd4f32c94fc705769
"2021-03-03T18:09:53Z"
javascript
"2021-12-01T18:32:27Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,732
["packages/next/build/index.ts", "packages/next/build/utils.ts", "packages/next/build/webpack/loaders/next-serverless-loader/index.ts", "packages/next/next-server/server/config.ts", "packages/next/next-server/server/load-components.ts", "test/integration/required-server-files/lib/config.js", "test/integration/required-server-files/next.config.js", "test/integration/required-server-files/pages/_app.js", "test/integration/required-server-files/pages/index.js", "test/integration/required-server-files/test/index.test.js"]
The component load order between targets should match
We should ensure the order of loading `_document`, `_app`, and the page's component should match between the serverless target and the default server target.
https://github.com/vercel/next.js/issues/22732
https://github.com/vercel/next.js/pull/22731
e04d399ab5d9665168e032ecd3c5d82fe7e15d6a
1435de15bc40e2943730bdcb731638f58e11b1dd
"2021-03-03T17:48:41Z"
javascript
"2021-03-03T19:20:48Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,579
["packages/next/build/webpack/loaders/next-serverless-loader/page-handler.ts", "packages/next/server/next-server.ts", "test/integration/404-page/test/index.test.js", "test/integration/not-found-revalidate/test/index.test.js"]
Cache headers on 404 pages with getStaticProps
**What version of Next.js are you using?** 10.0.6 **What version of Node.js are you using?** 14.15.1 **What browser are you using?** Chrome **What operating system are you using?** macOS **How are you deploying your application?** Other platform **Describe the Bug** The 404 error page responds with the cache headers `cache-control: s-maxage=31536000, stale-while-revalidate` when the getStaticProps function is exported. This could be a problem when the resource is temporary unavailable. **Expected Behavior** The cache headers for the 404 responses should be `cache-control: public, max-age=0, must-revalidate` like when the `getStaticProps` function is not exported. **To Reproduce** 1. `npx create-next-app` 2. Add a 404.js page with `getStaticProps` 3. `npm run build && npm start` 3. Request a non-existent route, like `http://localhost:3000/_next/static/give-me-a-404-response`
https://github.com/vercel/next.js/issues/22579
https://github.com/vercel/next.js/pull/24983
138b9ddf99dd2e6c3138839f8d896086a02ed01e
270487d7979d86105c73489be81cc0077493ebd3
"2021-02-26T17:42:44Z"
javascript
"2021-07-02T08:40:13Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,441
["packages/next/next-server/lib/router/router.ts", "test/integration/build-output/test/index.test.js", "test/integration/preload-viewport/next.config.js", "test/integration/preload-viewport/pages/[...rest].js", "test/integration/preload-viewport/pages/rewrite-prefetch.js", "test/integration/preload-viewport/test/index.test.js", "test/integration/size-limit/test/index.test.js"]
Rewrites are not correctly resolved while prefetching
While leveraging `href`'s automatic resolution, rewrites aren't correctly resolved while prefetching like they are during a client-transition. We should ensure rewrites are handled during prefetching the same as they are during a client-transition.
https://github.com/vercel/next.js/issues/22441
https://github.com/vercel/next.js/pull/22442
a78e904fc8f51a511999caff99dccb80c7eb9f39
9d2b0fc04aca9b13c7fac645d2553d25433fe924
"2021-02-23T03:23:12Z"
javascript
"2021-02-24T15:37:13Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,329
["packages/next/build/webpack/loaders/next-serverless-loader/utils.ts", "packages/next/next-server/server/next-server.ts", "test/integration/i18n-support/test/index.test.js"]
Invalid Accept-Language header will crash the server
**What version of Next.js are you using?** 10.0.7 **What version of Node.js are you using?** 15.6.0 **What browser are you using?** N/A **What operating system are you using?** Docker: node:15.6.0-alpine3.11 **How are you deploying your application?** next start **Describe the Bug** If the server receives a request with an invalid Acceot-Language header it crashes due to an un caught exception ``` (node:18) UnhandledPromiseRejectionWarning: Error: Invalid accept-language header at Object.internals.parse (/app/node_modules/@hapi/accept/lib/header.js:144:28) at Object.exports.selections (/app/node_modules/@hapi/accept/lib/header.js:21:22) at Object.exports.selection (/app/node_modules/@hapi/accept/lib/header.js:12:32) at Object.exports.<computed> [as language] (/app/node_modules/@hapi/accept/lib/index.js:29:53) at DevServer.handleRequest (/app/node_modules/next/dist/next-server/server/next-server.js:19:265) at Server.emit (events.js:315:20) at parserOnIncoming (_http_server.js:790:12) at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17) (node:18) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 503) ``` **Expected Behavior** It not to crash **To Reproduce** - Start your server - send a curl request at it with an invalid Accept-Language header \ ```bash curl https://my.next-project.com -H 'Accept-Language: ldfir;' ``` - the server crashes The error will also happen with the dev server `next dev` but the server doesnt actually crash in that case
https://github.com/vercel/next.js/issues/22329
https://github.com/vercel/next.js/pull/26476
fc67fc737c826b5317e1a6ec1c0416526372a317
fb5fb7f21f4f9152dbde24684b251e3a4a04f334
"2021-02-19T09:47:25Z"
javascript
"2021-06-22T15:05:54Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,270
["azure-pipelines.yml", "packages/next/build/webpack/loaders/next-style-loader/runtime/injectStylesIntoStyleTag.js", "test/integration/css-client-nav/test/index.test.js"]
Error in ie11 in the dev env after 10.0.5 -> 10.0.6 upgrade. Nextjs with custom server.
**What version of Next.js are you using?** 10.0.6 **What version of Node.js are you using?** 14.14.0 **What browser are you using?** ie11, chrome **What operating system are you using?** win7, win10, linux mint **How are you deploying your application?** `next({ dev }).prepare()` **Describe the Bug** After 10.0.5 -> 10.0.6 upgrade I get an error in the dev env: "Error was not caught SyntaxError: invalid character". With next 10.0.5 there is no error in ie11. **Expected Behavior** Work without errors. **To Reproduce** I use custom webpack config in next.config.js: ``` webpack: (config) => { config.entry = async () => { const entries = await originalEntry(); if ( entries["main.js"] && !entries["main.js"].includes("./polyfills.js") ) { entries["main.js"].unshift("./polyfills.js"); } return entries; }; config.module.rules.push({ test: /\.js$/, use: { loader: "babel-loader", options: { presets: [[ "@babel/preset-env", { corejs: 3, useBuiltIns: "entry", targets: { browsers: ["defaults"], }}, ]], exclude: [/node_modules/], }}, }); return config; } ``` polyfills.js: ``` import "@webcomponents/shadydom"; ``` babel.config.json: ``` { "presets": ["next/babel"], "plugins": [["styled-components", { "ssr": true }]] } ``` ![ie_err_1](https://user-images.githubusercontent.com/29361937/108213931-97967e00-7140-11eb-9d2f-302fa966b3db.png) ![ie_err_2](https://user-images.githubusercontent.com/29361937/108213944-9c5b3200-7140-11eb-91f6-352750a4eb7e.png)
https://github.com/vercel/next.js/issues/22270
https://github.com/vercel/next.js/pull/23784
35258650acb5bc17555e8e8c37845540f609ee9d
b2ee0a93fe5653a050550455d817f7e460205b4a
"2021-02-17T13:53:15Z"
javascript
"2021-04-15T16:34:52Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,130
["packages/next/client/router.ts", "test/integration/build-output/test/index.test.js", "test/integration/i18n-support-base-path/pages/index.js", "test/integration/i18n-support/pages/index.js", "test/integration/i18n-support/test/shared.js"]
Warning: Prop `href` did not match. Server: "https://dev-user.example.com/" Client: "/"
**What version of Next.js are you using?** 10.0.7-canary.8 **What version of Node.js are you using?** 12.16.3 **What browser are you using?** Google Chrome Version 88.0.4324.146 (Official Build) (x86_64) **What operating system are you using?** Mac OS Big Sur 11.1 **How are you deploying your application?** next start **Describe the Bug** With this `next.config.js` ``` module.exports = { i18n: { locales: ['en-US', 'it'], defaultLocale: 'it', domains: [ { domain: 'dev-user.example.com', defaultLocale: 'it', } ] } } ``` And this code: ```javascript <Link href="/"> <a>Just a link</a> </Link> ``` In `development` I'm watching these warings from React: ``` Warning: Prop `href` did not match. Server: "https://dev-user.example.com/" Client: "/" ``` Note that the domain is not `example` but I'm not on `localhost` **Expected Behavior** The expected behaviour is not having those warnigs. I think what React is trying to say is that the HTML generated by the server is different when is computed in the client. If I switch my `next.config.js` from [Next i18n Domain routing](https://nextjs.org/docs/advanced-features/i18n-routing#domain-routing) to [Next i18n Sub-path routing](https://nextjs.org/docs/advanced-features/i18n-routing#sub-path-routing) these warnings are gone. So my theory is that `next/link` is behaving differently in `Server` and `Client` somehow. **To Reproduce** Yes! I can reproduce. Here are the steps: 1. Clone this repo. [next@canary + nginx in a docker-compose](https://github.com/andresgutgon/next-href-warning) 2. run `docker-compose up` 3. Change for a moment your `/etc/hosts` My `/etc/hosts` has this line: ``` 127.0.0.1 dev-user.example.com ``` After that you should see this error: ![image](https://user-images.githubusercontent.com/49499/107816789-8f6fc480-6d75-11eb-947c-57b51666f082.png) I think followed all the steps : ) Let me know if something is not clear.
https://github.com/vercel/next.js/issues/22130
https://github.com/vercel/next.js/pull/26083
005a6e4c859024293bf23ef0303c9d492f1506bc
27d78a5d41708fa25f8081ea30983d5234baed04
"2021-02-12T20:20:49Z"
javascript
"2021-06-22T16:55:52Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,099
["packages/next/client/dev/on-demand-entries-utils.js", "test/integration/development-hmr-refresh/pages/with+Special&Chars=.js", "test/integration/development-hmr-refresh/test/index.test.js"]
using the + sign in a url makes it refresh constantly in development mode
**What version of Next.js are you using?** v10.0.7-canary.7 **What version of Node.js are you using?** v15.7.0 **What browser are you using?** Chrome **What operating system are you using?** Linux 5.4 **How are you deploying your application?** next dev (development issue) **Describe the Bug** when using + in a url (filename like `/pages/hello+world.js`) in development mode, the page will refresh every few seconds as if i was changing the file, even if im not. **Expected Behavior** either reject the invalid character + (they technically arent allowed in urls, but work fine), or not constantly refresh the page **To Reproduce** 1. project prep ``` yarn create next-app test cd test cp pages/index.js pages/hello+world.js yarn dev ``` 2. then open localhost:3000/hello+world 3. open developer tools, enable preserve log, and watch the page reload a ton
https://github.com/vercel/next.js/issues/22099
https://github.com/vercel/next.js/pull/28122
5d4d8802b8b6855fe1355bb106e6afd95af7e2a8
1b2e0799c37cd719ca8e5d20b614f921ce2b9143
"2021-02-12T04:20:07Z"
javascript
"2021-08-17T17:13:33Z"
closed
vercel/next.js
https://github.com/vercel/next.js
22,011
["packages/next/build/webpack/loaders/next-serverless-loader/utils.ts", "packages/next/client/link.tsx", "packages/next/client/router.ts", "packages/next/next-server/lib/router/router.ts", "packages/next/next-server/server/next-server.ts", "packages/next/next-server/server/render.tsx", "test/integration/i18n-support/test/shared.js"]
Client side navigation with domain locales doesn't work for localhost (and any other domain)
**What version of Next.js are you using?** `v10.0.5` to latest version (`v10.0.7-canary.6` as of today) **What version of Node.js are you using?** v12.18.3 (should be replicable in any) **What browser are you using?** Any **What operating system are you using?** Any **How are you deploying your application?** next start **Describe the Bug** When using the [i18n domain routing](https://nextjs.org/docs/advanced-features/i18n-routing#domain-routing), client-side navigation is broken when using a domain not included in the domains config, such as `localhost`. **The problem was probably introduced with this change included on `v10.0.5`**: https://github.com/vercel/next.js/pull/20562 **Expected Behavior** The domain routing config should only tell Next.js what's the current locale based on the current domain. If the domain doesn't match any of the domains in the config, it should fallback to the `defaultLocale` and client side navigation should use that domain for any `Link`. **To Reproduce** Here is a codesandox using the latest `v10.0.7-canary.6` next: https://codesandbox.io/s/next-i18n-domains-client-navigation-bug-bghx7 1. Note that the config next.config.js has two domains defined (`example.co.uk` for `en` and `example.es` for `es`). 2. Note that codesandbox will run the app under a codesandbox.io subdomain. If you were running the app locally you would be running it on `localhost:3000`, but the problem remains the same. 3. Click on the "Go to secondary page" link. 4. Observe how the browser is requesting `example.co.uk/secondary` and therefore client side navigation is broken under the codesandbox domain (or any other domain running the app). --- Here is the same codesanbox using next `v10.0.4`: https://codesandbox.io/s/next-i18n-domains-client-navigation-bug-next-v10-0-4-yhs5u Client side navigation works as expected.
https://github.com/vercel/next.js/issues/22011
https://github.com/vercel/next.js/pull/22032
5febe218a622022fb375ef5101f1848d9c3120cc
55e4a3d1add44aede18f4bc9f604f59ba49cc0b0
"2021-02-10T09:45:05Z"
javascript
"2021-02-11T10:18:24Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,979
["packages/next/src/cli/next-dev.ts", "packages/next/src/cli/next-start.ts", "packages/next/src/server/lib/start-server.ts", "test/integration/cli/test/index.test.js"]
IPv6 addresses not properly formatted when using `next dev`
**What version of Next.js are you using?** 10.0.6, 10.0.7-canary.6 **What version of Node.js are you using?** 15.8.0 **What browser are you using?** Firefox, this is a CLI issue **What operating system are you using?** Windows **How are you deploying your application?** next dev -H :: , next start -H :: **Describe the Bug** When running `next dev` or ` next start` with an IPv6 host parameter, the "started server" message does not format URIs correctly ``` > next dev -H :: ready - started server on :::3000, url: http://:::3000 ``` **Expected Behavior** ``` > next dev -H :: ready - started server on [::]:3000, url: http://[::1]:3000 ``` **To Reproduce** Run `next dev` or `next start` with an ipv6 address as the `-H` parameter
https://github.com/vercel/next.js/issues/21979
https://github.com/vercel/next.js/pull/43491
c7162c42b22b6b808f2a13fc623d59dc14296fad
9dedc94500cc059792abf5c71484b871140e6049
"2021-02-08T22:53:06Z"
javascript
"2023-01-10T10:06:25Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,943
["packages/next/build/webpack/loaders/next-serverless-loader/utils.ts", "test/integration/i18n-support-catchall/test/index.test.js"]
[i18n] non-default locale root level routes (i.e. /fr /es) get 307 redirects to themselves?
**What version of Next.js are you using?** 10.0.6 **What version of Node.js are you using?** 14.12.0 **What browser are you using?** Chrome **What operating system are you using?** macOS **How are you deploying your application?** Other platform **Describe the Bug** i18n + target: serverless [this line](https://github.com/vercel/next.js/blob/8f21c283b27357dbb2aebe94587901b6c7f4fe64/packages/next/next-server/server/next-server.ts#L505) is true _only_ for non-default locale **root** routes (aka `/pl` or `/fr` etc). when `shouldAddLocalePrefix` is true, it [passes this condition](https://github.com/vercel/next.js/blob/8f21c283b27357dbb2aebe94587901b6c7f4fe64/packages/next/next-server/server/next-server.ts#L513) (which therefore fails for non-root routes like `/pl/static`) and [sets up a 307](https://github.com/vercel/next.js/blob/8f21c283b27357dbb2aebe94587901b6c7f4fe64/packages/next/next-server/server/next-server.ts#L538) to `/pl`, which can cause infinite redirects. i'm looking to better understand why this logic exists for root non-default locale pages in i18n. specifically, this line: `const shouldAddLocalePrefix = !detectedDefaultLocale && denormalizedPagePath === '/'` what is the purpose of this condition? `denormalizedPagePath` becomes `/` when req.url is `/fr` or `/pl`. so like i said, it will eventually get to the res.setHeader and formatUrl using this value `${basePath || ''}/${detectedLocale}` which becomes `/fr` or `/pl`. the problem with this is if you're serving next page (`.next/serverless/pages/index.js`) for `/${locale}`, the 307 will hit `/${locale}` again, reprocess the next page, re-hit the 307, etc etc. i traced this work back to @ijjk so i assume they'll have the most insight :) **Expected Behavior** no 307s from `/${locale}` to `/${locale}` **To Reproduce** this is mainly just a question to understand so no need to repro. as answered previously though, yes, this is observed on a platform that is not vercel. my hope is that next maintainers are still diligent about helping those who don't or can't host on vercel! :pray: thanks so much for your time and help! really appreciate it <3
https://github.com/vercel/next.js/issues/21943
https://github.com/vercel/next.js/pull/22445
69fe678ea92e9036f956d2314a06d6d653f0125a
b1a1c80e7cfa3ad8c35ced40fc5c153ee4316935
"2021-02-07T17:06:25Z"
javascript
"2021-02-25T18:43:51Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,861
["packages/next/package.json", "yarn.lock"]
Sideloading OpenTelemetry in Node.js breaks Next.js
**What version of Next.js are you using?** 10.0.6 **What version of Node.js are you using?** 14.15.1 **What browser are you using?** Chrome, Firefox **What operating system are you using?** Windows **How are you deploying your application?** node --trace-deprecation -r ./telemetry.js node_modules/next/dist/bin/next dev **Describe the Bug** Running OpenTelemetry in another node module alongside next.js seems to break telemetry in next.js, as it currently relies on an outdated version of opentelemetry, causing import conflicts as the side-loaded module has already imported a newer version of opentelemetry that next.js doesn't support. Next.js fails with: ``` error - ./node_modules/next/dist/client/polyfills.js TypeError: _tracer.tracer.withSpan is not a function ``` **Expected Behavior** Next.js to run, even with version conflicts with telemetry disabled through `npx next telemetry disable` One solution would be to update opentelemetry to the newest version. The **better** solution would be exclude any references to opentelemetry when telemetry is disabled. **To Reproduce** In windows, to create a minimally failing project: `npx create-next-app nextjs-opentelemetry-issue --use-yarn` `cd nextjs-opentelemetry-issue` `npx next telemetry disable` `yarn add @opentelemetry/node @opentelemetry/plugin-https` `notepad telemetry.js` add and save: ``` "use strict"; const { NodeTracerProvider } = require("@opentelemetry/node"); const provider = new NodeTracerProvider(); provider.register(); ``` run the project with telemetry.js sideloaded: `node --trace-deprecation -r ./telemetry.js node_modules/next/dist/bin/next dev`
https://github.com/vercel/next.js/issues/21861
https://github.com/vercel/next.js/pull/25900
d820542a15abbf8a11accdac5ad08323ae994e18
535a83dbb8524a6513ce62827b7a4a9c77290ca5
"2021-02-04T10:42:05Z"
javascript
"2021-06-08T17:01:03Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,825
["examples/with-styletron/package.json", "examples/with-styletron/pages/_document.js"]
Layout broken after page reload (using with-styletron)
**What example does this report relate to?** with-styletron **What version of Next.js are you using?** "latest" **What version of Node.js are you using?** v12.13.0 **What browser are you using?** Chrome **What operating system are you using?** macOS **How are you deploying your application?** yarn dev **Describe the Bug** I've scaffolded a simple website with two layouts based on "with-styletron". Everything works fine on browser rendering, but the layout breaks after reloading [id].js page. Feels like there is some inconsistency between SSR and probably hydration. The same issue happened with a Header component in a different project, which also based on "with-styletron" example and has multiple layouts. **Expected Behavior** (see reproduce section for details) Expected that the layout stays persistent. **To Reproduce** 1. Clone https://github.com/Deliaz/nextjs-styletron-issue 2. go to the index page, input any number, and press enter 3. observe sidebar on the left side 4. reload the page 5. observe sidebar to be center-shfted (page used the wrong layout) ![ezgif com-gif-maker](https://user-images.githubusercontent.com/4865430/106805200-12569800-666f-11eb-97ed-e0f3a41d95c6.gif)
https://github.com/vercel/next.js/issues/21825
https://github.com/vercel/next.js/pull/21908
958bd6cabb85a52269927661f759ac9197775149
1773b991bc300ea1943e2c94434bc2f16857181a
"2021-02-03T20:29:16Z"
javascript
"2021-02-07T17:30:41Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,786
["docs/api-reference/next/image.md", "docs/basic-features/image-optimization.md"]
Improve documentation for custom loaders in image component
I've been working with several large apps that are trying to adopt the image component, and which would benefit from the custom loader pattern. So far none of them have found it while reading the documentation, which I think is because the part about custom loaders is only in the image optimization section, while the part about picking a loader in next.config is in the main "images" section. I'd recommend mentioning custom loaders and linking to the full documentation from the main image page.
https://github.com/vercel/next.js/issues/21786
https://github.com/vercel/next.js/pull/29186
8eec49208f16fd4471f7267f592193c1af9e7860
5d7b68f15ed54381ffad8569e2bd8e20ebdb8ac7
"2021-02-02T17:29:16Z"
javascript
"2021-10-05T21:38:48Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,708
["packages/next/package.json", "yarn.lock"]
[Deprecation] SharedArrayBuffer will require cross-origin isolation as of M91, around May 2021
**What version of Next.js are you using?** 10.0.5 **What version of Node.js are you using?** 14.15.0 **What browser are you using?** Google Chrome Version 90.0.4400.8 (Official Build) dev (64-bit) **What operating system are you using?** Windows 10 **How are you deploying your application?** `npm run dev` (`npx next dev`) **Describe the Bug** I get this warning in the console: ``` scheduler.development.js:298 [Deprecation] SharedArrayBuffer will require cross-origin isolation as of M91, around May 2021. See https://developer.chrome.com/blog/enabling-shared-array-buffer/ for more details. ``` ![console warning](https://i.imgur.com/PxWOKBw.png) **Expected Behavior** No warnings in the console **To Reproduce** Run `npm run dev` or `npx next dev` in the terminal in a Next.js project.
https://github.com/vercel/next.js/issues/21708
https://github.com/vercel/next.js/pull/27939
a28e775e881446c33a6ccd9969cda714037971a1
73b5d69e276645af0c33b1f9ac5de8f602773c61
"2021-01-31T13:06:05Z"
javascript
"2021-08-14T00:04:07Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,679
["packages/next/build/webpack-config.ts", "packages/next/bundles/webpack/packages/webpack.js", "packages/next/compiled/webpack/webpack.js", "packages/next/next-server/server/config-shared.ts", "packages/next/next-server/server/config-utils.ts", "packages/next/next-server/server/config.ts", "test-pnp.sh"]
Error: Cannot find module 'webpack'
**What version of Next.js are you using?** 10.0.6 **What version of Node.js are you using?** 14.15.4 **What browser are you using?** Safari **What operating system are you using?** macOS **How are you deploying your application?** yarn build locally **Describe the Bug** I just updated to 10.0.6 version from 10.0.5 and im getting the next error: Error: Cannot find module 'webpack'. I found out that if I remove next-pwa it works, and the terminal output while building all of the errors came form next-pwa. **Expected Behavior** If I downgrade to 10.0.5 my project builds in dev and prod. **To Reproduce** Install the latest version of next and install next-pwa. ` yarn install v1.22.10 info No lockfile found. [1/4] 🔍 Resolving packages... warning next-pwa > workbox-webpack-plugin > workbox-build > rollup > [email protected]: "Please update to latest v2.3 or v2.2" warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/[email protected]: Switch to 'npm install joi' warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/[email protected]: Moved to 'npm install @sideway/address' warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/[email protected]: Moved to 'npm install @sideway/formula' warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/topo > @hapi/[email protected]: This version has been deprecated and is no longer supported or maintained warning next-pwa > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/[email protected]: Moved to 'npm install @sideway/pinpoint' [2/4] 🚚 Fetching packages... [3/4] 🔗 Linking dependencies... warning " > [email protected]" has unmet peer dependency "webpack@>=4.0.0". warning "next-pwa > [email protected]" has unmet peer dependency "@babel/core@^7.0.0". warning "next-pwa > [email protected]" has unmet peer dependency "webpack@>=2". warning "next-pwa > [email protected]" has unmet peer dependency "webpack@^4.4.0 || ^5.9.0". warning "next-pwa > [email protected]" has unmet peer dependency "webpack@*". warning " > [email protected]" has incorrect peer dependency "tailwindcss@^1.9.0". [4/4] 🔨 Building fresh packages... success Saved lockfile. ✨ Done in 23.34s. jcgm@JoseloG-Macbook-Pro landing-site % yarn build yarn run v1.22.10 $ next build Loaded env from /Users/jcgm/Dev/Kapital/landing-site/.env.local > Build error occurred Error: Cannot find module 'webpack' Require stack: - /Users/jcgm/Dev/Kapital/landing-site/node_modules/workbox-webpack-plugin/build/generate-sw.js - /Users/jcgm/Dev/Kapital/landing-site/node_modules/workbox-webpack-plugin/build/index.js - /Users/jcgm/Dev/Kapital/landing-site/node_modules/next-pwa/index.js - /Users/jcgm/Dev/Kapital/landing-site/next.config.js - /Users/jcgm/Dev/Kapital/landing-site/node_modules/next/dist/next-server/server/config.js - /Users/jcgm/Dev/Kapital/landing-site/node_modules/next/dist/build/index.js - /Users/jcgm/Dev/Kapital/landing-site/node_modules/next/dist/cli/next-build.js - /Users/jcgm/Dev/Kapital/landing-site/node_modules/next/dist/bin/next at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at Object.<anonymous> (/Users/jcgm/Dev/Kapital/landing-site/node_modules/workbox-webpack-plugin/build/generate-sw.js:18:17) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at Object.<anonymous> (/Users/jcgm/Dev/Kapital/landing-site/node_modules/workbox-webpack-plugin/build/index.js:10:20) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) { code: 'MODULE_NOT_FOUND', requireStack: [ '/Users/jcgm/Dev/Kapital/landing-site/node_modules/workbox-webpack-plugin/build/generate-sw.js', '/Users/jcgm/Dev/Kapital/landing-site/node_modules/workbox-webpack-plugin/build/index.js', '/Users/jcgm/Dev/Kapital/landing-site/node_modules/next-pwa/index.js', '/Users/jcgm/Dev/Kapital/landing-site/next.config.js', '/Users/jcgm/Dev/Kapital/landing-site/node_modules/next/dist/next-server/server/config.js', '/Users/jcgm/Dev/Kapital/landing-site/node_modules/next/dist/build/index.js', '/Users/jcgm/Dev/Kapital/landing-site/node_modules/next/dist/cli/next-build.js', '/Users/jcgm/Dev/Kapital/landing-site/node_modules/next/dist/bin/next' ] } error Command failed with exit code 1. `
https://github.com/vercel/next.js/issues/21679
https://github.com/vercel/next.js/pull/22583
1ebc9bbb5e220aa6adbe8f2067534ad978ac0620
04f37d0978e5fc9939012c1d771ef4e6535e7787
"2021-01-30T04:08:56Z"
javascript
"2021-02-27T06:19:35Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,568
["packages/next/build/index.ts", "packages/next/next-server/server/incremental-cache.ts", "test/integration/i18n-support/test/shared.js", "test/integration/prerender/test/index.test.js"]
The prerender-manifest should have separate entries for non-dynamic SSG pages with i18n
Currently the prerender-manifest contains one entry for non-dynamic SSG pages that is not prefixed with the configured locales. This prevents different revalidate values that are locale specific from being provided. This also causes returning `notFound: true` for the default locale on a non-dynamic SSG page to cause values to be missing for the other paths.
https://github.com/vercel/next.js/issues/21568
https://github.com/vercel/next.js/pull/21404
b785fbc5d1ced1e2cdc5905142af10713e2eb5da
87ed37d51c6857d660e498c6e7cb0d6353878d7e
"2021-01-27T01:52:49Z"
javascript
"2021-01-27T11:24:00Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,549
["packages/next/client/image.tsx"]
Hostname is not configured under images in your `next.config.js` when running tests with Jest
**What version of Next.js are you using?** 10.0.2 **What version of Node.js are you using?** 14.2.0 **What browser are you using?** Chrome **What operating system are you using?** Ubuntu **How are you deploying your application?** next start **Describe the Bug** When using Jest to test a component that uses `Image` from `next/image` you will get an error that your src prop hostname is not configured under images in your `next.config.js` even if you have mocked the config to include the domain. **Expected Behavior** Jest mocking should work. **To Reproduce** Testing this component: ```typescript import React from "react"; import Image from "next/image"; export const Github: React.FC = () => { return ( <div> <Image width={800} height={600} sizes="600px" layout="responsive" objectFit="cover" src={`${process.env.NEXT_PUBLIC_CDN_URL}/hello.jpg`} /> Hello World </div> ); }; ``` with this test: ```typescript import React from "react"; import { screen, render, waitFor } from "@testing-library/react"; import { Github } from "../../../../components/github"; jest.mock("next/config", () => { return () => ({ publicRuntimeConfig: { images: { domains: ["cdn.example.com"], }, }, }); }); describe("github issue reproduction", () => { jest.useFakeTimers("modern"); jest.setSystemTime(new Date(2021, 1, 20, 12, 0, 0, 0)); it("github issue", async () => { render(<Github />); await waitFor(() => expect(screen.getByText("Hello World")).toBeInTheDocument() ); }); }); ``` with this `jest.config.js`: ```javascript module.exports = { moduleNameMapper: { "\\.(css|less)$": "identity-obj-proxy", }, setupFiles: ["<rootDir>/__tests__/setupEnvironment.js"], }; ``` with this `setupEnvironment.js`: ```javascript process.env.NEXT_PUBLIC_CDN_URL = "https://cdn.example.com"; ``` will get you this error: ``` Invalid src prop (https://cdn.example.com/hello.jpg) on `next/image`, hostname "cdn.example.com" is not configured under images in your `next.config.js` See more info: https://err.sh/next.js/next-image-unconfigured-host 20 | render(<Github />); 21 | > 22 | await waitFor(() => | ^ 23 | expect(screen.getByText("Hello World")).toBeInTheDocument() 24 | ); 25 | }); ```
https://github.com/vercel/next.js/issues/21549
https://github.com/vercel/next.js/pull/26502
e969d226999bb0fcb52ecc203b359f3715ff69bf
325b3a9651546f8b14b382b1dd93d6d6df0fd068
"2021-01-26T16:05:25Z"
javascript
"2021-06-22T23:02:01Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,543
["packages/next/client/route-loader.ts"]
Error: Route did not complete loading: /projects
**What version of Next.js are you using?** 10.0.5 **What version of Node.js are you using?** 14.15.0 **What browser are you using?** Chrome **What operating system are you using?** Windows 10 **How are you deploying your application?** Vercel **Describe the Bug** I am trying to build a simple route for my portfolio. The route is '/projects'. I've added a projects.js file in the pages directory with the logical code and when I use next/link for client side transition, I get an error: Route did not complete loading: "projects". When I use regular anchor tag for routing, there is no issue. **Expected Behavior** It should change the route to the destined page without any error. **To Reproduce** ``` import styles from '../styles/Home.module.css' import Link from 'next/link' export default function Footer() { return ( <> <div className={styles.link}> <a href="https://github.com/devdaksh" target="__blank">github</a> <a href="https://twitter.com/dawksh" target="__blank">twitter</a> <a href="https://devdaksh.hashnode.dev" target="__blank">blogs</a> <a href="mailto:[email protected]">email</a> <Link href="/projects" > <a>projects</a> </Link> </div> </> ) } ``` ![Screenshot (130)](https://user-images.githubusercontent.com/20741933/105847787-1433b200-6004-11eb-9331-62681d1a4865.png) This is a screenshot of the error
https://github.com/vercel/next.js/issues/21543
https://github.com/vercel/next.js/pull/22775
33255b7f4ed6dd2608d6a6590d137353b6f19f67
afc8ce4d0dd324135ea3f5b4d65ecd95fb455299
"2021-01-26T12:57:16Z"
javascript
"2021-03-05T16:32:00Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,507
["docs/api-reference/next.config.js/headers.md", "docs/api-reference/next.config.js/redirects.md", "docs/api-reference/next.config.js/rewrites.md"]
Customer headers are removed with internationalisation
**What version of Next.js are you using?** 10.0.3 **What version of Node.js are you using?** 15.3.0 **What browser are you using?** Chrome **What operating system are you using?** macOS (intel) **How are you deploying your application?** Vercel **Describe the Bug** Within the next.config.js, if you have customer headers and deploy to Vercel, these headers are added to the response. When you then add internationalisation some of these custom headers are removed. Observed headers being removed: - X-Frame-Options - X-XSS-Protection - X-Robots-Tag **Expected Behavior** Custom headers should be populated in the response when using internationalisation. **To Reproduce** 1. Create a project with customer headers: - X-Frame-Options - X-XSS-Protection - X-Robots-Tag 2. Deploy to Vercel and observe the custom headers within the response 3. Add internationalisation to your project 4. Deploy to Vercel 5. Observe the above noted custom headers have been removed
https://github.com/vercel/next.js/issues/21507
https://github.com/vercel/next.js/pull/22500
b90b4b503c4444507595be0f9e0edd8a19ea2254
d9bb645c03b6a41231ecaa201ea97cd61cef1fdc
"2021-01-25T09:50:34Z"
javascript
"2021-02-24T19:04:30Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,453
["packages/next/server/incremental-cache.ts", "packages/next/server/render.tsx", "test/integration/not-found-revalidate/data.txt", "test/integration/not-found-revalidate/pages/404.js", "test/integration/not-found-revalidate/pages/initial-not-found/[slug].js", "test/integration/not-found-revalidate/pages/initial-not-found/index.js", "test/integration/not-found-revalidate/test/index.test.js"]
GetStaticProps returning initial notFound never triggers a rebuild on revalidate with dynamic routes
**What version of Next.js are you using?** 10.0.5 **What version of Node.js are you using?** 12.13.0 **What browser are you using?** Chrome **What operating system are you using?** Windows **How are you deploying your application?** next start **Describe the Bug** If `getStaticProps` returns `notFound: true` in the initial build with a revalidate value, Nextjs never tries to rebuild the page **Expected Behavior** Nextjs should try rebuilding the page instead of assuming permanent 404 **To Reproduce** ```javascript export const getStaticProps = async (props) => { try { const dictionaries = await apiFetch(); return { props: { dictionaries, }, revalidate: 60, }; } catch (error) { // assume the api fetch fails with the initial build return { notFound: true, props: { dictionaries: {}, }, revalidate: 60, }; } // On subsequent re-builds after revalidate has passed and the api returns a ok response, Nextjs never tries to rebuild the page and always returns the 404 page instead
https://github.com/vercel/next.js/issues/21453
https://github.com/vercel/next.js/pull/28097
8a80b0b3570fe734889acff315e24e610106656b
169785253e7fcd23df32219ea5ba29ff28b711a0
"2021-01-22T19:08:21Z"
javascript
"2021-08-14T13:11:40Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,448
[".github/workflows/build_test_deploy.yml", "packages/next/build/webpack-config.ts", "packages/next/next-server/server/config.ts"]
Fix webpack 5 CI tests
https://github.com/vercel/next.js/issues/21448
https://github.com/vercel/next.js/pull/21436
f2de5a08b87c22067b9876204d0b2f8ec18b2ba6
74b6389bd60505d3a2a8d902241e344b65356f1a
"2021-01-22T16:17:56Z"
javascript
"2021-01-22T17:20:53Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,433
["docs/api-reference/next/image.md", "docs/basic-features/image-optimization.md", "packages/next/client/image.tsx", "test/integration/image-component/default/pages/inside-paragraph.js", "test/integration/image-component/default/test/index.test.js"]
next/image: "<div> cannot appear as a descendant of <p>" React warning
**What version of Next.js are you using?** 10.0.5 **What version of Node.js are you using?** v14.15.4 **What browser are you using?** Chrome **What operating system are you using?** macOS **How are you deploying your application?** Other **Describe the Bug** If you use a `next/image` component inside a `<p>` element, you'll get this warning from React: `<div> cannot appear as a descendant of <p>` **Expected Behavior** Should not produce a warning. **To Reproduce** Use a `next/image` component inside a `<p>`. For example: ```html <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras consequat, tortor non aliquet auctor, nibh ex faucibus ligula, eget gravida velit augue et enim. Donec sed lectus porttitor, posuere ex sit amet, auctor ligula. Duis hendrerit massa non leo ultricies, eu tincidunt ex pulvinar.</p> <p><Image width='720' height='413' src='/images/example.jpg' alt='Example' /></p> ``` It's pretty common to use an image in a `<p>`. I imagine if `next/image` used spans instead of divs, it would resolve this issue.
https://github.com/vercel/next.js/issues/21433
https://github.com/vercel/next.js/pull/30041
0daaae32dc01494c408afc54eb19c01d2d8bfdf2
1a0c1e8a5b47e49602e058a0d3e254fa885a61c4
"2021-01-21T23:50:48Z"
javascript
"2021-10-18T21:29:19Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,390
["packages/next/bundles/webpack/packages/webpack.d.ts", "packages/next/compiled/webpack/webpack.d.ts", "packages/next/types/index.d.ts"]
Type error: Could not find a declaration file for module 'next/dist/compiled/webpack/webpack'
**What version of Next.js are you using?** 10.0.6-canary.6 **What version of Node.js are you using?** 14.15.4 **What browser are you using?** N/A **What operating system are you using?** Linux **How are you deploying your application?** Vercel **Describe the Bug** When upgrading from v10.0.6-canary.0 to v10.0.6-canary.6, this error is raised: ``` ./node_modules/.pnpm/[email protected]_c39e9db791ea05e3ec4e0e74abb7a6b5/node_modules/next/dist/build/webpack/plugins/build-manifest-plugin.d.ts:1:25 Type error: Could not find a declaration file for module 'next/dist/compiled/webpack/webpack'. '/home/runner/work/elliott.dev/elliott.dev/node_modules/.pnpm/[email protected]_c39e9db791ea05e3ec4e0e74abb7a6b5/node_modules/next/dist/compiled/webpack/webpack.js' implicitly has an 'any' type. Try `npm i --save-dev @types/next` if it exists or add a new declaration (.d.ts) file containing `declare module 'next/dist/compiled/webpack/webpack';` > 1 | import { webpack } from 'next/dist/compiled/webpack/webpack'; | ^ 2 | import { Rewrite } from '../../../lib/load-custom-routes'; 3 | export declare type ClientBuildManifest = Record<string, string[]>; 4 | export default class BuildManifestPlugin { ``` See https://github.com/elliottsj/elliott.dev/pull/442/checks?check_run_id=1733030038 I am using pnpm, as well as tsconfig options `"strict": true` and `"skipLibCheck": false`. **Expected Behavior** No error should occur. **To Reproduce** See: * https://github.com/elliottsj/elliott.dev * https://github.com/elliottsj/elliott.dev/pull/442/checks?check_run_id=1733030038
https://github.com/vercel/next.js/issues/21390
https://github.com/vercel/next.js/pull/21785
e750f4378c25872b704197ee9161bee7eebb415c
a6c1f9cfe777be516016523a764aa5ba50bb274c
"2021-01-20T17:17:25Z"
javascript
"2021-02-03T16:39:59Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,386
["packages/next/next-server/lib/router/router.ts", "test/integration/client-navigation/pages/nav/shallow-routing.js", "test/integration/client-navigation/test/index.test.js"]
Shallow routing replacements should not scroll
**What version of Next.js are you using?** 10.0.5 **What version of Node.js are you using?** N/A **What browser are you using?** N/A **What operating system are you using?** N/A **How are you deploying your application?** N/A **Describe the Bug** When a user does a shallow replacement of state, Next.js will scroll to the top of the page. **Expected Behavior** When a shallow replacement of state is done, this is a strong heuristic that the page isn't intended to be scrolled, and instead, the application is storing some state within the route. **To Reproduce** N/A
https://github.com/vercel/next.js/issues/21386
https://github.com/vercel/next.js/pull/21437
74b6389bd60505d3a2a8d902241e344b65356f1a
a5b0094677b8f10e3104cb55c6a21da308ec6534
"2021-01-20T16:11:21Z"
javascript
"2021-01-22T18:03:29Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,366
["packages/next/next-server/lib/router/router.ts", "test/integration/client-navigation/pages/nav/shallow-routing.js", "test/integration/client-navigation/test/index.test.js"]
Updating query string with shallow routing scrolls to top since v10.0.0
**What version of Next.js are you using?** 10.0.5 **What version of Node.js are you using?** 12.18.3 **What browser are you using?** Chrome **What operating system are you using?** macOS **How are you deploying your application?** Vercel **Describe the Bug** Using the `{ shallow: true }` option with router.push previously prevented the browser from scrolling to the top of the page. I've tested versions 10.0.0, 10.0.1, 10.0.5 & the latest 10.0.6-canary.5 all of which have the bug. When using 9.5.5 and 9.5.6-canary.18 no scrolling happens which is the expected result. **Expected Behavior** No scrolling to top. **To Reproduce** Update a query string using router.push with the shallow option set to true. I'm using the example below for a "See More Results" button. Using `router.push('some-url?page=2', undefined, { shallow: true })` EDIT: Formatting
https://github.com/vercel/next.js/issues/21366
https://github.com/vercel/next.js/pull/21437
74b6389bd60505d3a2a8d902241e344b65356f1a
a5b0094677b8f10e3104cb55c6a21da308ec6534
"2021-01-20T00:47:06Z"
javascript
"2021-01-22T18:03:29Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,337
["packages/next/client/image.tsx", "test/integration/image-optimizer/test/index.test.js"]
trailingSlash: true redirects /_next/image? to /_next/image/? for each image request
**What version of Next.js are you using?** 10.0.2 **What version of Node.js are you using?** 12.4.1 **What browser are you using?** Chrome **What operating system are you using?** Windows **How are you deploying your application?** Other platform **Describe the Bug** When trailingSlash is set to 'true' the /_next/image directory used for serving optimized images is also affected. Instead of requesting the resource on: /_next/image?url=/uploads/... the user is redirected with 308 to /_next/image/?url=/uploads/... This creates a huge amount of unnecessary redirects for a page full of images. I couldn't find any additional config options for the trailingSlash option whatsoever. **Expected Behavior** The optimized images path to not be redirected to a path with a trailing slash. **To Reproduce** 1. Create a NextJS application. 2. Add a couple of next/image images. 3. Set trailingSlash to true. 4. Check the network tab and verify that the requests for the images have been redirected with status code 308. 5. Disable trailingSlash and verify that there are no redirects.
https://github.com/vercel/next.js/issues/21337
https://github.com/vercel/next.js/pull/22453
a6665915552caa5bd4baf3ce0a34a64e0539fc3f
0e5e8881c08d2f13f2604327f3940776cc5c6a42
"2021-01-19T14:54:33Z"
javascript
"2022-03-07T17:55:39Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,324
["packages/create-next-app/templates/default/styles/Home.module.css"]
Create Next App template does not look correct in IE11
**What version of Next.js are you using?** 10.0.5 **What version of Node.js are you using?** 14.14.0 **What browser are you using?** IE11 **What operating system are you using?** Windows 10 **How are you deploying your application?** next start **Describe the Bug** The start page of next.js does not render properly. See image below. **Expected Behavior** It should render the same as in other browsers, since next.js claims it ["supports IE11 and all modern browsers (Edge, Firefox, Chrome, Safari, Opera, et al) with no required configuration."](https://nextjs.org/docs/basic-features/supported-browsers-features). **To Reproduce** Follow [these instructions](https://dev.to/filippofonseca/how-to-set-up-a-next-js-project-with-typescript-and-react-576h) to set up a next.js application with TypeScript. Then, since [the development mode of next.js does not work in IE11 anyway](https://github.com/vercel/next.js/issues/13231), first run `npm run build` to build the production version and then serve it with `npm run start`. ![The broken next.js start page.](https://user-images.githubusercontent.com/11889637/105027639-4c5d5280-5a50-11eb-9fa7-db12961811b1.png)
https://github.com/vercel/next.js/issues/21324
https://github.com/vercel/next.js/pull/24245
8ccfff10ae133c955ca65b633ce6fb3483b9d2fe
5e255b5fa2874d9d65eda0be0e79e22312327e9c
"2021-01-19T11:17:46Z"
javascript
"2021-04-20T19:18:41Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,297
["packages/next/build/webpack-config.ts", "packages/next/build/webpack/plugins/font-stylesheet-gathering-plugin.ts", "packages/next/build/webpack/plugins/mini-css-extract-plugin/src/index.js", "packages/next/build/webpack/plugins/pages-manifest-plugin.ts", "packages/next/next-server/server/config-utils.ts"]
webpack 5 dynamic require syntax causes un-necessary files to be traced/included for lambdas
**What version of Next.js are you using?** 10.0.5 (canary as well) **What version of Node.js are you using?** v12.20.0 **What browser are you using?** all **What operating system are you using?** macOS, Linux, Windows **How are you deploying your application?** Vercel **Describe the Bug** When dynamic imports are used dynamic chunks are created for the server build and dynamic required. In webpack 4 the syntax used to require these dynamic chunks was able to be statically evaluated: ```js /******/ if(installedChunks[chunkId] !== 0) { /******/ var chunk = require("../" + ({}[chunkId]||chunkId) + "." + {"0":"432e819ee916cf1fe474","1":"c1993a54b4b250bfacf9","2":"cfea81a5890bf53bdfc6","3":"944259e4b104c150480c"}[chunkId] + ".js"); ``` In webpack 5 the syntax used is no longer able to statically evaluated which requires dependency tracing solutions to guess which files are needed in the relative directory used usually causing entire directories that aren't needed to be marked as needed e.g. the entire `.next/serverless/pages` directory is being included from the below require. ```js // "1" is the signal for "already loaded" /******/ if(!installedChunks[chunkId]) { /******/ if(true) { // all chunks have JS /******/ installChunk(require("../../" + __webpack_require__.u(chunkId))); /******/ } else installedChunks[chunkId] = 1; /******/ } ``` **Expected Behavior** To be able to trace and include only the needed files in webpack 5 the same way we were able to in webpack 4 **To Reproduce** Use webpack 5 with a dependency tracing solution like `node-file-trace` to detect needed files
https://github.com/vercel/next.js/issues/21297
https://github.com/vercel/next.js/pull/22697
ac47795d372349fd3fc0f5280a8637e114c34e40
b80fdfb8287980c8f9ae3c9c591ab796ad00baf1
"2021-01-18T19:13:58Z"
javascript
"2021-03-03T09:37:24Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,267
["packages/next/build/webpack-config.ts", "packages/next/next-server/lib/router/router.ts", "packages/next/next-server/lib/router/utils/resolve-rewrites-noop.ts", "packages/next/next-server/lib/router/utils/resolve-rewrites.ts", "test/integration/custom-routes-i18n/test/index.test.js", "test/integration/production/test/index.test.js"]
asPath in getInitialProps ignores query params in dev mode
**What version of Next.js are you using?** 10.0.5 **What version of Node.js are you using?** 12.18.3 **What browser are you using?** Chrome **What operating system are you using?** macOS **How are you deploying your application?** npm run dev **Describe the Bug** When using dev mode, the value of `asPath` in `getInitialProps` is correct only when rendered by the server. When rendered by the browser, only the path is included, and the query portion is ignored. In prod (npm start), everything works as expected. This leads me to believe that there is some kind of race condition that surfaces only when the app is slowed down due to being in dev mode. **Expected Behavior** The value of `asPath` should consistently include the query portion both on the server and in the browser, even in dev mode. **To Reproduce** */pages/test1.js:* ``` import { useRouter } from "next/router"; const Test1 = ({ asPath }) => { const router = useRouter(); return ( <div onClick={() => router.push("/test2", "/test2?foo=bar")}> go to /test2?foo=bar <br /> <br /> asPath = {asPath} </div> ); }; Test1.getInitialProps = ({ asPath }) => { return { asPath }; }; export default Test1; ``` */pages/test2.js:* ``` import Link from "next/link"; const Test2 = ({ asPath }) => { return ( <Link href="/test1" as="/test1?foo=bar"> <div> go to /test1?foo=bar <br /> <br /> asPath = {asPath} </div> </Link> ); }; Test2.getInitialProps = ({ asPath }) => { return { asPath }; }; export default Test2; ``` Upon initial SSR render, navigating to `/test1?foo=bar` will correctly display the entire `asPath`. But after clicking "go to /test2?foo=bar," only `/test2` is displayed, even though the actual path includes a query string. Note that this happens both when using the `Link` component, as well as with `router.push`.
https://github.com/vercel/next.js/issues/21267
https://github.com/vercel/next.js/pull/21410
9fd9d83221c064eddb14cc3d34bb3f1200ead9a6
5b70802f619a7d5aa111a06850a51078a6ec5a60
"2021-01-18T05:13:02Z"
javascript
"2021-01-21T23:40:23Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,214
["packages/next/client/image.tsx", "test/integration/image-component/default/test/index.test.js", "test/unit/image-rendering.unit.test.js"]
Support noscript in the image component with lazy loading support
**Describe the feature you'd like to request** Currently the image component relies on javascript even when rendered on the server because of the IntersectionObserver-based lazy loading behavior. This was chosen over the native loading="lazy" to ensure maximum browser support. However, this means that the experience with lazy-loaded images on a browser with JavaScript disabled is very bad--they just don't show up. **Describe the solution you'd like** The image component should render a noscript case which falls back to the loading="lazy" case when javascript is disabled. **Describe alternatives you've considered** There is currently a PR open #19052 which implements noscript support for the image element. Let's either merge this and then add support for loading="lazy" in the noscript case, or else modify the PR with that support and then merge.
https://github.com/vercel/next.js/issues/21214
https://github.com/vercel/next.js/pull/19052
9cc6ba93aba7319afd562312ecb463afeeb1a2af
48dd9954d8b8cf257e5f1f47709c5dfe8c428345
"2021-01-15T22:19:31Z"
javascript
"2021-03-23T19:25:00Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,211
["packages/next/build/webpack/loaders/next-serverless-loader/utils.ts", "packages/next/client/link.tsx", "packages/next/client/router.ts", "packages/next/next-server/lib/router/router.ts", "packages/next/next-server/server/next-server.ts", "packages/next/next-server/server/render.tsx", "test/integration/i18n-support/test/shared.js"]
i18n links are unusable in dev builds when using multiple domains
**What version of Next.js are you using?** 10.0.5 **What version of Node.js are you using?** 15.6.0 **What browser are you using?** n/a **What operating system are you using?** n/a **How are you deploying your application?** next dev **Describe the Bug** Links created with `next/link` use the i18n domains from `next.config.js` when running in development mode. That makes them unusable, since the dev server runs on `localhost:3000` and the generated links point to production. **Expected Behavior** `next/link` should ignore the i18n domains when running in development mode **To Reproduce** Run `npx create-next-app`, then enable i18n in `next.config.js`: ```js module.exports = { i18n: { locales: ['en', 'pl'], defaultLocale: 'en', domains: [ { domain: 'google.com', defaultLocale: 'en' }, { domain: 'google.pl', defaultLocale: 'pl' } ] } } ``` Add the following links somewhere in `pages/index.js`: ```js <Link href='/'><a>auto</a></Link> <Link href='/' locale='en'><a>en</a></Link> <Link href='/' locale='pl'><a>pl</a></Link> ``` Run `npm dev` and try clicking on these links. They will take you to google so the dev build isn't very useful.
https://github.com/vercel/next.js/issues/21211
https://github.com/vercel/next.js/pull/22032
5febe218a622022fb375ef5101f1848d9c3120cc
55e4a3d1add44aede18f4bc9f604f59ba49cc0b0
"2021-01-15T21:02:29Z"
javascript
"2021-02-11T10:18:24Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,162
["examples/with-typescript-eslint-jest/.eslintrc.json"]
Eslint warning in the starting repository generated by the with-typescript-eslint-jest example
**What version of Next.js are you using?** 10.0.5 **What version of Node.js are you using?** 14.15.1 **What browser are you using?** Chrome **What operating system are you using?** macOS **How are you deploying your application?** next start **Describe the Bug** When I use the example, with-typescript-eslint-jest example, I always met following warning in the default file tree: ``` % yarn lint yarn run v1.22.10 $ eslint . --ext ts --ext tsx --ext js Warning: React version not specified in eslint-plugin-react settings. See https://github.com/yannickcr/eslint-plugin-react#configuration . ✨ Done in 2.26s. ``` I want to suppress this message. **Expected Behavior** The lint message should be the following: ``` % yarn lint yarn run v1.22.10 $ eslint . --ext ts --ext tsx --ext js ✨ Done in 2.17s. ``` **To Reproduce** Execute following commands ``` npx create-next-app --example with-typescript-eslint-jest test cd test yarn lint ``` Thank you for reading!
https://github.com/vercel/next.js/issues/21162
https://github.com/vercel/next.js/pull/21163
7aa397f32ed9a22c83d477b2dc441ce9e5f96afd
07d4af9307bb2bad244070fa9ee6f0b1f0b53caf
"2021-01-15T09:58:09Z"
javascript
"2021-01-26T15:22:43Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,079
["docs/basic-features/image-optimization.md", "errors/manifest.json", "errors/next-image-missing-loader-width.md", "errors/next-image-missing-loader.md", "packages/next/client/image.tsx", "packages/next/server/image-config.ts", "test/integration/export-image-loader/pages/index.js", "test/integration/export-image-loader/test/index.test.js", "test/integration/image-optimizer/test/index.test.js"]
Custom loaders are not recognized by next export
**What version of Next.js are you using?** 10.0.5 **What version of Node.js are you using?** v15.5.0 **What browser are you using?** Chrome **What operating system are you using?** macOS **How are you deploying your application?** next export **Describe the Bug** I'm using next/image with a custom loader. The reason for the custom loader is that I've optimised all images on build-time. When I run `next export` I will get this message: > Error: Image Optimization using Next.js' default loader is not compatible with `next export`. > Possible solutions: > - Use `next start`, which starts the Image Optimization API. > - Use Vercel to deploy, which supports Image Optimization. > - Configure a third-party loader in `next.config.js`. **Expected Behavior** Next.js understands that I'm using a custom loader, and that a static export would work fine. Maybe an option is to pass the custom loader as a function to next.config.js? ```js module.exports = { images: { loader: (width, src, quality) => `/preprocessed-images/${filename}-${width}.jpg` }, } ``` I would also be fine with an API like this: ```js module.exports = { images: { loader: 'static' }, } ``` **To Reproduce** - Use next/image with a custom loader (see body for examples) - Run next export This is all possibly related to https://github.com/vercel/next.js/issues/19612, although I didn't get the impression that the issue was recognized as such. **Custom loader** I've got a custom loader defined: For the example I'm just a default return statement, but normally I'm using some props and helpers here ```ts const myLoader = ({src}) => { return `/preprocessed-images/${src}`; }; ``` **Image component** ```jsx <Image loader={myLoader} src={`e72657a9019403244cd61aebf1a5752ce1d03b51.jpg`} width="640" height={480} /> ``` **Preprocessed images** My folder of preprocessed images looks like this: ![image](https://user-images.githubusercontent.com/882219/104502198-9bcef900-55e0-11eb-8bd5-799d2b041886.png) In my mind, this should work, but I can't tell Next.js that I don't need a Node server. Let me know if you need a reduced test case or an example (I already have one). I can't publicly post the full example here, _yet_.
https://github.com/vercel/next.js/issues/21079
https://github.com/vercel/next.js/pull/26998
1c2b171322ae257c6e3796600857b73b8d62ce09
1a8ad1408928a2fbb8b9e5670c0b7251a503cb8b
"2021-01-13T19:50:19Z"
javascript
"2021-07-08T19:35:19Z"
closed
vercel/next.js
https://github.com/vercel/next.js
21,049
[".github/workflows/build_test_deploy.yml", "package.json", "packages/react-refresh-utils/ReactRefreshWebpackPlugin.ts", "test/integration/worker-loader/next.config.js", "test/integration/worker-loader/test/index.test.js", "yarn.lock"]
broken webpack 5 and worker-loader support
**What version of Next.js are you using?** 10.0.5 **What version of Node.js are you using?** 12.18.1 **What browser are you using?** Chrome **What operating system are you using?** macOS **How are you deploying your application?** Other platform **Describe the Bug** When using next.js with webpack 5 and worker-loader an exception appears. The exception `Uncaught TypeError: Cannot read property 'push' of undefined` happens when the web worker code is executed by the browser. **Expected Behavior** Expect web workers to not throw an exception **To Reproduce** https://github.com/ramasilveyra/bug-repro-next-w5-worker Currently worker loader test fails with webpack 5: <img width="1312" alt="Screen Shot 2021-01-13 at 1 34 05 AM" src="https://user-images.githubusercontent.com/7464663/104407007-74741f80-553f-11eb-8673-ba0c8ed3463e.png">
https://github.com/vercel/next.js/issues/21049
https://github.com/vercel/next.js/pull/21050
9efe8eb01919ce9456fc7c791c5f0f8b5638decc
d72b2d6e36f951fdd0ed27053adf065342e506c3
"2021-01-13T04:34:47Z"
javascript
"2021-01-14T06:48:49Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,955
["packages/next/build/webpack-config.ts"]
Yarn 2 PnP support
**Describe the feature you'd like to request** Referencing this tweet https://twitter.com/balazsorban44/status/1348374181268910085?s=19 We got asked for better Yarn 2 PnP support at `next-auth`, but according to my understanding, the changes should be done in Next.js instead. This issue has been raised at our repository first: https://github.com/nextauthjs/next-auth/pull/1034 **Describe the solution you'd like** @arcanis had a suggestion how to resolve this, see https://github.com/nextauthjs/next-auth/pull/1034#issuecomment-757546105 **Describe alternatives you've considered** Haven't used Yarn 2 PnP myself so couldn't have considered alternatives.
https://github.com/vercel/next.js/issues/20955
https://github.com/vercel/next.js/pull/20971
4d282f929f4475299aba0b496ba99b6398fc9b1a
552aa9df1ae670d9c8ee872880af980d72eebc2d
"2021-01-10T22:09:17Z"
javascript
"2021-01-11T12:31:31Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,826
["examples/with-firebase-cloud-messaging/next.config.js", "examples/with-firebase-cloud-messaging/package.json", "examples/with-firebase-cloud-messaging/public/firebase-messaging-sw.js", "examples/with-firebase-cloud-messaging/server.js"]
Custom server is not necessary in with-firebase-cloud-messaging
**What example does this report relate to?** with-firebase-cloud-messaging **What version of Next.js are you using?** 10.0.4 **What version of Node.js are you using?** 12.18.2 **What browser are you using?** Chrome and Firefox **What operating system are you using?** Ubuntu 18 **How are you deploying your application?** Vercel **Describe the Bug** In the with-firebase-cloud-messaging example, was created a custom server to serve some static files from /.next/ folder in the root scope. But I really dont understand the necessity of this custom server and it disable important performance optimizations (according to this doc page https://nextjs.org/docs/advanced-features/custom-server). So i created a POC to test if the FCM works without the custom server and works fine (i tested in localhost and on Vercel). **Expected Behavior** The example should not have the custom server. **To Reproduce** I created this repository without the custom server: https://github.com/VictorAssis/with-firebase-cloud-messaging My question is: does this custom server have any functionality that I am not noticing? If that is no longer needed, I can create a fork to update the example.
https://github.com/vercel/next.js/issues/20826
https://github.com/vercel/next.js/pull/20868
90ad2cbc44f5e807d7507c1eecc73ceb5445b6dc
86bb06457825a102638d4a9d3fd9c15c66d9872c
"2021-01-06T18:53:27Z"
javascript
"2021-01-11T09:14:14Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,816
["packages/next/next-server/server/incremental-cache.ts", "test/integration/gssp-redirect/pages/gsp-blog-blocking/[post].js", "test/integration/gssp-redirect/pages/gsp-blog/[post].js", "test/integration/gssp-redirect/test/index.test.js"]
Cache error on redirects from dynamic routes with SSG [Node.js 14+]
**What version of Next.js are you using?** 10.0.4 **What version of Node.js are you using?** 14.15.4 **What browser are you using?** Chrome **What operating system are you using?** Windows 10/Alpine Linux **How are you deploying your application?** next start **Describe the Bug** When returning a redirect value from getStaticProps in a dynamic route, the IncrementalCache.set function attempts to write invalid html data to the static page cache. Node.js version 14+ throws an exception here, which triggers this warning: `Failed to update prerender files for <pathname> TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Object` After downgrading to node version 12.18.4, no error occurs, instead an html file containing `[object Object]` is written. In our use case, there are no apparent ill effects with either version, aside from a large amount of entries in our error logs for the node.js 14 variant. Redirects still work as expected. **Expected Behavior** Html-cache should probably not be (attempted) generated from redirected paths. **To Reproduce** - Clone this repo https://github.com/anders-nom/nextjs-ssg-redirect-cache-bug - Install and use Node.js version 14.15.4 - Delete the .next directory if it exists - `npm run build` - `npm run start` - Visit http://localhost:3000/redirect - Observe the aforementioned warning in the server console, and note that no redirect.html or redirect.json was generated in /.next/server/pages
https://github.com/vercel/next.js/issues/20816
https://github.com/vercel/next.js/pull/26627
e8a9bd19967c9f78575faa7d38e90a1270ffa519
ae0dbe5e2cec8ac81f9d1f3605ad85f18b86cd8d
"2021-01-06T15:30:27Z"
javascript
"2021-06-28T12:23:23Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,776
["packages/react-dev-overlay/src/internal/helpers/stack-frame.ts", "packages/react-dev-overlay/src/middleware.ts", "test/acceptance/ReactRefreshLogBox.dev.test.js"]
Why does next.js offen shows the wrong line/file when there's an error?
**What version of Next.js are you using?** 10.0.3 **What version of Node.js are you using?** v12.20.1 **What browser are you using?** Chrome **What operating system are you using?** Linux:Ubuntu **How are you deploying your application?** Ubuntu/Docker **Describe the Bug** When there's an error next js shows wrong line/file almost every time? is this normal behaviour? **Expected Behavior** Shows the correct file and the line number **To Reproduce** Create a next js application, throw an unhandled error related to the template. ex: try to use an object as a component in a template: ``` import React from 'react'; const Test = () => ( <div> {{ test: 'test' }} </div> ); export default Test; ``` ![image](https://user-images.githubusercontent.com/1854023/103655613-82e59880-4f8d-11eb-987b-2a5c25ced506.png) as per the above image, there is no attribute called type on pointed location, or the file. this very hard to debug. This location is not even in the application's files: ![image](https://user-images.githubusercontent.com/1854023/103655876-e7085c80-4f8d-11eb-9105-b988d0f9dc5a.png)
https://github.com/vercel/next.js/issues/20776
https://github.com/vercel/next.js/pull/23203
8c72806aced6bd1a9e06d7e9289e691f7fa5ed49
89ec21ed686dd79a5770b5c669abaff8f55d8fef
"2021-01-05T14:08:28Z"
javascript
"2021-03-20T19:34:45Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,725
["packages/next/next-server/server/next-server.ts", "test/integration/i18n-support-base-path/next.config.js", "test/integration/i18n-support/next.config.js", "test/integration/i18n-support/test/shared.js"]
Rewrite of the sitemap.xml does not work.
Hi. I use 10.0.5-canary.8 version and I have one small rewrite: ``` async rewrites() { return [ { source: '/sitemap.xml', destination: '/api/sitemap' }, ] } ``` and it does not return content of the sitemap page. It returns this: `Error: Objects are not valid as a React child (found: [object Promise]). If you meant to render a collection of children, use an array instead`. What I am doing wrong? if i try fetch address `/api/sitemap` directly it works. Thank you
https://github.com/vercel/next.js/issues/20725
https://github.com/vercel/next.js/pull/20751
1a3adaa5d93730ad9d5fbffbf368d1526007fc3e
b9ba264bd6dc62df161e0ce69cb7c73d9b744e6b
"2021-01-04T02:03:57Z"
javascript
"2021-01-06T09:54:45Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,722
["examples/with-three-js/components/Bird.js", "examples/with-three-js/next.config.js", "examples/with-three-js/package.json", "examples/with-three-js/pages/birds.js", "examples/with-three-js/pages/boxes.js"]
Next with three.js example not working.
<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section --> # Bug report https://github.com/vercel/next.js/tree/canary/examples/with-three-js ## Describe the bug code breaks when ran. error is "Unhandled Runtime Error TypeError: uniforms.inverseProjectionMatrix.value.copy(...).invert is not a function" ## To Reproduce 1) yarn create next-app --example with-three-js with-three-js-app 2) yarn && yarn dev 3) click either example(birds and boxes). ## Expected behavior I see animations
https://github.com/vercel/next.js/issues/20722
https://github.com/vercel/next.js/pull/20897
d9f1cf007ff55f2fc441bee505600aa504108006
d0f1e33d537938e0ff0d9135483cfeb73eabc5a5
"2021-01-03T23:27:38Z"
javascript
"2021-01-11T09:28:43Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,713
["examples/with-react-intl/package.json"]
[examples, react-intl] npm run build fails
<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section --> # Bug report I was trying to run this example (on Windows) and when I try to build it, the build fails. ## Describe the bug Following the `README.md` instructions, when running `npm run build` I get the following result: ``` C:\Projects\with-react-intl-app>npm run build > [email protected] build C:\Projects\with-react-intl-app > npm run extract:i18n && npm run compile:i18n && next build && tsc -p tsconfig.server.json > [email protected] extract:i18n C:\Projects\with-react-intl-app > formatjs extract '{pages,components}/*.{js,ts,tsx}' --format simple --id-interpolation-pattern '[sha512:contenthash:base64:6]' --out-file lang/en.json > [email protected] compile:i18n C:\Projects\with-react-intl-app > formatjs compile-folder --ast --format simple lang/ compiled-lang/ Error: No JSON file found in lang/ at Object.<anonymous> (C:\Projects\with-react-intl-app\node_modules\@formatjs\cli\src\cli.js:113:39) at step (C:\Projects\with-react-intl-app\node_modules\tslib\tslib.js:140:27) at Object.next (C:\Projects\with-react-intl-app\node_modules\tslib\tslib.js:121:57) at C:\Projects\with-react-intl-app\node_modules\tslib\tslib.js:114:75 at new Promise (<anonymous>) at Object.__awaiter (C:\Projects\with-react-intl-app\node_modules\tslib\tslib.js:110:16) at Command.<anonymous> (C:\Projects\with-react-intl-app\node_modules\@formatjs\cli\src\cli.js:106:77) at Command.listener [as _actionHandler] (C:\Projects\with-react-intl-app\node_modules\commander\index.js:426:31) at Command._parseCommand (C:\Projects\with-react-intl-app\node_modules\commander\index.js:1002:14) at Command._dispatchSubcommand (C:\Projects\with-react-intl-app\node_modules\commander\index.js:953:18) ``` I also noticed that it deletes all the strings from the `lang/en.json` file. ## To Reproduce Steps to reproduce the behavior, please provide code snippets or a repository: 1. run `npx create-next-app --example with-react-intl with-react-intl-app` 2. run `npm run build` 3. See error ## Expected behavior I would expect the build to work and to be able to use the example. ## System information - OS: Windows 10 - Version of Next.js: 10.0.4 - Version of Node.js: 14.15 ## Additional context Also, might be good to update packages on this example. I tried that too but it did not resolve the issue.
https://github.com/vercel/next.js/issues/20713
https://github.com/vercel/next.js/pull/20763
6fd877ff345e1402e840bc26465237ffda8868aa
b6c6770cd9611c0b77d52d307ac0c8107bab478a
"2021-01-03T16:02:41Z"
javascript
"2021-01-05T16:44:40Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,626
["packages/next/build/babel/plugins/next-page-config.ts", "test/production/typescript-basic/app/pages/page-config.tsx", "test/unit/babel-plugin-next-page-config.test.ts"]
Failed to compile
<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section --> # Bug report ## Describe the bug A clear and concise description of what the bug is. ```log Error: xxx:Invalid page config export found. Expected object but got TSAsExpression in file /src/pages/index.tsx. See: https://err.sh/vercel/next.js/invalid-page-config ``` ## To Reproduce Steps to reproduce the behavior, please provide code snippets or a repository: 1. Create page index.tsx 2. Add page component. 3. Add page config like this: ```ts import { PageConfig } from 'next'; export const config = { } as PageConfig; ``` 4. See error 5. Change the config to: ```ts export const config: PageConfig = { }; ``` 6. Error is gone. ## Expected behavior A clear and concise description of what you expected to happen. ## Screenshots If applicable, add screenshots to help explain your problem. ## System information - OS: Debian - Browser (if applies) Chromium - Version of Next.js: 10.0.4 - Version of Node.js: 15.5.0 - Develop: next dev - TypeScript:4.1.3 ## Additional context Add any other context about the problem here.
https://github.com/vercel/next.js/issues/20626
https://github.com/vercel/next.js/pull/32702
d7de7deb70e58de84db16d8ae04010f306ec0d32
8aa3620a169f5c38beaf4a1b158c01bc3b5ba4c6
"2020-12-31T00:01:18Z"
javascript
"2022-02-05T21:15:49Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,624
[".github/ISSUE_TEMPLATE/1.bug_report.yml", "packages/next/next-server/lib/router/router.ts", "test/integration/link-with-hash/pages/index.js", "test/integration/link-with-hash/test/index.test.js"]
Hash link hydration mismatch
# Bug report ## Describe the bug Rendering a hash-only link on the server-side will result in a hydration mismatch. ## To Reproduce 1. Render `<Link href="#hash">` via SSR, then see hydration mismatch ## Expected behavior No hydration mismatch ## Screenshots ![image](https://user-images.githubusercontent.com/616428/103384077-12d59f00-4ac3-11eb-80c8-12de451e54ab.png) ```tsx <Link href="#item-400"> <a id="scroll-to-item-400">Go to item 400</a> </Link> ```
https://github.com/vercel/next.js/issues/20624
https://github.com/vercel/next.js/pull/21065
ceef1566c394c6884ba9fb0507bb66c5aa0be961
cdab7bf83191c055c364af7ce964afa820da9f15
"2020-12-30T22:19:12Z"
javascript
"2021-01-15T16:53:10Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,623
["packages/next/build/webpack/loaders/next-serverless-loader/page-handler.ts", "packages/next/next-server/lib/router/router.ts", "packages/next/next-server/server/next-server.ts", "test/integration/i18n-support/test/shared.js", "test/integration/ssg-data-404/pages/gsp.js", "test/integration/ssg-data-404/pages/gssp.js", "test/integration/ssg-data-404/pages/index.js", "test/integration/ssg-data-404/test/index.test.js"]
Ensure SSG data requests that 404 and aren't 'notFound: true' responses hard navigate
We need to ensure non-notFound SSG data 404s do cause a hard navigation as this signals a new deployment has occurred and a hard navigation will load the new deployment's version of the page.
https://github.com/vercel/next.js/issues/20623
https://github.com/vercel/next.js/pull/20622
74909ecfd40412132e6dda7bdebd76c2dcc05274
5324e8b6eeed67f2ba40bd8c5c900da204a2f032
"2020-12-30T21:49:07Z"
javascript
"2020-12-30T22:35:02Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,619
["docs/advanced-features/compiler.md", "docs/manifest.json"]
Feedback: nextjs.org/docs/advanced-features/customizing-babel-config
> hey, thanks for Next.. I love it. For the section about presets with custom config, I thought it was unclear. If I want to do something like use the decorators proposal plugin, and set an option on it, do I still set that on the next/babel preset? To team: DM me for ideas on how we can improve this
https://github.com/vercel/next.js/issues/20619
https://github.com/vercel/next.js/pull/31485
a48b8db94fb30d73985dd36bbe8bf68624975e69
03ce622972ff40a793a8262dc7e1767216301f40
"2020-12-30T21:04:38Z"
javascript
"2021-11-21T11:42:52Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,612
["packages/next/client/link.tsx", "packages/next/next-server/lib/router/router.ts", "packages/next/next-server/server/render.tsx", "test/integration/i18n-support/test/shared.js"]
New locale redirect behavior
Thanks @ijjk I just tried `v10.0.5-canary.4` in one of my projects. Is it expected that `<Link href="/hello" locale="xx" />` still points to `/xx/hello`, which is followed by a redirect on click? Two observations: - Having `/xx/hello` is probably not as good as `my-domain-for.xx/hello` SEO-wise - During local dev, having `domains: [{domain: "xx.localhost", defaultLocale: "xx"}]` means that the redirect from `/xx/hello` goes to `https://xx.localhost/hello` instead of `http://xx.localhost:3000/hello` (note the port and the protocol). This requires manual URL tweaking before the website in another locale can be viewed. What would be the suggested way forward here? _Originally posted by @kachkaev in https://github.com/vercel/next.js/issues/19174#issuecomment-752695489_
https://github.com/vercel/next.js/issues/20612
https://github.com/vercel/next.js/pull/20631
9fc9a6e1e45804e5d1a2335536a1972ef637e05e
fd33c9f7e1897bf519442001147e05d297d5ed12
"2020-12-30T17:43:35Z"
javascript
"2020-12-31T08:07:51Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,588
["packages/next/client/dev/amp-dev.js", "packages/next/client/dev/event-source-polyfill.js", "packages/next/client/dev/on-demand-entries-utils.js", "packages/next/package.json", "packages/next/pages/_document.tsx", "packages/next/taskfile.js", "packages/next/types/misc.d.ts", "test/integration/amphtml/test/index.test.js", "yarn.lock"]
Remove legacy unfetch dev polyfill
This polyfill is obsolete.
https://github.com/vercel/next.js/issues/20588
https://github.com/vercel/next.js/pull/20589
61e7dea9181ae767071f3cde112c3c2290942f81
52270af307a8df392e587516560b80e2d8b8284e
"2020-12-29T20:34:51Z"
javascript
"2020-12-29T21:01:42Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,576
["packages/next/build/webpack-config.ts"]
Improve stacktrace for wrong webpack 5 version
``` ❯ yarn next build ✘ 1 yarn run v1.22.5 $ /Users/joe/Documents/Development/Work/zeit/front/node_modules/.bin/next build (node:45037) UnhandledPromiseRejectionWarning: Error: webpack 5 version must be greater than v5.11.1 to work properly with Next.js, please upgrade to continue! See more info here: https://err.sh/next.js/invalid-webpack-5-version at Object.<anonymous> (/Users/joe/Documents/Development/Work/zeit/front/node_modules/next/dist/build/webpack-config.js:1:3644) at Module._compile (internal/modules/cjs/loader.js:1015:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10) at Module.load (internal/modules/cjs/loader.js:879:32) at Function.Module._load (internal/modules/cjs/loader.js:724:14) at Module.require (internal/modules/cjs/loader.js:903:19) at require (internal/modules/cjs/helpers.js:74:18) at Object.<anonymous> (/Users/joe/Documents/Development/Work/zeit/front/node_modules/next/dist/build/index.js:1:2150) at Module._compile (internal/modules/cjs/loader.js:1015:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10) at Module.load (internal/modules/cjs/loader.js:879:32) at Function.Module._load (internal/modules/cjs/loader.js:724:14) at Module.require (internal/modules/cjs/loader.js:903:19) at require (internal/modules/cjs/helpers.js:74:18) at Object.<anonymous> (/Users/joe/Documents/Development/Work/zeit/front/node_modules/next/dist/cli/next-build.js:2:287) at Module._compile (internal/modules/cjs/loader.js:1015:30) (node:45037) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:45037) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. ✨ Done in 1.51s. ```
https://github.com/vercel/next.js/issues/20576
https://github.com/vercel/next.js/pull/20578
e5b2bd170448b7739a98ad067b92f6715237b78d
eb8e038ddb0b123912f7f4ee5976efa5dc9294d9
"2020-12-29T16:20:28Z"
javascript
"2020-12-29T17:35:22Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,545
["errors/invalid-webpack-5-version.md", "packages/next/build/webpack-config.ts"]
Force webpack 5 to be 5.11.1 or newer
We need to force webpack 5 to be 5.11.1 or newer. All prior versions of webpack 5 have severe HMR consequences, and makes Next.js appear to be totally broken.
https://github.com/vercel/next.js/issues/20545
https://github.com/vercel/next.js/pull/20558
69ff649999a1f0689a9dd7a904ae6840f17d7174
c93c9fcc78b6e872a68b533bbcf6dd8ecb1adf03
"2020-12-28T18:54:31Z"
javascript
"2020-12-29T04:43:57Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,508
["packages/next/lib/load-custom-routes.ts", "packages/next/next-server/server/next-server.ts", "test/integration/i18n-support-index-rewrite/next.config.js", "test/integration/i18n-support-index-rewrite/pages/[...slug].js", "test/integration/i18n-support-index-rewrite/test/index.test.js"]
Rewrite for `/` doesn't match with i18n on a non-locale: false rewrite
When rewriting the `/` route with i18n enabled we need to ensure the value is built correctly when generating the locale version of the rewrite source i.e. when not using `locale: false`
https://github.com/vercel/next.js/issues/20508
https://github.com/vercel/next.js/pull/20509
6189fe969314e3f97f5eac8d0718c07c79af478f
db329fe9b0e13a389a84cb98fd936e8a671ba8ec
"2020-12-27T02:14:53Z"
javascript
"2020-12-28T18:21:28Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,500
["packages/next/build/webpack-config.ts", "packages/next/build/webpack/config/blocks/base.ts", "packages/next/build/webpack/plugins/terser-webpack-plugin/src/index.js", "test/integration/production-browser-sourcemaps/test/index.test.js"]
Production source maps show webpack-generated files rather than source files in 10.0.4
<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section --> # Bug report ## Describe the bug Looks like something is wrong with the `productionBrowserSourceMaps` option, which was moved out from experimental in v10.0.4 (#20267). Instead of displaying what developers have in the editor, they resolve into some intermedeate webpack output. ## To Reproduce 1. Create an app ```sh npx create-next-app next-production-source-maps-mvp cd next-production-source-maps-mvp yarn why next ## => Found "[email protected]" ``` 1. Enable `productionBrowserSourceMaps` ([as suggested by docs](https://nextjs.org/docs/advanced-features/source-maps)) ```sh cat <<EOF >next.config.js module.exports = { productionBrowserSourceMaps: true } EOF ``` 1. Build and start ```sh yarn build && yarn start ``` 1. Open the browser and observe - Raw source (pointing to a source map as expected): <img width="1121" alt="producion (raw source)" src="https://user-images.githubusercontent.com/608862/103157643-114b6480-47ad-11eb-95fd-00cd5e46395f.png"> - Source map (resolved and downloaded, but is not very helpful): <img width="1121" alt="production source map (broken)" src="https://user-images.githubusercontent.com/608862/103157645-16101880-47ad-11eb-8a10-eb948a87904a.png"> ## Expected behavior I was expecting the source maps for `yarn build && yarn start` to look the same as for `yarn dev`: <img width="1121" alt="development source map (looking good)" src="https://user-images.githubusercontent.com/608862/103157651-24f6cb00-47ad-11eb-975f-7f92324c54c7.png"> Seeing jsx, original file paths and unchanged js / ts syntax is crucial for debugging. ## System information - OS: macOS 11 - Browser (if applies) Chrome / Firefox - Version of Next.js: 10.0.4 - Version of Node.js: 14.15.3 - Deployment: local (also observed on vercel for [njt.now.sh](https://njt.now.sh)) ## Additional context Switching to [@zeit/next-source-maps](https://www.npmjs.com/package/@zeit/next-source-maps) (which the new option is aiming to replace) gives the same incorrect result in Next 10.0.4. Here are the additional repro steps to observe this: ```sh yarn add -D @zeit/next-source-maps cat <<EOF >next.config.js const withSourceMaps = require('@zeit/next-source-maps') module.exports = withSourceMaps() EOF yarn build && yarn start ``` What helps is downgrading to Next 10.0.3 and either keeping `@zeit/next-source-maps` or setting the experimental option: ```sh yarn add [email protected] cat <<EOF >next.config.js module.exports = { experimental: { productionBrowserSourceMaps: true } } EOF yarn build && yarn start ``` <img width="1121" alt="production and experimental flag in version 10.0.3 " src="https://user-images.githubusercontent.com/608862/103157914-2aa1e000-47b0-11eb-9c17-3e60d2726e3b.png">
https://github.com/vercel/next.js/issues/20500
https://github.com/vercel/next.js/pull/20672
9ded7aa9553a281eee009e5ce1ca0ba8f093ddda
2c75fa0d9ece05144574a1ee4624845e72f96681
"2020-12-26T19:27:32Z"
javascript
"2021-01-01T20:30:50Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,488
["packages/next/package.json", "yarn.lock"]
Multiple issues related to ii18n (redirects, localeDetection)
next.config.js: ``` module.exports = { trailingSlash: true, i18n: { locales: ["en", "de"], defaultLocale: "en", }, async redirects() { return [ { source: "/en/:path*", destination: "/:path*", permanent: true, }, ]; }, } ``` **1st Issue** the issue I mentioned in #20165 is still not working for me (upgraded to 10.0.4). only the issue related to the trailingSlash seems to be fixed for me. Examples: - I go to **/en/**, I am not redirected to **/**, instead I stay on **/en/** - I go to **/en/some-page/**, I am not redirected to **/some-page/**, instead I stay on **/en/some-page/** <img width="558" alt="en-imprint-redirect" src="https://user-images.githubusercontent.com/75957128/103151775-67a2ae00-4781-11eb-9742-2fd957f11592.png"> <img width="556" alt="en-redirect" src="https://user-images.githubusercontent.com/75957128/103151776-696c7180-4781-11eb-8f10-0dc43fa1eec4.png"> **2nd Issue** In my opinion, **localeDetection** is not working properly, when it includes a region. Example: - I set the browser language to "de-at" in FF - I go to **/**, I am not redirected to **/de/**, instead I stay on **/** however, it works when the browser language is explicitly set to "de" only. but when it includes a region (e.g. Austria) like in the example above, it is not working. <img width="551" alt="accept-language" src="https://user-images.githubusercontent.com/75957128/103151721-f6fb9180-4780-11eb-86a2-60a7a76c7f79.png"> **3rd Issue** In my opinion, **localeDetection** also creates a bad user experience. Example: - I set the browser language to "de" in FF - I go to **/** it redirects to **/de/** (this is fine) - I click the link "Go to EN", I am redirected to **/** (this is fine, as I explicitly want to browse the EN version) - I refresh the browser (for whatever reason), I get redirected back to **/de/** instead of staying on **/** `<Link href="/" locale="en">Go to EN version</Link>` is this intended? I feel like when a user explicitly decides to navigate to a different locale, **localeDetection** should be deactivated during that session, or preferably even set a cookie that prevents **localeDetection** when the user comes back to the site in the future. this also shouldn't be any issue for SEO.
https://github.com/vercel/next.js/issues/20488
https://github.com/vercel/next.js/pull/24283
e5da204aab03599e5d986fcd8ca7d20884561c9e
a4420532b9020d89068851fe090a227ef2d080da
"2020-12-26T12:44:35Z"
javascript
"2021-05-16T19:01:24Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,487
["docs/api-reference/next.config.js/build-target.md", "docs/api-reference/next.config.js/compression.md", "docs/manifest.json"]
Documentation "highly recommends" an undocumented feature: serverless target
# Bug report ## Describe the bug From the documentation: > `server` target > > This is the default target, however, we **highly recommend the serverless** target. It is explained that the `serverless` target will output autonomous modules, one per page, which export kind of wrappers around the http framework and therefore can be used in any cloud serverless function provider (e.g. Google Cloud Functions). This does work indeed, but then the client code tries to fetch `_next/data/{buildID}/{somepage}.json` which the documentation doesn't mention. Therefore, the documentation **highly** recommends an undocumented feature, which is **confusing**. ## To Reproduce 1. Read the doc and contemplate how it is **highly recommended** to deploy with the `serverless` target and use the generated modules 2. Make use of the `render` method of (for instance) `index.js` from the build output in `.next/serverless/pages/` in the code of a function of your favorite serverless function cloud provider (e.g. Google Cloud Functions) 3. Host `.next/static` in a `_next/static` folder so that `example.com/static/` uses it, and have `example.com/` be served by the cloud function 4. Repeat for other routes (for instance map `/another` to another cloud function which uses `require('serverless/another.js').default.render` 4. Open `example.com` in the browser and in the console watch the browser fail to fetch `_next/data/{buildID}/another.json` and force a full reload by redirecting to /another instead of using client-side routing navigation ## Expected behavior - Explain in the documentation what is needed to deploy the next.js framework in this highly recommended `serverless` configuration: access to disk for caching (and how to disable it in next.config.js), routes to be setup for `_next/data` and methods to be used (`renderReqToHTML` ?): not documenting this makes the `serverless` target kind of pointless while you highly recommend it in the same time - Please do not merely point to non-official projets (e.g. [serverless-next](https://github.com/serverless-nextjs/serverless-next.js)) ## System information N/A (applies to all systems)
https://github.com/vercel/next.js/issues/20487
https://github.com/vercel/next.js/pull/20714
9a0d704f763413f03575b3fd0236e49d0fd5f57e
74166ea7e802f5b5fd1d74a5a3f097bcda11ea59
"2020-12-26T10:01:53Z"
javascript
"2021-01-04T09:45:57Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,486
["packages/next/client/index.tsx", "packages/next/next-server/lib/router/router.ts", "test/integration/build-output/test/index.test.js"]
experimental.scrollRestoration configuration makes Safari throw SecurityError
# Bug report ## Describe the bug When enabling `experimental.scrollRestoration` in `next.config.js`, scrolling too fast makes Safari (Desktop & Mobile) throws exceptions in the console: it complains `replaceState` is called more than 100 times in a 30-second window. ## To Reproduce - Have the following `next.config.js` > `module.exports = { > experimental: { > scrollRestoration: true, > }, > }` > - Have a component which renders a long page - Scroll fast on mobile Safari (iOS 14) or desktop Safari (macOS 11.1) - Look at the debugger console or popup appearing on screen if in dev mode - ## Expected behavior - No such exception - Maybe let the developer specify its debounce timeout: I tried increasing the default 10ms and it works fine ## Screenshots ![Capture d’écran 2020-12-26 à 10 20 04](https://user-images.githubusercontent.com/765273/103149061-6dd76100-4766-11eb-850b-864066f1143b.png) ## System information - OS: iOS and macOS - Browser: Safari - Version of Next.js: 10.0.4 - Version of Node.js: 15.4.0 - Deployment: next dev and next start, both localhost and Vercel
https://github.com/vercel/next.js/issues/20486
https://github.com/vercel/next.js/pull/20633
380afbfba2a277ed19bc69a608cf5053c44cdcf7
dbe1e626f877a9ef7bbffc2f360bae809874790d
"2020-12-26T09:38:24Z"
javascript
"2020-12-31T16:08:12Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,404
["packages/next/build/index.ts", "packages/next/build/webpack-config.ts", "packages/next/next-server/server/optimize-amp.ts", "packages/next/package.json", "packages/next/taskfile-ncc.js", "packages/next/taskfile.js", "test/.stats-app/pages/amp.js"]
AMP OPTIMIZER Failed downloading latest AMP runtime data. Proxies need to be configured manually
<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section --> # Bug report ## Describe the bug When create a next js app using `npx create-next-app` on windows 10, I receive this error in terminal `AMP OPTIMIZER Failed downloading latest AMP runtime data. Proxies need to be configured manually, see https://github.com/ampproject/amp-toolbox/tree/main/packages/optimizer#fetch.` ## To Reproduce Steps to reproduce the behavior, please provide code snippets or a repository: 1. Run `npx create-next-app` ## Expected behavior I expect not to see any errors :) ## Screenshots ![Capture](https://user-images.githubusercontent.com/72021045/102935226-671ec480-44ae-11eb-9ca6-11476a17c62c.PNG) ## System information - OS: Windows 10 - Version of Node.js: 14.15.3
https://github.com/vercel/next.js/issues/20404
https://github.com/vercel/next.js/pull/21980
3f94f33ba2111b7a757ef39a5b0c8562b8d16682
5febe218a622022fb375ef5101f1848d9c3120cc
"2020-12-22T21:35:50Z"
javascript
"2021-02-11T09:55:56Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,403
["docs/basic-features/static-file-serving.md"]
Docs for static file serving should mention required Next.js version for next/image
This page: https://nextjs.org/docs/basic-features/static-file-serving - uses `next/image` without saying the Next.js that's required to use it.
https://github.com/vercel/next.js/issues/20403
https://github.com/vercel/next.js/pull/20815
991ad9225a2f9ea0d9673ab7fb1cdfebf90ea881
fb9ca49401b0f736e421dd7a971c11a88f0b41ac
"2020-12-22T20:49:35Z"
javascript
"2021-01-06T15:21:34Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,370
["packages/next/next-server/server/next-server.ts", "test/integration/getinitialprops/next.config.js", "test/integration/getinitialprops/pages/blog/[post].js", "test/integration/getinitialprops/pages/index.js", "test/integration/getinitialprops/pages/normal.js", "test/integration/getinitialprops/test/index.test.js"]
AsPath is incorrect on Server if you use rewrites and getInitialProps
<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section --> # Bug report ## Describe the bug AsPath is incorrect on Server if you use rewrites and getInitialProps. On the server, asPath is the rewritten asPath while on the client asPath ist as given in the request URL. ## To Reproduce Start with a new next typescript project. And add: Next.config.js ``` module.exports = { async rewrites() { return [ { source: "/:sector(s1|s2)/product/:pid", destination: "/product/:pid", }, ]; }, }; ``` /pages/product/[pid].tsx ``` import { NextPage } from 'next'; import { useRouter } from 'next/router'; const Product: NextPage = () => { const { asPath } = useRouter(); console.log({ asPath }); return <h1>Product</h1>; }; Product.getInitialProps = ({ asPath, query }) => { // dataFetch return {}; }; export default Product; ``` 1. Go to `/s1/product/42` 2. Compare logs on server and clientside. ## Expected behavior AsPath on server and client ist `/s1/product/42` ## System information - OS: Windows - Version of Next.js: 10.0.3 - Version of Node.js: 12.18.3 ## Additional Information If you use getServerSideProps instead of getInitialProps it works as expected. You can test this by replacing ``` Product.getInitialProps = ({ asPath, query }) => { // dataFetch return {}; }; ``` with ``` export const getServerSideProps: GetServerSideProps = async () => { // datafetch return { props: {} }; }; ```
https://github.com/vercel/next.js/issues/20370
https://github.com/vercel/next.js/pull/20572
88b6ea416d5de96300e0de6fe9aeb11b5ad5a0d9
47cb4cf850b27c36f8839ad915bb0f14cc92910c
"2020-12-21T16:21:53Z"
javascript
"2021-01-25T18:26:32Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,369
["docs/deployment.md"]
Add documentation detailing how we automatically load new versions of your application
See this twitter thread: https://twitter.com/timer150/status/1341044363573473282 It seems we're currently missing docs covering that we automatically load new versions of your application, and that there's no special or custom code necessary. We should explain that `<Link>` temporarily works like a normal `<a>` tag to load the new version, which makes this concept easy to grok.
https://github.com/vercel/next.js/issues/20369
https://github.com/vercel/next.js/pull/20373
c86757bcc713f3a11216c8abf457b2a2da07f701
9c917ab26313caad9d13987712b0e241d42a901c
"2020-12-21T15:37:26Z"
javascript
"2020-12-22T12:59:27Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,341
["packages/next/next-server/lib/post-process.ts", "test/integration/font-optimization/test/index.test.js"]
Server logging "The postprocess middleware "Inline-Fonts" took 11ms(10, 1) to complete" using 10.0.4-canary.8
<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section --> # Bug report ## Describe the bug We updated to v10.0.4-canary.8 to start using the shallow route flag. After this we discovered `The postprocess middleware "Inline-Fonts" took 11ms(10, 1) to complete. This is longer than the 10 limit.` is getting logged a bunch server side when running in production on our server. The ms it logs varies from ~11 to ~150ms. I noticed that font optimizations are now enabled by default by #19758 added in v10.0.4-canary.2 and the plugin used there is probably causing this message. So far I have not been able to reproduce this running production locally. ## To Reproduce Steps to reproduce the behavior, please provide code snippets or a repository: 1. Add a font from Google Fonts like this in `_document.tsx`: ``` <Head> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700" rel="stylesheet" /> </Head> ``` 2. Push to a server, not sure if OS matters. We use Debian Buster. 3. Build project 4. Start with `next start` 5. Watch server logs ## Expected behavior No logged output or a better description on how to fix it. Or possibly a flag to opt out? ## Screenshots <img width="905" alt="image" src="https://user-images.githubusercontent.com/5442549/102702673-8bd42b80-4265-11eb-9767-2e54c7e7704f.png"> ## System information - OS: Debian Buster (GNU/Linux 4.19.0-9-amd64 x86_64) - Version of Next.js: 10.0.4-canary.8 - Version of Node.js: 13.14.0 - Deployment: next start ## Additional context Our site has a mix of statically generated, SSR pages and API routes.
https://github.com/vercel/next.js/issues/20341
https://github.com/vercel/next.js/pull/20382
5324e8b6eeed67f2ba40bd8c5c900da204a2f032
16e9de3565080bf03eece3b712fd89d534618dc9
"2020-12-20T01:06:20Z"
javascript
"2020-12-30T23:41:33Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,330
["packages/next/build/index.ts", "test/integration/i18n-support/test/shared.js"]
pages-manifest.json is generated with backwards slashes on Windows 14.x
# Bug report ## Describe the bug In a project with i18n configured, Next 10.0.3, the pages-manifest.json file has some unintentional backwards slashes. ![dsd](https://user-images.githubusercontent.com/57350178/102689397-c25d6800-41cb-11eb-88fd-386e94154200.png) ## To Reproduce Build an app with i18n configured, in Next 10.x and investigate pages-manifest.json ## Expected behavior Forward slashes only :) ## System information - OS: Windows 14.x - Version of Next.js: 10.0.3 - Version of Node.js: 14.x - Deployment: next build
https://github.com/vercel/next.js/issues/20330
https://github.com/vercel/next.js/pull/20376
2a6f481c71756da29fb054dcc0cee00d37581afe
788183e8d3c6e354e24a89febcfdc482fc55640b
"2020-12-19T12:30:51Z"
javascript
"2020-12-22T01:51:51Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,289
["examples/progressive-web-app/pages/_app.js", "examples/progressive-web-app/public/icons/icon-16x16.png", "examples/progressive-web-app/public/icons/icon-32x32.png"]
Example: progressive-web-app has 404's in the console
# Bug report There's a couple of missing icon files referenced in the example page <img width="639" alt="Screenshot 2020-12-18 at 9 16 25 AM" src="https://user-images.githubusercontent.com/11258286/102573400-64ba1480-4114-11eb-9678-b5f7f195f5a5.png"> ## Describe the bug Missing icon files referenced. ## To Reproduce Steps to reproduce the behavior, please provide code snippets or a repository: 1. Compile the `progressive-web-app` example `yarn build` 2. Start the production server `yarn start` 3. Visit `localhost:3000` 4. Open Console and see the error ## Expected behavior Icon files should be properly referenced ## System information - OS: macOS - Browser Chrome - Version of Next.js: 10.0.3 - Version of Node.js: 14.15.2 - Deployment: next start
https://github.com/vercel/next.js/issues/20289
https://github.com/vercel/next.js/pull/20288
ce4def79b3a04a336ec60de66a5be2f0fa9d86f8
bad9a8c960eddebdbdfd95846ba6b980666b97ab
"2020-12-18T04:10:00Z"
javascript
"2020-12-18T10:13:02Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,212
["packages/next/next-server/lib/router/router.ts", "test/integration/i18n-support-base-path/pages/gssp/index.js", "test/integration/i18n-support/pages/gssp/index.js", "test/integration/i18n-support/test/shared.js"]
Bug in the internationalization feature
# Bug report ## Describe the bug When you navigate to a page that use query parameters and isn't the default locale, the query parameters are treated as "undefined". ## To Reproduce 1. Go to my repo or other repo that uses the internationalization feature (https://github.com/luckasnix/next-bug-report); 2. Switch to other locale (the bug don't appear in the default locale); 3. Navigate to a page that uses query parameters ("/pt-BR/articles?page=1") using the browser buttons (the bug don't appear when using the Next Link); 4. At first, the value of the query parameter is treated as "undefined". ## Expected behavior The value of the query parameter must not be treated as "undefined". The behavior must be the same as the default locale. ## Screenshots The console shows the value of the query parameter as "undefined". ![bug-in-the-console](https://user-images.githubusercontent.com/50385918/102269575-9a37e580-3efb-11eb-941b-bece3fe99c4e.png) ## System information - OS: Windows 8.1 - Browser Google Chrome - Version of Next.js: 10.0.3 - Version of Node.js: 14.3.0 - Deployment: next dev ## Additional context No additional context.
https://github.com/vercel/next.js/issues/20212
https://github.com/vercel/next.js/pull/20441
556ab4f169a362e414b3b765272aae5675278df5
6189fe969314e3f97f5eac8d0718c07c79af478f
"2020-12-15T20:33:51Z"
javascript
"2020-12-28T17:58:07Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,198
["packages/next/client/image.tsx", "test/integration/image-component/default/pages/hidden-parent.js", "test/integration/image-component/default/test/index.test.js"]
next/image occupies space / is clickable in parent with visibility hidden
<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section --> # Bug report ## Describe the bug `<img style="visibility: visible;">` tag can't be used in components (modal, collapsible menu) which are hidden by `visibility: hidden`. `visibility: visible` is too aggressive and overrides `hidden` in parent. ## To Reproduce Steps to reproduce the behavior, please provide code snippets or a repository: ``` <div style={{ visibility: 'hidden' }}> <Image … /> </div> ``` ## Expected behavior Image won't be visible and clickable if the parent is hidden. Second image should not be visible as demonstrated on screen capture below. ![image](https://user-images.githubusercontent.com/1045362/102221016-e83fef80-3ee1-11eb-9643-10970f73614b.png) ``` <div style={{ width: '200px' }}> <Image src="https://placekitten.com/200/300" width={200} height={300} alt="" /> Visible picture </div> ^visible <br /> <br /> <div style={{ width: '200px', visibility: 'hidden' }}> <Image src="https://placekitten.com/200/300" width={200} height={300} alt="" /> Hidden picture </div> ^hidden ``` ## Screenshots Current nonoptimal behavior. ![hidden](https://user-images.githubusercontent.com/1045362/102220594-520bc980-3ee1-11eb-915f-f56814089248.gif) ## System information - Version of Next.js: [e.g. 10.0.3] ## Additional context Replace `visibility: hidden` with `visibility: inherit` in `<img>` tag.
https://github.com/vercel/next.js/issues/20198
https://github.com/vercel/next.js/pull/20542
db329fe9b0e13a389a84cb98fd936e8a671ba8ec
f02bf210ce4cdb9aaff35dbe2676147fbe54af35
"2020-12-15T13:26:17Z"
javascript
"2020-12-28T18:55:44Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,197
["docs/api-reference/next.config.js/rewrites.md"]
Rewrite params missing in query object
<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section --> # Bug report ## Describe the bug Parameters from rewrites source are not added to query if at least one parameter is used in the rewrite destination. ## To Reproduce Steps to reproduce the behavior, please provide code snippets or a repository: Next.config.js ``` module.exports = { async rewrites() { return [ { source: "/:sector(s1|s2)/product/:pid", destination: "/product/:pid", }, ]; }, }; ``` /pages/product/[pid].tsx ``` import { NextPage } from "next"; import { useRouter } from "next/router"; const Product: NextPage = () => { const { query } = useRouter(); return ( <> <h1>Product</h1> <p>{JSON.stringify({ query })}</p> </> ); }; Product.getInitialProps = ({ query }) => { // Data fetching return {}; }; export default Product; ``` 1. Go to `/s1/product/42` 2. Parameter `sector` is missing in query. ## Expected behavior Parameters from rewrite source are added to the query object. This works, if rewrite destination does not use parameters from the source. An easy way to verify this is to replace `destination: "/product/:pid",` in the rewrite rule with `destination: "/product/1234",` ## System information - OS: Windows - Version of Next.js: 10.0.3 - Version of Node.js: 12.18.3
https://github.com/vercel/next.js/issues/20197
https://github.com/vercel/next.js/pull/20757
873bf5dd7603f9b25ec988b17dc41cdf8fdbead4
f8e44b94258d43f88ca1730e08a054de3b4b4d4f
"2020-12-15T13:21:14Z"
javascript
"2021-01-05T14:47:08Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,058
["packages/next/build/webpack-config.ts", "packages/next/next-server/lib/router/router.ts", "packages/next/next-server/lib/router/utils/resolve-rewrites-noop.ts", "packages/next/next-server/lib/router/utils/resolve-rewrites.ts", "test/integration/custom-routes-i18n/test/index.test.js", "test/integration/production/test/index.test.js"]
Router bug with Catch-All routes
<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section --> # Bug report ## Describe the bug This appears to be an issue with Catch-All-Routes and the query-string params presented in the asPath. If query string is present the router url will update but the actual page will not change. This appears to only happen in dev environment. ## To Reproduce Steps to reproduce the behavior, please provide code snippets or a repository: 1. Download repo from "https://github.com/rmsheppard/next-router-error" 2. run in "npm run dev" 3. Click on "Managed Project List" link 4. Click on "Project 111 - Package 222" link 5. Notice behavior in url ( url changes, but page route didn't actually change ) ## Expected behavior The router should navigate to the expected page with the params ## Screenshots See repo/steps to reproduce ## System information - OS: macOS - Browser: Tested in Chrome - Version of Next.js: [e.g. 10.0.3] - Version of Node.js: [e.g. 12.18.3] - Deployment: run on local development environment ## Additional context This issue appears only in the development environment. The functionality though should be consistent between dev run and prod build. The router url will update but the page will not update and will be stuck basically on the loading screen. Removal of the query string params on the asPath allows the page to work but this shouldn't stop the router from working.
https://github.com/vercel/next.js/issues/20058
https://github.com/vercel/next.js/pull/21410
9fd9d83221c064eddb14cc3d34bb3f1200ead9a6
5b70802f619a7d5aa111a06850a51078a6ec5a60
"2020-12-10T15:12:26Z"
javascript
"2021-01-21T23:40:23Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,048
["package.json", "packages/next/client/experimental-script.tsx", "packages/next/client/request-idle-callback.ts", "packages/next/client/route-loader.ts", "packages/next/client/use-intersection.tsx", "packages/next/compiled/strip-ansi/index.js", "test/integration/build-output/test/index.test.js", "test/integration/size-limit/test/index.test.js", "test/unit/link-warnings.test.js", "yarn.lock"]
NextJS 10 breaks tests by throwing warnings for components using next/link
# Bug report ## Describe the bug Minimal code to replicate: https://github.com/thanos-diacakis-grandrounds/nextjs-10-link-test-errors We have a simple component includes a next/link. We have tests that will render the component, and assert various things (assertions omitted in the sample code). This works fine in NextJS 9.5.6. When upgrading to NextJS 10, these tests start throwing the following two warnings: 1. Warning: An update to Link inside a test was not wrapped in act(...). [etc.] 2. Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. ## To Reproduce 1. Check out this repo: https://github.com/thanos-diacakis-grandrounds/nextjs-10-link-test-errors 2. Run "npm run test" 3. Observer the warnings ## Expected behavior We expected to see the same behavior as NextJS 9.x - no warnings. ## Screenshots ![__dev_test__-zsh_](https://user-images.githubusercontent.com/64044150/101703785-f5954e00-3a8b-11eb-9dfc-4dcc229e42cf.png) ## System information - OS: macOS 10.15.7 - Version of Next.js: 10.0.3 - Version of Node.js: 14.6.0 - Deployment: local dev with "npm run test" ## Additional context If there is a single test, it seems to pass with no warnings. Once you add more tests, it seems to fail, even if the additional tests do nothing at all. Removing the <Link> resolves the issue. Tried turning off prefetching, making the act() function async/await, assuming some kind of state change is happening behind the scenes with no luck.
https://github.com/vercel/next.js/issues/20048
https://github.com/vercel/next.js/pull/22072
27b6dd6b02891cf41a425f5eef56769cd016acde
5f41abda9ac71923584446a60dafa5601aa3bfe1
"2020-12-10T00:10:30Z"
javascript
"2021-02-11T18:51:41Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,046
["packages/next/README.md"]
Update Next.js logo in the readme to support GitHub dark mode
https://github.com/vercel/next.js/issues/20046
https://github.com/vercel/next.js/pull/20047
3410106958c1d1938a0a7e50cc4896986ad5890d
a5fea53bc8bcfefd0c46df2ab7e598404cbf42ef
"2020-12-09T22:54:57Z"
javascript
"2020-12-09T23:57:07Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,044
["docs/advanced-features/i18n-routing.md"]
The NEXT_LOCALE cookie should be documented
I see that in i18n Routing RFC there is a mention of routing cookie A Locale can be forced by setting the NEXT_LOCALE cookie to a locale that is supported by the application. E.g. NEXT_LOCALE=nl-NL I have tested this functionality with the latest published version of the framework however, it is not in the documentation, can we rely on this functionality? Originally posted by @ivandotv in https://github.com/vercel/next.js/discussions/20038
https://github.com/vercel/next.js/issues/20044
https://github.com/vercel/next.js/pull/20045
d96c454127417095dc305a909330bc928e688082
782537dd2d265d718c5e2e3a5e51dd418df0f366
"2020-12-09T21:52:41Z"
javascript
"2020-12-09T22:45:05Z"
closed
vercel/next.js
https://github.com/vercel/next.js
20,036
["docs/api-reference/next/image.md", "docs/basic-features/data-fetching.md"]
Documentation should list Next.js version for each API
The documentation should list the Next.js version next to each API. For example: - `next/image` introduced in 10.0.0 - `getStaticProps` introduced in 9.3.0 We should also list the version of any APIs that were modified. For example: - `next/image` introduced in 10.0.0, `layout` prop added in 10.0.1 We can use the Node.js docs as inspiration which has a collapsed version table. For example: https://nodejs.org/api/fs.html#fs_fs_mkdir_path_options_callback
https://github.com/vercel/next.js/issues/20036
https://github.com/vercel/next.js/pull/20604
75509164ab18eed4cad542e8bccc412875dccb11
a03f1f3847b827ff1ae236111267cdf81ef9ba75
"2020-12-09T18:24:33Z"
javascript
"2020-12-30T15:06:34Z"
closed
vercel/next.js
https://github.com/vercel/next.js
19,964
["packages/next/client/image.tsx", "test/integration/image-component/default/pages/prose.js", "test/integration/image-component/default/pages/prose.module.css", "test/integration/image-component/default/test/index.test.js"]
next/image having specificity issues with Tailwind Typography
# Bug report ## Describe the bug When using Tailwind Typography and the `prose` element, it automatically adds margin-top and bottom to the `img` element. This messes up the responsive-ness of the `next/image` component. ## To Reproduce I've set a width and height ![image](https://user-images.githubusercontent.com/9113740/101501610-8f96b280-3935-11eb-96f8-d187668d501d.png) But it's displayed wrong ![image](https://user-images.githubusercontent.com/9113740/101501515-73931100-3935-11eb-9b8a-52c8bff83666.png) Toggling these styles fixes it. ![image](https://user-images.githubusercontent.com/9113740/101501490-6a09a900-3935-11eb-85f2-20bf12fca96d.png) ## Expected behavior I'd be great if we can build this into `next/image` to prevent users from hitting issues with Tailwind Typography. ## Screenshots See repo. ## System information - OS: Mac - Browser: Chrome - Version of Next.js: 10.0.3 - Deployment: next start and Vercel
https://github.com/vercel/next.js/issues/19964
https://github.com/vercel/next.js/pull/20580
2433c119467b596658cc7090aefc28f7df516c8e
e5b2bd170448b7739a98ad067b92f6715237b78d
"2020-12-08T15:15:13Z"
javascript
"2020-12-29T17:34:11Z"
closed
vercel/next.js
https://github.com/vercel/next.js
19,939
["packages/next/build/webpack-config.ts"]
Alias configuration breaks webpack 5 configuration
Reported in #19815
https://github.com/vercel/next.js/issues/19939
https://github.com/vercel/next.js/pull/19937
df2f6ec00329f0d424ef9ae2ab3985438ab5661e
4bca939ff72c83fbedae2cba91317e91b804c8d3
"2020-12-07T19:34:34Z"
javascript
"2020-12-07T22:35:28Z"
closed
vercel/next.js
https://github.com/vercel/next.js
19,923
["packages/react-dev-overlay/src/internal/container/Errors.tsx"]
next/image error message image link is wrong, because of unnecessary double quotes
<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section --> # Bug report ## Describe the bug When you use next/image wrong, for example you dont add a height or width, you get an error: ``Error: Image with src "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png" must use "width" and "height" properties or "layout='fill'" property.`` The next.js error overlay automatically creates a link out of https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png, but with some unnecessary double quotes added. Link from the error overlay now links to this: ``http://localhost:3000/%22https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png%22`` HTML from the error overlay: ```html <a href="&quot;https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png&quot;">"https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"</a> ``` ## To Reproduce 1. Use next/image wrong with an absolute / external URL 2. Click the image link in the the error message ## Expected behavior Link to the correct url. ## Screenshots Error Overlay ![image](https://user-images.githubusercontent.com/987947/101334329-02415880-3878-11eb-9a35-30bf899b6528.png) Link with multiple double quotes: ![image](https://user-images.githubusercontent.com/987947/101334444-28ff8f00-3878-11eb-840d-4a7f8f6cecf3.png) Server error is correct: ![image](https://user-images.githubusercontent.com/987947/101334281-f5246980-3877-11eb-9f88-d555ff18d2a7.png) ## System information - OS: Windows 10 - Browser: Chrome - Version of Next.js: v10.0.3 - Version of Node.js: v14.15.1 - Deployment: yarn dev
https://github.com/vercel/next.js/issues/19923
https://github.com/vercel/next.js/pull/19974
19fed3f83b88c587cbac943ea34fbfbbb76161ff
9bdb793c4ed88d9a4142b6a3049b7ec5f82213f8
"2020-12-07T09:52:40Z"
javascript
"2020-12-09T07:48:54Z"
closed
vercel/next.js
https://github.com/vercel/next.js
19,862
["packages/next/next-server/lib/loadable.js", "test/unit/fixtures/stub-components/hello.js", "test/unit/next-dynamic.test.js"]
TypeError: require.resolveWeak is not a function (jest test)
<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section --> # Bug report ## Describe the bug There's an error when trying to test a component which contains a dynamic imported component. The error i get is `TypeError: require.resolveWeak is not a function`. ## To Reproduce 1. Clone the repo https://github.com/Emiliano-Bucci/jest-with-dynamic-import- (it's a fork of the repo `with-jest` example) 2. Run tests ## Expected behavior It should be possible to test components which contains dynamic imported components, or dynamic components itself. ## Screenshots ![image](https://user-images.githubusercontent.com/36669369/101622250-17a0b900-3a17-11eb-908e-fd30f7a86784.png) ## System information - OS: macOS 11.0.1 - Browser: Chrome 87.0.4280.88 - Version of Next.js: 10.0.3 - Version of Node.js: 12.14.1 - Deployment: Vercel
https://github.com/vercel/next.js/issues/19862
https://github.com/vercel/next.js/pull/26614
c2f0653bd3b6c4d692986be5fdbf2d2f1e45b88e
c5751fa6c37741302fd7e3f7bcebe88c8aef9b16
"2020-12-05T11:14:59Z"
javascript
"2021-06-28T13:23:14Z"
closed
vercel/next.js
https://github.com/vercel/next.js
19,784
["packages/next/lib/load-custom-routes.ts", "packages/next/next-server/server/next-server.ts", "packages/next/next-server/server/router.ts", "test/integration/custom-routes/test/index.test.js", "test/integration/i18n-support/test/shared.js"]
Disable sub-path i18n routing
# Bug report ## Describe the bug When using [Domain Routing](https://nextjs.org/docs/advanced-features/i18n-routing#domain-routing) combined with trailing slash redirects, a page without a trailing slash is getting redirected to a locale sub-path even though the documentation states "The default locale does not have a prefix". ``` // next.config.js module.exports = { trailingSlash: true, i18n: { locales: ['en-GB', 'fi-FI'], defaultLocale: 'en-GB', localeDetection: false, domains: [ { domain: 'example.com', defaultLocale: 'en-GB', }, { domain: 'example.fi', defaultLocale: 'fi-FI', }, ] } }; ``` When visiting https://example.com/page/one, it redirects the user to https://example.com/en-GB/page/one/. Is there no way to completely disable sub-paths? ## To Reproduce There is a code sandbox set up to demonstrate the issue - https://codesandbox.io/s/staging-glade-hx5pe. 1. Append `/day` to the URL in the address bar (without trailing slash) 2. You will be redirected to `/en-GB/day/` Strangely enough, this behaviour doesn't happen if you append `/about` to the URL, you are only redirected to `/about/` which is the expected behaviour. `about.js` is a top level page `pages/about.js`, whereas `/day/` is served from `pages/day/index.js` ## Expected behavior As mentioned above, the expected behaviour would be for the redirect _not_ to insert a locale sub-path into the URL. I would expect https://example.com/page/one to redirect to https://example.com/page/one/.
https://github.com/vercel/next.js/issues/19784
https://github.com/vercel/next.js/pull/19859
90e97b535bca241e02381e011168820e005142b9
358861d3153d6192786293c34c8694db75d78732
"2020-12-03T11:35:22Z"
javascript
"2020-12-07T17:36:46Z"
closed
vercel/next.js
https://github.com/vercel/next.js
19,778
["errors/next-export-no-build-id.md", "errors/production-start-no-build-id.md", "packages/next/cli/next-export.ts", "packages/next/export/index.ts", "packages/next/next-server/server/next-server.ts", "test/integration/export-no-build/next.config.js", "test/integration/export-no-build/test/index.test.js", "test/integration/production-start-no-build/next.config.js", "test/integration/production-start-no-build/test/index.test.js"]
Clear up error message when production build is missing during `next start`
From @jlongster **yarn start didn't work** Steps: ```jsx $ git clone https://github.com/colinhacks/devii.git $ yarn $ yarn start ``` Error: ```jsx Error: Could not find a valid build in the '<redacted>/.next' directory! Try building your app with 'next build' before starting the server. <redacted> error Command failed with exit code 1. ``` `yarn start` is usually the way you start developing. Looking at the readme of the repo I saw it says to use `yarn dev`. Doing that works, but looking at `package.json` I see scripts that map to `next dev` and `next start`. Don't know why there are two different commands that are similar. The above error message should be more helpful
https://github.com/vercel/next.js/issues/19778
https://github.com/vercel/next.js/pull/19777
cf4665539aae3ef20c47a03f4bb399a8a825ad77
c792317295c076e0b449ada10571b0716e395111
"2020-12-03T10:35:33Z"
javascript
"2020-12-08T15:16:56Z"
closed
vercel/next.js
https://github.com/vercel/next.js
19,759
["examples/with-apollo/lib/apolloClient.js", "examples/with-apollo/package.json"]
Bug: List items duplication in the with-Apollo example setup using GetStaticProps
<!-- NOTE: This template is not optional. If you remove it or leave out sections there is a high likelihood it will be moved to the GitHub Discussions "Help" section --> # Bug report ## Describe the bug The Apollo Client's cache arrays get filled with duplicated items when using the setup provided in `examples/with-Apollo`, leading to my website displaying lists with twice (or even 3, 4... etc) times each item (and getting the infamous react duplicated key error, obviously 🙂). ## To Reproduce 1. Implement the `examples/with-Apollo` setup in a project where the schema has an array of items (a Relay connection field for example). 2. On a Next.js page (Page 1), make an apollo `useQuery` fetch the list of items and display it. 3. Add a GetStaticProps to the page, following exactly the with-Apollo example 4. In another page of the project (Page 2), create a link navigating to this page. 5. Run the project, go to Page 2. Click the button that takes you to Page 1. 6. Navigate back to Page 2 with back arrow of your browser. Open your console. 7. Navigate forward to Page 1 again. See the duplicated items and error messages about duplicate keys in your console. 8. If you repeat this operation x times, you will see the items repeated x times. ```jsx HOSTING_SEARCH_HOSTING_PROVIDERS = gql` query HostingSearchHostingProviders { bookableHostingProviders { edges { node { id name } } } const Page = ()=> { const { data, error, loading } = useQuery(HOSTING_SEARCH_HOSTING_PROVIDERS); return <>{data.bookableHostingProviders.edges.map(edge => <div key=>{edge.node.name} {edge.node.id}</div>)}</> } export const getStaticProps = async () => { const apolloClient = initializeApollo(); await apolloClient.query({ query: HOSTING_SEARCH_HOSTING_PROVIDERS, }); return addApolloState(apolloClient, { props: {}, revalidate: 20, }); }; export default Page ``` ## Expected behavior The elements of the array are not duplicated and I don't see duplicated key error messages in my console. ## Screenshots ![image](https://user-images.githubusercontent.com/11617630/100920087-8be8d300-34d2-11eb-8d13-7a0fb781b86d.png) ## System information - OS: macOS - Browser: all - Version of Next.js: 10.0.0 - Version of Node.js: 12.16.2 - Deployment: Vercel and `next dev` ## Likely solution I **think** that the problem comes from the fact that the official example uses [deepmerge](https://github.com/TehShrike/deepmerge) in a way that is not OK for the use case (the use case being to merge the client cache into the server cache). By default, and as used in the `with-apollo` example, `deepmerge` concatenates arrays when trying to merge 2 arrays at the same key of an object (this is why, when I repeat the manipulation x times, the list has been concatenated x times). I **guess** that the expected behaviour here would be that the array coming from the client cache would *overwrite* the array from the server cache, but I'm really not sure as I'm not expert enough in terms of the apollo internals here. `deepmerge` has a way to overwrite instead of concatenating in their docs so I guess this is quite common: ![image](https://user-images.githubusercontent.com/11617630/100922904-5219cb80-34d6-11eb-9c0a-d69d9260883c.png) So, moving the use of `deepmerge` from ```ts if (initialState) { // Get existing cache, loaded during client side data fetching const existingCache = _apolloClient.extract(); // Merge the existing cache into data passed from getStaticProps/getServerSideProps const data = merge(initialState, existingCache); // Restore the cache with the merged data _apolloClient.cache.restore(data); } ``` to ```ts if (initialState) { // Get existing cache, loaded during client side data fetching const existingCache = _apolloClient.extract(); // Merge the existing cache into data passed from getStaticProps/getServerSideProps const data = merge(initialState, existingCache, { arrayMerge: (destinationArray, sourceArray) => sourceArray, }); // Restore the cache with the merged data _apolloClient.cache.restore(data); } ``` in the `with-apollo` example code fixes the issue for me. However I struggle to understand if this is going to have adverse consequences for other use cases. Could someone that had something to do with the `with-apollo` example examine this and give me their thoughts please? Thanks a lot! ❤️
https://github.com/vercel/next.js/issues/19759
https://github.com/vercel/next.js/pull/19812
782537dd2d265d718c5e2e3a5e51dd418df0f366
3410106958c1d1938a0a7e50cc4896986ad5890d
"2020-12-02T19:36:21Z"
javascript
"2020-12-09T23:35:38Z"
closed
vercel/next.js
https://github.com/vercel/next.js
19,747
["packages/next/next-server/lib/router/router.ts", "packages/next/next-server/server/next-server.ts", "test/integration/i18n-support-base-path/pages/[post]/[comment].js", "test/integration/i18n-support-base-path/pages/[post]/index.js", "test/integration/i18n-support/pages/[post]/[comment].js", "test/integration/i18n-support/pages/[post]/index.js", "test/integration/i18n-support/test/shared.js"]
When using locales, error happen by using URL parameters and dynamic routes
# Bug report ## Describe the bug When using non default locales, error happen by using URL parameters and dynamic routes ## To Reproduce I created a sample of what I am experiencing currently with that topic here https://ud4rt.sse.codesandbox.io You can check the source code over there : https://codesandbox.io/s/misty-water-ud4rt Current issue spotted: 1. Click on non default locale like `fr` or `nl` to change the locale in the URL 2. By clicking on `/b?a=1&b=2&c=3` button, I should be routed properly to B page and passing parameters to it (same with `/c?a=1&b=2&c=3` button) You will get this error ``` Unhandled Runtime Error Error: The provided `as` value (/b) is incompatible with the `href` value (/[page]/[subpage]). Read more: https://err.sh/vercel/next.js/incompatible-href-as ``` ## Expected behavior It should behave the same with non default and default locale. Currently everything runs well with `en` which is the default locale ## Screenshots ![route_issue](https://user-images.githubusercontent.com/42861634/100885103-8f6c6200-34b2-11eb-8cce-648c36a1a6fd.jpg) ## System information - via codesandbox.io
https://github.com/vercel/next.js/issues/19747
https://github.com/vercel/next.js/pull/20080
748bcb996dc03c95ffd746df78c8ec9d1ff5dcf7
5b89b1b6df1ceed805160c85b3b79771e2ab5ad8
"2020-12-02T14:27:32Z"
javascript
"2020-12-12T14:06:46Z"