sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: next.js
Issue: Dynamic Sitemap throwing 404 error on Nextjs 15
Labels: bug

### Link to the code that reproduces this issue

https://github.com/umair-mirza/pakcrunch-new/blob/main/src/app/sitemap.ts

### To Reproduce

I have created a dynamic sitemap for my Nextjs 15 app in the following path:

src > app > sitemap.ts

I have created the sitemap according to the example quoted in the Nextjs documentation:
https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap

Here's the code:

```
import prisma from "@/lib/prisma";
import type { MetadataRoute } from "next";

export const revalidate = 86400;

export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
  const data = await prisma.post.findMany({
    select: {
      slug: true,
    },
  });

  const posts = data.map((item) => ({
    url: `${process.env.NEXT_PUBLIC_PRODUCTION_URL}/posts/${item.slug}`,
    lastModified: new Date(),
    changeFrequency: "monthly" as "monthly",
    priority: 0.5,
  }));

  return [
    {
      url: `${process.env.NEXT_PUBLIC_PRODUCTION_URL}/posts`,
      lastModified: new Date(),
      changeFrequency: "daily",
      priority: 1,
    },
    {
      url: `${process.env.NEXT_PUBLIC_PRODUCTION_URL}/terms-of-use`,
      priority: 0.1,
    },
    {
      url: `${process.env.NEXT_PUBLIC_PRODUCTION_URL}/contact-us`,
      priority: 0.2,
    },
    ...posts,
  ];
}
```

### Current vs. Expected behavior

I have created a dynamic sitemap for my Nextjs 15 app in the following path:

src > app > sitemap.ts

I have created the sitemap according to the example quoted in the Nextjs documentation:
https://nextjs.org/docs/app/api-reference/file-conventions/metadata/sitemap

However, when I visit the url: localhost:3000/sitemap.xml
Same result on production URL.

it returns 404.

![image](https://github.com/user-attachments/assets/82b9429b-2a7b-49fe-90f6-b94e9545ca0a)


### Provide environment information

```bash
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Home
  Available memory (MB): 16226
  Available CPU cores: 8
Binaries:
  Node: 20.16.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 15.0.0-rc.0 // Latest available version is detected (15.0.0-rc.0).
  eslint-config-next: 15.0.0-rc.0
  react: 19.0.0-rc-f994737d14-20240522
  react-dom: 19.0.0-rc-f994737d14-20240522
  typescript: 5.5.4
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

Not sure

### Which stage(s) are affected? (Select all that apply)

next dev (local)

### Additional context

_No response_
Repository: transformers
Issue: Better error message when loading adapter models with peft dependency missing
Labels: Feature request,PEFT

### Feature request

Loading adapter models (such as https://huggingface.co/lightonai/MonoQwen2-VL-v0.1/tree/main) fails with an error message when peft isn't installed. The error message
`OSError: lightonai/MonoQwen2-VL-v0.1 does not appear to have a file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt or flax_model.msgpack.`
 is a bit cryptic and requires the user to understand that
- the model that will be loaded is a peft adapter
- peft isn't installed in the current env

To improve UX, it would be useful to show a different error message such as `"The model lightonai/MonoQwen2-VL-v0.1 is an adapter model. To load it, you need to install peft (hint: run `pip install peft`)".`

### Motivation

Improve UX. The user may get the impression that the model repository is corrupted. 

### Your contribution

This feature should probably be implemented by core maintainers that are familiar with the internals of the model loading code.
Repository: pytorch
Issue: MPS random number generation is slow, if not hanging forever
Labels: module: performance,triaged,module: mps

### 🐛 Describe the bug

The following benchmarks are at least 3x - if not 10x slower on mps than cpu on a recent macbook pro M3

```python
from torch.utils.benchmark import Timer
import torch
print(Timer("torch.randint(1_000_000, (500,), device='cpu')", globals=globals()).adaptive_autorange())
print(Timer("torch.randint(1_000_000, (500,), device='mps')", globals=globals()).adaptive_autorange(max_run_time=10))

print(Timer("torch.randn((500,), device='cpu')", globals=globals()).adaptive_autorange())
print(Timer("torch.randn((500,), device='mps')", globals=globals()).adaptive_autorange(max_run_time=10))

print(Timer("torch.rand((500,), device='cpu')", globals=globals()).adaptive_autorange())
print(Timer("torch.rand((500,), device='mps')", globals=globals()).adaptive_autorange(max_run_time=10))
```

Results
```
<torch.utils.benchmark.utils.common.Measurement object at 0x113305720>
torch.randint(1_000_000, (500,), device='cpu')
  Median: 1.95 us
  IQR:    0.02 us (1.94 to 1.97)
  6 measurements, 1000 runs per measurement, 1 thread
<torch.utils.benchmark.utils.common.Measurement object at 0x113306320>
torch.randint(1_000_000, (500,), device='mps')
  Median: 19.48 us
  IQR:    1.95 us (19.25 to 21.20)
  2094 measurements, 1 runs per measurement, 1 thread
<torch.utils.benchmark.utils.common.Measurement object at 0x113306080>
torch.randn((500,), device='cpu')
  Median: 4.96 us
  IQR:    0.17 us (4.88 to 5.04)
  1999 measurements, 1 runs per measurement, 1 thread
<torch.utils.benchmark.utils.common.Measurement object at 0x113304eb0>
torch.randn((500,), device='mps')
  Median: 15.87 us
  IQR:    1.17 us (15.67 to 16.83)
  598 measurements, 1 runs per measurement, 1 thread
<torch.utils.benchmark.utils.common.Measurement object at 0x113305000>
torch.rand((500,), device='cpu')
  Median: 2.12 us
  IQR:    0.13 us (2.04 to 2.17)
  4473 measurements, 1 runs per measurement, 1 thread
<torch.utils.benchmark.utils.common.Measurement object at 0x1133060e0>
torch.rand((500,), device='mps')
  Median: 16.44 us
  IQR:    1.00 us (16.21 to 17.21)
  582 measurements, 1 runs per measurement, 1 thread
```

Worse, running this script a couple of times usually leads to the shell being idle even with `max_run_time` set!

### Versions

latest nightly

cc @msaroufim @kulinseth @albanD @malfet @DenisVieriu97 @jhavukainen
Repository: react
Issue: [Feature Request] Warn for arrays resulting of `.map()` or `.filter()` in hook dependencies
Labels: Status: Unconfirmed

ESLint plugin react hooks version: 4.6.0

## Steps To Reproduce

```tsx
const MyComponent = () => {
  const array = useMemo(() => ["banana", "apple"], []);

  const filteredArray = array.filter((element) => element !== "apple");

  useEffect(() => {
    console.log("If this is printed, array has changed");
  }, [array]);

  useEffect(() => {
    console.log("If this is printed, filteredArray has changed");
  }, [filteredArray]);

  const [counter, setCounter] = useState(0);

  return <button onClick={() => setCounter(counter + 1)}>Re-render</button>;
};
```

## Feature request
The exhaustive-deps rule already warns for functions declared in the scope of a component, which will be re-declared at each render and thus be a problem if put inside the dependency array of a `useEffect`, `useCallback` or `useMemo`. I recently had a problem when applying the `.filter()` method on a memoized array, since the new resulting array is a new one at each render.

I was wondering if it would be possible to warn for this kind of issues as well, the same way functions declared inside the component are currently warned.

I don't have an exhaustive list of such methods (that return a new object from a given one) that would be warned, other than `.filter()` and `.map()`, perhaps people in the comments can propose others?

## Where to do this
I have dived a little bit in the code of the package and found the `scanForConstructions` function ([here](https://github.com/facebook/react/blob/380f5d675d2269f090d15c3f92e10de66e12516c/packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js#L1584)) that seems to be the one that checks for the functions. If this is the way to do it, I could try to implement this other behaviour in this same function.
Repository: puppeteer
Issue: [Feature]: Easier automation of scrolling by touch
Labels: feature,P3

### Minimal, reproducible example

```TypeScript
I want to imitate a real finger scroll up/down on puppeteer. I use the mobile device configuration on puppeteer.

I don't know which event it is on a browser possibly `wheel` ? so I tried this,
```


### Background

    const puppeteer = require('puppeteer-extra')
    var  {KnownDevices} = require('puppeteer');
    const iPhone = KnownDevices['iPhone 15 Pro'];
    
    async function r()
    {
    	var browserArray = []
    	let browser = await puppeteer.launch(
    		{ 	headless:false,
    			defaultViewport: {
    			  width: 375,
    			  height: 667,
    			  isMobile: true,
    			}/**/
    	});
    
    
    
    	const page = await browser.newPage();
    	await page.emulate(iPhone);
    	async function wheeler()
    	{
    		await page.goto('https://www.google.com/search?q=facebook', {timeout: 0, waitUntil: 'domcontentloaded'});
    
    		await page.mouse.wheel({deltaY: -30});
    
    	}
    	wheeler();
    }
    
    r();


### Expectation

this doesnt do anything, I could use <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollBy">ScrollBy</a> with puppeteer but I want to imitate a  real finger press scroll event by a human. 



### Reality


As an example, for mouse wheel on browser, I can listen to the event like this: 

    document.body.addEventListener("wheel", (e) => {
      console.log("deltaY: " + e.deltaY)
    });\

How to do the same on mobile browser with finger press scroll up and down ? 

### Puppeteer configuration file (if used)

_No response_

### Puppeteer version

latest

### Node version

latest

### Package manager

npm

### Package manager version

latest

### Operating system

Windows
Repository: node
Issue: test_runner: `t.after` should respect `the first-in-last-out` principle like Golang's defer
Labels: feature request,test_runner

### Version

v22.10.0

### Platform

_No response_

### Subsystem

_No response_

### What steps will reproduce the bug?

### 1. Create a test file

```js
import fs from 'node:fs'
import path from 'node:path'
import test from 'node:test'

test('basic', async (t) => {
    const testDir = path.join(import.meta.dirname, 'logs')

    fs.mkdirSync(testDir, { recursive: true })

    t.after(() => {
        console.log('remove test dir')
        fs.rmdirSync(testDir, { recursive: true })
    })

    fs.writeFileSync(path.join(testDir, 'test.log'), 'hello world!')

    t.after(() => {
        console.log('remove test file')
        fs.unlinkSync(path.join(testDir, 'test.log'))
    })

    // do staff...
})
```

### How often does it reproduce? Is there a required condition?

None

### What is the expected behavior? Why is that the expected behavior?

`t.after` should follow the first-in, last-out principle

According to the above code, the file should be deleted first, then the directory

### What do you see instead?

```
✖ basic (7.4021ms)
  Error: ENOENT: no such file or directory, unlink 'project\folder\logs\test.log'
      at Object.unlinkSync (node:fs:1871:11)
      at TestContext.<anonymous> (file:///path/to/test.test.mjs:19:12)
      at TestHook.runInAsyncScope (node:async_hooks:211:14)
      at TestHook.run (node:internal/test_runner/test:934:25)
      at TestHook.run (node:internal/test_runner/test:1225:18)
      at TestHook.run (node:internal/util:543:20)
      at node:internal/test_runner/test:853:20
      at async Test.runHook (node:internal/test_runner/test:851:7)
      at async after (node:internal/test_runner/test:893:9)
      at async Test.run (node:internal/test_runner/test:942:7) {
```

### Additional information

`the first-in-last-out` principle is more reasonable and practical. It is useful in many scenarios.

I'm not sure why it was designed in the form of a queue. Is there anything special about it?
Repository: next.js
Issue: querystring is not working to alternates canonical and languages in generateMetadata
Labels: bug,Metadata

### Link to the code that reproduces this issue

https://github.com/richg0ld/generate-metadata-bug

### To Reproduce

In Next.js 15, I am trying to use the query string in generateMetadata's alternates.canonical and alternates.languages, but it is not being applied.

How can I ensure that querystring is not removed?

The sample code is as follows.

```
export async function generateMetadata(): Promise<Metadata> {
  return {
    metadataBase: new URL('http://localhost:3000'),
    title: t('title'),
    alternates: {
      canonical: '/',
      languages: {
        'x-default': '/',
        en: '/?hl=en_US',
        ko: '/?hl=ko_KR',
      },
    },
  };
}
```

### Current vs. Expected behavior

The expected behavior is as follows,
```
<link rel="alternate" hreflang="x-default" href="http://localhost:3000">
<link rel="alternate" hreflang="en" href="http://localhost:3000/?hl=en_US">
<link rel="alternate" hreflang="ko" href="http://localhost:3000/?hl=ko_KR">
```

However, the result is as follows,
```
<link rel="alternate" hreflang="x-default" href="http://localhost:3000">
<link rel="alternate" hreflang="en" href="http://localhost:3000">
<link rel="alternate" hreflang="ko" href="http://localhost:3000">
```

### Provide environment information

```bash
nextjs:15.0.3
reactjs:19.0.0-rc
react-dom:19.0.0-rc
```


### Which area(s) are affected? (Select all that apply)

Metadata

### Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Other (Deployed)

### Additional context

It would be helpful to have an 'other' option for link tags, similar to the 'other' option for handling meta tags. For example, having a method like this would be useful.
```
...,
other: [
  {
    hreflang: "en",
    rel: "alternate",
    href="/?hl=en_US"
  },
  ...
]
```
having a method like this would be useful.
Repository: godot
Issue: Inconsistent sorting order with numbered and unnumbered files
Labels: bug,topic:editor,usability

### Tested versions

4.4 dev4

### System information

Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 31.0.15.4633) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

### Issue description

![image](https://github.com/user-attachments/assets/b8705ff2-fcf8-4c92-b873-b4dc5513d2c1)
Why is icon.svg listed as last?

Windows Explorer for comparison
![image](https://github.com/user-attachments/assets/76cc2a6c-2a9f-407c-ae45-3048dae43341)

GIMP
![image](https://github.com/user-attachments/assets/b174f85e-986f-4609-a137-83f33ec3d8e7)


### Steps to reproduce

1. Duplicate `icon.svg` into `icon2.svg` and `icon3.svg` etc.
2. 👀

### Minimal reproduction project (MRP)

N/A
Repository: kubernetes
Issue: Deployment controller: Inconsistency of deletePod pod update handler and oldPodsRunning condition
Labels: kind/bug,sig/apps,needs-triage

### What happened?

We observed that in cluster with phase=Failed pods present, the update of the deployment using Recreate strategy was stalling for ~10 minutes (ProgressDeadlineSeconds period).

After a log analysis and code, I think this is caused by the fact that [deletePod handler](https://github.com/kubernetes/kubernetes/blob/74e84a90c725047b1328ff3d589fedb1cb7a120e/pkg/controller/deployment/deployment_controller.go#L385-L391) (the handler attached to pod informer), for Recreate case is enqueuing the deployment only if the number of pods equals zero. OTOH if the loop triggers, the different condition is checked: [oldPodsRunning](https://github.com/kubernetes/kubernetes/blob/74e84a90c725047b1328ff3d589fedb1cb7a120e/pkg/controller/deployment/recreate.go#L48-L51) ignores the terminal state pods such as Failed/Succeeded.

In effect, we may not enqueue deployment at the time when oldPodsRunning becomes true in a case when e.g. Succeeded pod is present.

### What did you expect to happen?

That the deployment is enqueued at the time when oldPodsRunning becomes true -- the last pod is deleted.

### How can we reproduce it (as minimally and precisely as possible)?

* Create a deployment with a pod in Failed state (we used a deployment with image that OOMs quite often)
* Try to update deployment few times
* You will observe that the updates starts to be delayed by ~10m at some point.

### Anything else we need to know?

A proposed fix is to change the deletePod to exclude the Final/Succeed state or even better share the logic with the oldPodsRunning condition (maybe even call it from there).

### Kubernetes version

<details>

```console
$ kubectl version
# paste output here
```
1.30.5, but the code looks like this also in master branch.
</details>


### Cloud provider

<details>
gke
</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```

</details>


### Install tools

<details>

</details>


### Container runtime (CRI) and version (if applicable)

<details>

</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>

</details>
Repository: vscode
Issue: Tab With Problems - Improve Accessibility for Colorblind People
Labels: feature-request,accessibility,workbench-tabs

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->

After several years of using VSCode as a colorblind guy, I realised that tabs also change colors when the file has errors 😅

Tabs that have uncommitted changes are signaled with this text color:
![Image](https://github.com/user-attachments/assets/49ecfea0-8335-49a9-868a-7e63bb10bbd3)

Tabs with problems are signaled with this text color:
![Image](https://github.com/user-attachments/assets/9c92968c-3af9-4785-beee-3513309e69c0)

Those text colors are very similar for colorblind people.

### Proposed solutions

- My favorite solution: Displaying a custom icon "⚠️" on the tab, instead of showing the file type icon (VueJS in our example).

Here is an example of the Problems tab icon when placed in the right sidebar (alongside copilot):
![Image](https://github.com/user-attachments/assets/d74cf6a7-eddb-4ff3-b111-fdac9ab450a2)

So this icon could be used as the file icon in the tab, when a file has problems:
![Image](https://github.com/user-attachments/assets/3b552e74-66fc-4db5-88eb-5a878709b8bf)


- With bold text when there is an error.
- With colors that have a higher luminance gap between them. (That you could differentiate easily even if you applied a grayscale filter on your screen.)
- With a red bar instead of a blue bar on the top of the tab (this solution will probably not be enough on its own).

![Image](https://github.com/user-attachments/assets/2aea5fcb-55e4-4546-b868-e91beee1b4b2)


### Short term mitigations

I moved the problem tab away for the bottom bar to the left sidebar.

Problems display on the bottom bar was very discreet (grey color for the tag, and away from the eyes at the bottom of the screen):
![Image](https://github.com/user-attachments/assets/fce4a923-2496-45ef-ad83-2445480ec56c)

It is more obvious in the sidebar:
![Image](https://github.com/user-attachments/assets/9b4f5623-5b1f-4097-99c5-4c76b7e80c32)
Repository: deno
Issue: rootDirs and SvelteKit
Labels: feat,tsc

deno 2.0.6 (stable, release, aarch64-apple-darwin)
v8 12.9.202.13-rusty
typescript 5.6.2

Hi,

I am using SvelteKit and I am trying to reproduce [this example](https://svelte.dev/docs/kit/load#Making-fetch-requests):

```ts
import type { PageLoad } from './$types';

export const load: PageLoad = async ({ fetch, params }) => {
	const res = await fetch(`/api/items/${params.id}`);
	const item = await res.json();

	return { item };
};
```

But I have this error:
<img width="1126" alt="Screenshot 2024-11-14 at 9 53 54 AM" src="https://github.com/user-attachments/assets/b1fb5624-bd27-43f2-b204-cb4771829c47">


From what I understand, it's maybe because the default SvelteKit `tsconfig.json` has the `rootDirs` options set to `["..", "./types"]` but this is not supported by Deno and/or the Deno VSCode extension.

```ts
{
  "extends": "./.svelte-kit/tsconfig.json",
  "compilerOptions": {
    "allowJs": true,
    "checkJs": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "resolveJsonModule": true,
    "skipLibCheck": true,
    "sourceMap": true,
    "strict": true,
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "rootDirs": ["..", "./types"]
  }
  // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
  // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
  //
  // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
  // from the referenced tsconfig.json - TypeScript does not merge them in
}
```

Thank you!
Repository: vscode
Issue: Bash shellIntegration: error messages when running with `set -u`
Labels: bug,terminal-shell-bash

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.95.1
- OS Version: Debian GNU/Linux trixie (testing), in ChromeOS Crostini container

Steps to Reproduce:

1. Add `set -u` to `~/.bashrc`
2. Launch a new Bash terminal in VS-Code
3. Observe error messages produced by the shellIntegration code, e.g. "bash: VSCODE_INJECTION: unbound variable".