sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: react
Issue: Bug: useEffect Without Dependencies Not Executed Correctly After setState 
Labels: Status: Unconfirmed

<!--
  Please provide a clear and concise description of what the bug is. Include
  screenshots if needed. Please test using the latest version of the relevant
  React packages to make sure your issue has not already been fixed.
-->

React version: 18.3.1 & 19.0.0

## Steps To Reproduce
Consider the following example code, where there are two useEffect hooks. 
- The first useEffect executes a setFlag, with the value of setFlag being the same as the initial value. The second parameter is an empty array. 
- The second useEffect simply logs a message without passing a second argument (i.e., without dependencies) to make it easier to observe the execution behavior. 

The JSX part of the component contains only a div with a click event, which triggers a setState when clicked.
```jsx
import React from 'react';
import { useEffect, useState } from 'react';

export function App(props) {
  const [index, setIndex] = useState(0);
  const [flag, setFlag] = useState(false);

  console.log('index', index);

  useEffect(() => {
    console.log('setFlag invoke');
    setFlag(false);
  }, []);

  useEffect(() => {
    console.log('useEffect no dependencies invoke');
    return () => {
      console.log('useEffect no dependencies hook destroyed');
    };
  });

  return (
    <div
      onClick={() => {
        console.log('-------------- click --------------');
        setIndex(pre => pre + 1);
      }}
      style={{ color: 'red' }}
    >
      button {index} {Date.now()}
    </div>
  );
}

```

<!--
  Your bug will get fixed much faster if we can run your code and it doesn't
  have dependencies other than React. Issues without reproduction steps or
  code examples may be immediately closed as not actionable.
-->

Link to code example: https://playcode.io/2185135

<!--
  Please provide a CodeSandbox (https://codesandbox.io/s/new), a link to a
  repository on GitHub, or provide a minimal code example that reproduces the
  problem. You may provide a screenshot of the application if you think it is
  relevant to your bug report. Here are some tips for providing a minimal
  example: https://stackoverflow.com/help/mcve.
-->

## The current behavior
After the click event is triggered, the component's render does not occur in tandem with the second useEffect. Render occurs twice, but the second useEffect executes only once.
<img width="627" alt="image" src="https://github.com/user-attachments/assets/9ffc9e58-4e89-4bd8-b407-e67837634554">

## The expected behavior
After the click event is triggered, the component's render should occur in tandem with the second useEffect. Render should happen twice, and the second useEffect should also execute twice.
Repository: pytorch
Issue: Extend custom op fwd/bwd functions to support data types beyond the basic set
Labels: triaged,module: custom-operators

### 🐛 Describe the bug

Wrapping CUDA kernels or other C++ functions as custom operations is currently the only way to ensure compatibility with torch.compile. However, there are notable limitations: functions decorated with `torch.library.custom_op` can only accept and return basic data types, excluding more complex types such as `enum.Enum` or `List[str]`.
Error 1:
```
ValueError: infer_schema(func): Parameter layout has unsupported type typing.List[str]
```
Error 2:
```
File "/home/ybliang/tmp/conda/lib/python3.10/site-packages/torch/_library/custom_ops.py", line 133, in inner
    schema_str = torch.library.infer_schema(fn, mutates_args=mutates_args)
  File "/home/ybliang/tmp/conda/lib/python3.10/site-packages/torch/_library/infer_schema.py", line 93, in infer_schema
    if annotation_type.__origin__ is tuple:
  File "/home/ybliang/tmp/conda/lib/python3.10/enum.py", line 433, in __getattr__
    raise AttributeError(name)
AttributeError: __origin__

```

@zou3519 mentioned that supporting all data types is not impossible, but it would be non-trivial and contingent on sufficient demand.

### Versions

N/A

cc @chauhang @penguinwu @zou3519 @bdhirsh @yf225
Repository: react
Issue: Bug: memory leak caused by alternate fiber tree
Labels: Status: Unconfirmed

<!--
  Please provide a clear and concise description of what the bug is. Include
  screenshots if needed. Please test using the latest version of the relevant
  React packages to make sure your issue has not already been fixed.
-->

React version: 19

## Steps To Reproduce

```typescript
import React, { useState, useCallback } from "react";

const App = () => {
  const [obj, setObj] = useState<any>({});
  const [count, setCount] = useState(0);

  const refresh = useCallback(() => {
    const newObj = {
      buffer: new Uint8Array(100_000_000),
      count: count + 1,
    };
    setObj(newObj);
    setCount((pre) => pre + 1);
  }, [count]);

  return (
    <div>
      <button onClick={refresh}>new obj({count})</button>
    </div>
  );
};

export default App;
```

## The current behavior
<img width="732" alt="image" src="https://github.com/user-attachments/assets/503bfa91-0bae-46cd-a4d7-a103f8cd4e2f">

## The expected behavior
release the `memoizedState` / `baseState` of alternate fiber tree.

## Confusion
I know it's not a good way to store a big state using `useState`. But it's a bug or some feature?
Repository: next.js
Issue: Next.js Cache not working with CircleCI
Labels: bug,Webpack,Performance

### Link to the code that reproduces this issue

https://github.com/DoctrineLegal/nextjs-cache-issue/blob/master/README.md

### To Reproduce

1. Trigger a build on CircleCI
2. Cache it's .next directory
3. Re-trigger a build on CircleCI with a hot cache
4. See that next.js is not using the cache

### Current vs. Expected behavior

### Current behavior: https://app.circleci.com/pipelines/github/DoctrineLegal/nextjs-cache-issue/1/workflows/745158ac-1c40-448e-9083-391e90cb0938/jobs/1

CircleCI is not using the cache. And consistently taking the same time to build.
![CleanShot 2024-12-09 at 07 27 03@2x](https://github.com/user-attachments/assets/fb433d38-5475-4d9e-af70-30640b702ae0)


### Expected Behavior: https://app.circleci.com/pipelines/github/DoctrineLegal/nextjs-cache-issue/1/workflows/745158ac-1c40-448e-9083-391e90cb0938/jobs/1
CircleCI should use the cache as specified here : https://nextjs.org/docs/pages/building-your-application/deploying/ci-build-caching#circleci


When forcing the cache dir it actually works.
![CleanShot 2024-12-09 at 07 25 11@2x](https://github.com/user-attachments/assets/e35a80e2-bd69-41eb-aef0-0da300b062d1)


### Provide environment information

```bash
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.0.0: Tue Sep 24 23:38:45 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T8122
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 22.4.1
  npm: 10.8.1
  Yarn: 1.22.22
  pnpm: 9.15.0
Relevant Packages:
  next: 15.0.4-canary.46 // There is a newer canary version (15.0.4-canary.48) available, please upgrade! 
  eslint-config-next: 15.0.2
  react: 19.0.0-rc-02c0e824-20241028
  react-dom: 19.0.0-rc-02c0e824-20241028
  typescript: 5.6.3
Next.js Config:
  output: N/A
 ⚠ There is a newer canary version (15.0.4-canary.48) available, please upgrade! 
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue
```


### Which area(s) are affected? (Select all that apply)

Performance, Webpack

### Which stage(s) are affected? (Select all that apply)

next build (local)

### Additional context

CircleCI is indeed running on docker with a cgroup container docker : https://github.com/vercel/next.js/blob/canary/packages/next/src/compiled/is-docker/index.js and found as docker from this file.

I believe this PR : https://github.com/vercel/next.js/pull/70516 from @shuding introduced the issue.

As a side note : CircleCI is currently rolling out new containers that will not be subject to this issue : https://discuss.circleci.com/t/docker-executor-infrastructure-upgrade/52282
Repository: ant-design
Issue: Panel  Header and Icon will re-render if wrapped in a form.
Labels: Inactive,improvement

### Reproduction link

[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/collapse-antd-4-24-16-forked-mt6ddt?file=%2Fdemo.tsx%3A1%2C1-41%2C1)

### Steps to reproduce

change input value, the icon and header re-render

### What is expected?

don't re-render

### What is actually happening?

the icon and header re-render

| Environment | Info |
| --- | --- |
| antd | 4.24.16 |
| React | 18 |
| System | mac |
| Browser | chrome |

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->

https://github.com/user-attachments/assets/4f61e4b2-bf06-404d-9778-2e8fb05fce38
Repository: deno
Issue: Node compatibility: process.stdout.hasColors() missing
Labels: bug,node compat

Version: Deno 2.1.3

I checked whether some new code I have written will work with Deno, and it doesn't. (By design my code fails gracefully and assumes color not available.) My high level goal with the code is checking whether it is appropriate to show color on `stdout` or `stderr` from a command-line application.

https://github.com/tj/commander.js/blob/a8ef5cf3e1975380974ab5c4f92c26fb2c5e3209/lib/command.js#L68-L71

```js
   {
      getOutHasColors: () =>
        useColor() ?? (process.stdout.isTTY && process.stdout.hasColors?.()),
      getErrHasColors: () =>
        useColor() ?? (process.stderr.isTTY && process.stderr.hasColors?.()),
   }
```

I saw https://github.com/denoland/deno/pull/24619 added `tty.WriteStream.prototype.hasColors()` and I can see that routine.

```text
$ node
Welcome to Node.js v22.12.0.
Type ".help" for more information.
> process.stdout.isTTY
true
> process.stdout.hasColors()
true
> 
$ 
$ deno
Deno 2.1.3
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> process.stdout.isTTY
true
> process.stdout.hasColors()
Uncaught TypeError: process.stdout.hasColors is not a function
    at <anonymous>:1:37
> import tty from 'node:tty';
undefined
> tty?.WriteStream?.prototype?.isTTY
undefined
> tty?.WriteStream?.prototype?.hasColors?.()
true
> 
```
Repository: pytorch
Issue: AllReduce hangs due to no device_id into init_process_group
Labels: oncall: distributed,module: c10d

### 🐛 Describe the bug

In pytorch 2.2 or later, when initializing a distributed environment, if you do not pass device_id to the init_process_group function but pass it through the set_device, the allreduce primitive hangs or NCCL directly reports an error. This question only comes up on allreduce primitives, does anyone know why?
You can run the example below with `torchrun --nproc_per_node 4 test.py`
```python
import torch
import torch.distributed as dist
import os

init_method = 'tcp://'
master_ip = os.getenv('MASTER_ADDR', 'localhost')
world_size = 4

default_master_port = '6000'
master_port = os.getenv('MASTER_PORT', default_master_port)
init_method += master_ip + ':' + master_port
rank = int(os.getenv('RANK', '0'))
# correct init
# torch.distributed.init_process_group(
#     backend="nccl",
#     world_size=world_size, rank=rank, device_id=torch.device(f"cuda:{rank}"), init_method=init_method)

# will cause allreduce hang
torch.cuda.set_device(torch.device(f"cuda:{rank}"))
torch.distributed.init_process_group(
     backend="nccl",
     world_size=world_size, rank=rank, init_method=init_method)

cur_rank = torch.distributed.get_rank()
if cur_rank == 0 or cur_rank == 1:
    gqa_group = torch.distributed.new_group([0, 1])
else:
    gqa_group = torch.distributed.new_group([2, 3])

a = torch.tensor(1, device=cur_rank)
torch.distributed.all_reduce(a, group=gqa_group)
```

### Versions

pytorch 2.5

cc @H-Huang @awgu @kwen2501 @wanchaol @fegin @fduwjj @wz337 @wconstab @d4l3k @c-p-i-o
Repository: ant-design
Issue: Textarea autoSize 有问题，高度不正确
Labels: 🐛 Bug,Inactive,🧶 Low Priority

### Reproduction link

[![Edit on CodeSandbox](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/sandbox/ji-ben-shi-yong-antd-5-22-3-forked-sc6clf?file=%2Fdemo.tsx%3A9%2C17)

### Steps to reproduce

查看输入框高度

### What is expected?

应该只有两行

### What is actually happening?

有三行

| Environment | Info |
| --- | --- |
| antd | 5.22.3 |
| React | latest |
| System | mac |
| Browser | chrome |

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: ui
Issue: [bug]: CLI fails to resolve correct component paths when paths are defined in extended tsconfig files
Labels: bug

### Describe the bug

The `shadcn-ui` CLI incorrectly resolves component paths when TypeScript path aliases are defined in extended tsconfig files instead of the root tsconfig.json. This results in components being generated in incorrect locations, either directly using the alias path or outside the project directory.

### Affected component/components

All

### How to reproduce

### Example 1: Using electron-vite

1. Create a new electron-vite project
2. Set up the following configuration files:

**tsconfig.json**
```json
{
  "files": [],
  "references": [{ "path": "./tsconfig.node.json" }, { "path": "./tsconfig.web.json" }]
}
```

**tsconfig.web.json**
```json
{
  "extends": "@electron-toolkit/tsconfig/tsconfig.web.json",
  "compilerOptions": {
    "composite": true,
    "jsx": "react-jsx",
    "baseUrl": ".",
    "paths": {
      "@renderer/*": [
        "src/renderer/src/*"
      ]
    }
  }
}
```

**components.json**
```json
{
  "aliases": {
    "components": "@renderer/components",
    "utils": "@renderer/lib/utils"
  }
}
```

3. Run `npx shadcn@latest add button`
4. Observe: Component is generated at `project/@renderer/components/ui/button.tsx` instead of `project/src/renderer/src/components/ui/button.tsx`

### Example 2: Using wxt.dev

1. Create a new wxt.dev project
2. Set up the following configuration files:

**tsconfig.json**
```json
{
  "extends": "./.wxt/tsconfig.json",
  "compilerOptions": {
    "allowImportingTsExtensions": true,
    "jsx": "react-jsx"
  }
}
```

**.wxt/tsconfig.json**
```json
{
  "compilerOptions": {
    "paths": {
      "@/*": ["../src/*"]
    }
  }
}
```

**components.json**
```json
{
  "aliases": {
    "components": "@/components",
    "utils": "@/lib/utils"
  }
}
```

3. Run `npx shadcn@latest add button`
4. Observe: Component is generated at `project/../src/components/ui/button.tsx` instead of `project/src/components/ui/button.tsx`

### Codesandbox/StackBlitz link

_No response_

### Logs

_No response_

### System Info

```bash
- Operating System: Windows 10
- Node.js Version: 22.12.0
- shadcn-ui CLI Version: 2.1.6
- Package Manager: npm
```


### Before submitting

- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues
Repository: ollama
Issue: Return prompt cache utilization on completion responses
Labels: feature request

Since Ollama has prompt caching now (right?), it would be great if the utilization of the cache could be returned in requests.

E.g. the OpenAI-compatible API could be extended with the new [`usage/prompt_tokens_details/cached_tokens`](https://platform.openai.com/docs/guides/prompt-caching).

A similar field in the Ollama API would also be great.
Repository: opencv
Issue: cv::VideoCapture memory cannot be manually released after reading video on different systems
Labels: bug,category: videoio,incomplete,needs investigation

### System Information

opencv 4.5.5

### Detailed description

The same program was run on ubuntu and windows, but the memory release of the program was inconsistent. my requirement is that the child thread releases the memory by itself after completing the task while the main thread continues to execute. However, I found that opencv cannot release the memory on Ubuntu, but it can on Windows. can you tell me why?
![捕获](https://github.com/user-attachments/assets/12def80c-f5dc-42f3-9676-365d36b7634d)


### Steps to reproduce

```cpp
#include <opencv2/opencv.hpp>
#include <thread>
#include <vector>
#include <iostream>

void video_capture_thread(int number)
{
	std::cout << "start -----------" << number << std::endl;
	
	std::string path = "E:\\workspace\\cpp\\test.mp4";


	cv::VideoCapture _capture(path);

	if (!_capture.isOpened())
	{
		std::cerr << path << std::endl;
		return;
	}

	cv::Mat _frame;
	int frame_count = 0;
	while (true)
	{
		_capture >> _frame;
		if (_frame.empty())
		{
			break;
		}
		if (frame_count % 100 == 0)
		{
			std::cout << "============frame_count============={}" << frame_count << std::endl;
		}
		frame_count += 1;
	}

	_frame.release();
	_capture.release();
	std::cout << "success -----------" << number << std::endl;
}

int main() {
	std::this_thread::sleep_for(std::chrono::seconds(10));
	std::vector<std::thread> _threads;
	int _number = 8;
	for (int i = 0; i < _number; ++i)
	{
		_threads.emplace_back(video_capture_thread, i);
	}

	for (auto& _thread : _threads)
	{
		_thread.detach();
	}

	std::this_thread::sleep_for(std::chrono::seconds(1000));

	return 0;
}
````

### Issue submission checklist

- [X] I report the issue, it's not a question
- [X] I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- [X] I updated to the latest OpenCV version and the issue is still there
- [X] There is reproducer code and related data files (videos, images, onnx, etc)
Repository: pytorch
Issue: `torch.compiler.disable()` on module hooks will disable `module.compile()`
Labels: module: nn,triaged,oncall: pt2,module: dynamo

### 🐛 Describe the bug

`torch.compiler.disable()` on module hooks will disable compile on the whole module when `module.compile()` is used (or via `torch.compile(some_function)(model, some_inputs)`)

```python
import torch
from torch import nn


d_model = 16
model = nn.Sequential(
    nn.Linear(d_model, d_model),
    nn.GELU(),
    nn.Linear(d_model, d_model),
)
model.cuda()

@torch.compiler.disable()
def hook(module, input):
    pass

model.register_forward_pre_hook(hook)
model.compile()  # this doesn't work
# model.forward = torch.compile(model.forward)  # this works

x = torch.randn(4, d_model).cuda()
model(x)
```

To check if the model is compiled, I use `TORCH_LOGS="output_code"`. For `model.compile()`, there is no code output. For `model.forward = torch.compile(model.forward)`, there is compiled triton code as expected.

Although `model.forward = torch.compile(model.forward)` is a valid workaround, it prevents me from doing full-compile a model in a function e.g. compute loss with signature `compute_loss(model, inputs, labels)`. Again, for this case, a workaround is to isolate the loss computation logic and compile it separately, but it gets messy. Ideally torch.compile should only ignore the hooks, not the `.forward()` logic, correctly.

### Error logs

_No response_

### Versions

torch==2.6.0.dev20241208+cu126

cc @albanD @mruberry @jbschlosser @walterddr @mikaylagawarecki @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @amjames
Repository: godot
Issue: There was a window ordering error when native windows
Labels: bug,needs testing,topic:gui

### Tested versions

4.3 Until now

### System information

Windows 10 x64

### Issue description

non-native windows order error.  The display order of sub-windows(PopupMenu) of the topmost window is not handled correctly.

The error may occur in the sort calculation of `Viewport::_sub_window_update_order()`. 

By the way, I found that changing the subwindow visibility triggers subwindow sorting. This means that window sorting is repeated multiple times in one frame. We should consider caching the value of `gui.sub_windows` and compare it with the current value at the end of each frame to determine whether subwindow sorting is needed.

### Steps to reproduce

- Create default project
- Add `Window`  node and  enable `always_on_top`
- Add any node with popup menu (e.g. TextEdit) to window node
- Run
- Open the popup menu

![Image](https://github.com/user-attachments/assets/51210105-6866-4559-8120-35dea0252b77)

### Minimal reproduction project (MRP)

[window_order_mrp.zip](https://github.com/user-attachments/files/18062504/window_order_mrp.zip)
Repository: kubernetes
Issue: can't find way to check streams is closed 
Labels: kind/bug,sig/node,triage/needs-information,needs-triage

### What happened?

https://github.com/kubernetes/kubernetes/blame/v1.31.3/staging/src/k8s.io/kubelet/pkg/cri/streaming/remotecommand/attach.go#L43

### What did you expect to happen?

can find way to check streams is closed

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

no method

### Anything else we need to know?

no method

### Kubernetes version

no method

### Cloud provider

null

### OS version

null

### Install tools

<details>

</details>


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

<details>

</details>


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

<details>

</details>
Repository: godot
Issue: Using different methods to implement non-embedded child windows will trigger the always_on_top breaks non-embedded popups problem
Labels: bug,topic:gui

### Tested versions

4.3 Until now

### System information

Windows 10 x64

### Issue description

We can get non-embedded child windows in the following two ways:
- disabling embed_subwindows.
- Change `force_native` of a subwindow

When using the second method, it seems that the parent window of the subwindow is not handled correctly. This causes all pop-ups on the subwindow to use the main window as its parent window(This is a guess). This further causes the position of the pop-ups of the subwindow to be wrong, and after `always_on_top` is enabled on the subwindow, it will cause the window sorting to be wrong and cover all the pop-ups of the subwindow.

### Steps to reproduce

- Create default project
- Add `Window` node, enable `always_on_top` and `force_native`, disable `visible`
- Add any node with popup menu (e.g. TextEdit) to window node
- Run
- Make the window node visible
- Open the popup menu on window node

![Image](https://github.com/user-attachments/assets/addcd92a-ff87-4461-8c07-2c942354b845)
*The PopopMenu is not only covered but also displayed in the wrong position.*



### Minimal reproduction project (MRP)

[issue_100192_mrp.zip](https://github.com/user-attachments/files/18059912/issue_100192_mrp.zip)