sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: next.js
Issue:  Next.js 14 build out of memory building 4746 pages (webpack loader)
Labels: bug,Output (export/standalone),Markdown (MDX)

### Link to the code that reproduces this issue

https://github.com/soyuka/nextjs-mdx-standalone-memory

### To Reproduce

Clone the above repository.
Please note that we force a low max-old-space-size to get a Memory heap profile faster but this is obviously failing at higher memory usage.

```shell
NODE_OPTIONS="--max-old-space-size=512 --inspect" next build
```

[Attached memory allocation sampling](https://github.com/vercel/next.js/files/13191187/nextjsmemfail.cpuprofile).

Tracked to [this function](https://github.com/vercel/next.js/blob/ec8ee596d00449bfd7bcc9103c0b56fbf3d4f568/packages/next/src/build/webpack/loaders/next-app-loader.ts#L225-L446), or more specifically the recursion at:

https://github.com/vercel/next.js/blob/ec8ee596d00449bfd7bcc9103c0b56fbf3d4f568/packages/next/src/build/webpack/loaders/next-app-loader.ts#L300-L301

### Current vs. Expected behavior

I was expecting MDX to be able to generate a technical documentation and it's really useful for us to put react components directly inside the Markdown. In the process we have lots of issues with memory usage as we want a "standalone" build.

We also used `dynamic imports` in the past but when preloading our pages (using `generateStaticParams`), we also end up with memory leaks there. Therefore I though that the structure `route/to/my/docs/page.mdx` but it's not working either. I suspect the `createSubtreePropsFromSegmentPath` from `next-app-loader` as it's where I see the memory stack increase.

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP PREEMPT_DYNAMIC Thu, 19 Oct 2023 22:52:14 +0000
Binaries:
  Node: 20.9.0
  npm: 10.1.0
  Yarn: N/A
  pnpm: 8.9.2
Relevant Packages:
  next: 14.0.1-canary.0
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.1.3
Next.js Config:
  output: standalone
```


### Which area(s) are affected? (Select all that apply)

MDX (@next/mdx), Standalone mode (output: "standalone")

### Additional context

We have these memory issues since the project started (right now we use markdown-it instead of mdx for most of the files to avoid a memory issue). Not even sure MDX and rehype plugins would even work if this issue gets fixed but they're unrelated to the issue here.

Attached my .heapprofile but renamed as .cpuprofile for github to upload it.

[nextjsmemfail.cpuprofile](https://github.com/vercel/next.js/files/13191187/nextjsmemfail.cpuprofile).

Is there probably a way to enable turbopack in a standalone build as it possibly solves the issue?

#57613 duplicate
Repository: godot
Issue: Godot is trying to navigate to a texture which isn't even part of the current project "Cannot navigate to 'res://...' as it has not been found in the file system error"
Labels: bug,topic:editor,needs testing,topic:import

### Godot version

4.2 beta 3 - mono

### System information

Windows 11 - Vulkan - Nvidia RTX 4070 - intel i5 13600KF

### Issue description

I started a brand new project, copied a number of gltf files in and waited until they get imported. At the end I got an unexpected error (image below), the problem is that my new project does not have any of the directories in the error, it also doesn't have the model or the texture in the working directory.
(this texture and other related files are part of my different godot project)

![image](https://github.com/godotengine/godot/assets/33526847/b7a93186-37ca-4d08-af25-80f5e6a9296b)
![image](https://github.com/godotengine/godot/assets/33526847/66700d61-ab1e-4d4b-9c01-d4ec37f01927)


### Steps to reproduce

No idea.

### Minimal reproduction project

None, really no idea how I'd even be able to make one.

EDIT: My files are all gltf, no blender files or anything else, just gltf/bin with related texture files.
Repository: godot
Issue: ResourceLoader progress is inaccurate
Labels: bug,topic:core,needs testing

### Godot version

v4.2.beta2.official [f8818f85e]

### System information

any

### Issue description

ResourceLoader.load_threaded_get_status returns inaccurate progress information. It is always below 0.5 and in some scenes, it flickers back in forth for some reason.

### Steps to reproduce

Use the following code to load a large scene.

```
func change_scene(path : String) -> void :
	var loading := true
	ResourceLoader.load_threaded_request(path, "PackedScene", false, ResourceLoader.CACHE_MODE_REPLACE)
	while loading:
		var progress : Array
		var status : ResourceLoader.ThreadLoadStatus = ResourceLoader.load_threaded_get_status(path, progress)
		match (status) :
			ResourceLoader.ThreadLoadStatus.THREAD_LOAD_IN_PROGRESS:
				#Print progress
				print(progress[0])

			ResourceLoader.ThreadLoadStatus.THREAD_LOAD_LOADED:
				loading = false
				get_tree().change_scene_to_packed(ResourceLoader.load_threaded_get(path))
				return
			_:
				print("Error while loading: " + str(status))
				loading = false
		
		await get_tree().process_frame
```

### Minimal reproduction project

n/a
Repository: create-react-app
Issue: How do you run `react-scripts test` without `react-scripts`?
Labels: needs triage

I have never had to write tests for an application that had `react-scripts` ejected AND did not use `src/` as the root folder but instead uses `static/client/`

Can you provide some help or documentation on how to set up a Jest runner for an application that was not created with CRA, has `react-scripts` ejected and uses `static/client` in place of `src/`?
Repository: flutter
Issue: Flutter Semantics sortKey order not maintined in Fuchsia accessibility bridge
Labels: engine,dependency: fuchsia,a: accessibility,platform-fuchsia,P2,team-engine,triaged-engine

Copied from internal bug b/308168442

Expected: The order set by Flutter Semantics [sortKey](https://api.flutter.dev/flutter/semantics/SemanticsSortKey-class.html) is maintained in Fuchsia.

Actual: The order set by sortKey is not maintained.

I believe the relevant changes would be needed in the accessibility bridge code in `shell/platform/fuchsia/flutter/accessibility_bridge.cc`.

This blocks accessibility work on Fuchsia devices.
Repository: pytorch
Issue: Can't access attribute of wrapper tensor subclass under torch.compile
Labels: triaged,tensor subclass,oncall: pt2,module: aotdispatch,module: pt2-dispatcher

Repro:
```py
import torch

class DiffTwoTensor(torch.Tensor):
    def __new__(
        cls,
        data: torch.Tensor,
    ):
        self = torch.Tensor._make_wrapper_subclass(
            cls,
            data.size(),
            strides=data.stride(),
            storage_offset=data.storage_offset(),
            dtype=data.dtype,
            layout=data.layout,
            requires_grad=data.requires_grad,
            device=data.device,
        )
        self._data = data
        return self

    def __tensor_flatten__(self):
        ctx = {}
        return ["_data"], ctx

    @staticmethod
    def __tensor_unflatten__(inner_tensors, metadata):
        return DiffTwoTensor(inner_tensors["_data"])

    @classmethod
    def __torch_dispatch__(cls, func, types, args, kwargs=None):
        diff_two_tensor = args[0]
        out = func(diff_two_tensor._data, *args[1:], **kwargs)
        return DiffTwoTensor(out, diff_two_tensor._scale)

    def __repr__(self):
        return f"{self._data.__repr__()}"

@torch.compile(backend="aot_eager")
def f(x):
    y = DiffTwoTensor(x)
    z = torch.ops.aten.sin(y._data)
    return z

x = torch.randn(3)
y = f(x)
assert torch.allclose(y, x.sin())
```
cc @ezyang @msaroufim @albanD @wconstab @bdhirsh @anijain2305
Repository: next.js
Issue: i18n breaks default routes for redirects/rewrites when `locale: false`
Labels: bug,Navigation

### Link to the code that reproduces this issue

https://github.com/iDVB/next.js/blob/i18n-rewrites

### To Reproduce

1. Run `i18n-routing` example on [i18n-rewrites](https://github.com/iDVB/next.js/blob/i18n-rewrites/examples/i18n-routing/next.config.js#L11-L38) branch

**rewrites tests**
2. Browse to http://127.0.0.1:3000/rewriteWithLocale `This WORKS`
3. Browse to http://127.0.0.1:3000/fr/rewriteWithLocale `This WORKS`
4. Browse to http://127.0.0.1:3000/rewriteWithoutLocale `This DOES NOT work (404)` 
5. Browse to http://127.0.0.1:3000/fr/rewriteWithoutLocale `This DOES NOT work (404)` 

**redirects tests**
5. Browse to http://127.0.0.1:3000/redirectWithLocale `This WORKS`
6. Browse to http://127.0.0.1:3000/fr/redirectWithLocale `This WORKS`
7. Browse to http://127.0.0.1:3000/redirectWithoutLocale `This DOES NOT work (404)` 
8. Browse to http://127.0.0.1:3000/fr/redirectWithoutLocale `This DOES NOT work (404)` 



### Current vs. Expected behavior

### Current
Disabling `locale` for a redirect/rewrite completely breaks that route even for the default route.

### Expected
Developers may **want** to disable locales for specific **redirects/rewrites**.
This should not disable those redirects/rewrites altogether, it should simply just disable the locale version of that route.

#### When disabled...
```javascript
  redirects: async () => {
    return [
      {
        source: '/redirectWithoutLocale',
        destination: 'https://cnn.com/business',
        permanent: false,
        locale: false,
      },
    ]
  },
```

browsing here http://127.0.0.1:3000/redirectWithoutLocale should redirect to here https://cnn.com/business
**and**
browsing here http://127.0.0.1:3000/fr/redirectWithoutLocale should 404


### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
  Github Codespaces
Binaries: 
  repo deps unchanged
```


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

Routing (next/router, next/navigation, next/link)

### Additional context

_No response_
Repository: deno
Issue: Import map defined in a Jupyter notebook?
Labels: suggestion,deno jupyter

This notebook has the langchain version repeated over and over again:

https://github.com/langchain-ai/langchainjs/blob/0332e93df848248d1b4ed00f32a9010e5c57fd71/cookbook/rewrite.ipynb

Would it be possible to define an import map somehow in a notebook so that it can then be used throughout the notebook? This would allow the notebook file to be self contained.

Otherwise, I guess the best alternative is to create a deno.json beside the notebook with an import map in it (this works today):

```json
{
  "imports": {
    "langchain": "npm:/langchain@0.0.172",
    "langchain/": "npm:/langchain@0.0.172/"
  }
}
```
Repository: go
Issue: proposal: net/url: add AppendQuery
Labels: Proposal

It's pretty easy to accidentally mutate a shared `URL` struct when trying to create a URL with query parameters:

```go
var redirectURL, _ = url.Parse("https://example.com")

func main() {
	http.ListenAndServe("", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		u := redirectURL
		q := u.Query()

		// opaque process that might fail
		token, err := getRedirectToken()
		if err != nil {
			q.Set("error", err.Error())
		} else {
			q.Set("token", token)
		}

		u.RawQuery = q.Encode()

		http.Redirect(w, r, u.String(), http.StatusFound)
	}))
}
```

APIs to help with constructing query strings and adding them to a URL — a la `(*URL) JoinPath(elems ...string) *URL` — could prevent this:

```go
func (u *URL) AppendQuery(values Values) *URL {
	q := u.Query()	
	for k, v := range values {
		q[k] = append(q[k], v...)
	}

	ret := *u
	ret.RawQuery = q.Encode()

	return &ret
}
```
Repository: flutter
Issue: Stop duplicating code across disposables.
Labels: c: new feature,framework,P1,design doc,team-framework,triaged-framework,a: leak tracking,:scroll:

We are duplicating code across disposables in order to:

 1. restrict double disposal
 2. restrict usage after disposal
 3. instrument code for leak tracking by communicating creation and disposal to MemoryAllocations.instance

Design draft: http://flutter.dev/go/introduce-disposable

When you duplicate the code again, leave TODO:

```
// TODO(polina-c): stop duplicating code across disposables
// https://github.com/flutter/flutter/issues/137435
```
Repository: go
Issue: proposal: cmd/vet: warn if cmd.Dir is set after calling cmd.Environ
Labels: Proposal

Suppose `cmd` is a `*os/exec.Command`. On platforms that uses the `PWD` environment variable (non-Windows non-Plan 9 platforms), [`cmd.Environ`](https://pkg.go.dev/os/exec#Cmd.Environ) sets `PWD` if `cmd.Dir` is set and `cmd.Env` is not already set. `cmd.Environ` has an [example](https://cs.opensource.google/go/go/+/refs/tags/go1.21.3:src/os/exec/example_test.go;l=149-150) suggests that `cmd.Dir` should be set before calling `cmd.Environ`. But this is not enforced.

`cmd.Environ` is usually used to set `cmd.Env`. If that is done before `cmd.Dir` is set, the `PWD` environment variable will not be set correctly. Many programs probably don't care about `PWD`. But for ones that do care, this may lead to subtle and surprising behavior, e.g. how symlinks are handled.

It would be nice if we can have a way to check `cmd.Dir` is set after calling `cmd.Environ`. Ideally that check only fires if `cmd.Environ` is called for setting `cmd.Env` (probably most of them are).

It would be nice if we can also handle functions wrapping `cmd.Environ`, like [`internal/testenv.CleanCmdEnv`](https://cs.opensource.google/go/go/+/master:src/internal/testenv/exec.go;l=106). Not sure how hard the implementation will be.

One downside for this is that many programs probably don't care about `PWD`, so setting `cmd.Dir` after would not lead to incorrect behavior. On the other hand, `cmd.Environ` is relatively new (added in Go 1.19), so maybe only programs that this matters use `cmd.Environ`?

This is from a [discussion on CL 535915](https://go-review.googlesource.com/c/go/+/535915/comment/a702da90_36e2140e/). cc @bcmills
Repository: pytorch
Issue: test_DistributedDataParallel fails with static_graph=True
Labels: oncall: distributed

### 🐛 Describe the bug

A distributed test:
```
WORLD_SIZE=2 BACKEND=nccl python test/distributed/test_distributed_spawn.py -k test_DistributedDataParallel
```

Fails with numerical mismatches:

```
AssertionError: Tensor-likes are not close!

Mismatched elements: 18 / 20 (90.0%)
Greatest absolute difference: 0.06887674331665039 at index (1, 0) (up to 1e-05 allowed)
Greatest relative difference: 0.462270051240921 at index (3, 1) (up to 1.3e-06 allowed)
```

Upon closer examination, it fails when either `static_graph` or `set_static_graph_twice` is set to `True`. 
https://github.com/pytorch/pytorch/blob/c120e5606ec022540bfb2d85d1194ad4782f05a4/torch/testing/_internal/distributed/distributed_test.py#L4494-L4502

### Versions

torch==2.2.0a0+git20fc2b4

cc @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @H-Huang @kwen2501 @awgu @penguinwu
Repository: godot
Issue: Calling get_tree().set_auto_accept_quit(false) has no effect in editor
Labels: topic:editor,needs testing

### Godot version

v4.1.2.stable.arch_linux

### System information

Godot v4.1.2.stable unknown - Arch Linux #1 SMP Fri, 31 Mar 2023 13:12:48 +0000 - X11 - Vulkan (Compatibility) - NVIDIA GeForce GTX 1650 (nvidia; 520.56.06) - Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz (8 Threads)

### Issue description

Calling `get_tree().set_auto_accept_quit(false)` or `get_tree().auto_accept_quit = false` does not disallow the editor from quitting.
Checking `get_tree().auto_accept_quit` shows `false` so the value changes correctly.

### Steps to reproduce

1. Make a plugin/tool script that executes:
```gdscript
get_tree().set_auto_accept_quit(false)
```
2. Try to close the editor while the plugin is running
3. The editor quits 

### Minimal reproduction project

[project.zip](https://github.com/godotengine/godot/files/13192821/project.zip)
(Look into addons)
Repository: godot
Issue: Godot crash when resizing editor windows
Labels: bug,topic:editor,needs testing,crash

### Godot version

v4.2.beta3.mono, v4.1.2.stable.mono, v4.1.1.stable.mono

### System information

Godot v4.2.beta3.mono - Windows 10.0.22621 - Vulkan (Mobile) - integrated Intel(R) UHD Graphics 730 (Intel Corporation; 31.0.101.3302) - 12th Gen Intel(R) Core(TM) i5-12400 (12 Threads)

### Issue description

I created a very simple project with a UI scene.  When I try to resize a window, it crashes Godot.  It's 100% reproducible on my system.

I am using Godot with C# however my project has no code.

### Steps to reproduce

Open the attached project.

Double-click on **ui.tscn** in the folder **ui**.   This will open a new tab.

Select the new tab.

Double-click any node in the **ui** scene, for example **Control**

Resize any editor window.  Resize using the left or right edge of any editor window until Godot crashes.  It should crash almost immediately.


### Minimal reproduction project


[TestPrj.zip](https://github.com/godotengine/godot/files/13193345/TestPrj.zip)
Repository: TypeScript
Issue: Safe type assertion operator
Labels: Suggestion,Awaiting More Feedback

### 🔍 Search Terms

as, satisfies, type assertion, type casting

### ✅ Viability Checklist

- [X] This wouldn't be a breaking change in existing TypeScript/JavaScript code
- [X] This wouldn't change the runtime behavior of existing JavaScript code
- [X] This could be implemented without emitting different JS based on the types of the expressions
- [X] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- [X] This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals

### ⭐ Suggestion

I suggest adding a safe type assertion operator, a kind of middle ground between current `as` and `satisfies`.

- Like `as`, it should cast the expression to the asserted type
- Like `satisfies`, it should only allow assertion if the asserted type is wider than the expression type

Here's what it might look like:

```ts
type Foo = { a: number }

const foo1 = { a: 1 } as! Foo // OK. foo1: Foo

const foo2 = { a: 1, b: 2 } as! Foo // OK, foo2: Foo

const foo3 = { b: 2 } as! Foo // Error, { b: number } is not assignable to Foo

const foo4 = { } as! Foo // Error, {} is not assignable to Foo
```


### 📃 Motivating Example

For example, such operator will allow to safely give named types to expressions without declaring extra variables or helper functions.

Consider an async function `f` that returns an object of type `Foo`:

```ts
type Foo = { a: number }

const f = async () => ({ a: 1 })
```

I want the returned object to strictly be of `Foo` type, how do I enforce this?

1) Hard code the return type

```ts
const f = async (): Promise<Foo> => ({ a: 1 })
```

The problem here is that I must write `Promise<Foo>` instead of just `Foo`, but the `Promise` part can be inferred just fine. In real world these generics can be arbitrarily complex.

2) Declare a variable

```ts
const f = async () => {
  const result: Foo = { a: 1 }

  return result
}
```

This is better than retyping generics but still pretty verbose.

3) Use a helper function

```ts
const safeAssert = <T>(value: T): T => value

const f = async () => safeAssert<Foo>({ a: 1 })
```

This is ok but still requires writing/importing helper functions.

`as` is not an option here because it's unsafe, `satisfies` is neither because it doesn't name the type. Naming a type can be important for documentation purposes, this proposal allows to do this with less boilerplate.

```ts
const f = async () => ({ a: 1}) as! Foo // f: () => Promise<Foo>
```


### 💻 Use Cases

As described above, this feature can be used to safely cast expressions to specified types. A practical example when it can be useful is naming a type in an expression. Currently this is only covered by custom helper functions such as `<T>(value: T): T => value`.
Repository: flutter
Issue: [Impeller] Usage of framebuffer fetch has unnecessary render to texture.
Labels: P3,e: impeller,team-engine,triaged-engine

To render advanced blends, even with framebuffer fetch enabled we unconditionally do a render to texture on the contents and then use a framebuffer fetch advanced blend shader with the resulting texture.

This is better than a backdrop filter but still slower than if we drew the original contents (solid color, text) with blending applied in the shader.

Unfortunately today doing so would add (# of color sources) * (number of advanced blends) additional shaders. We should investigate if static shader variants via specailzation constants (https://github.com/flutter/flutter/issues/119357) could allow us to include more shaders without both 1) increasing bundle size and 2) re-introducing shader jank.
Repository: godot
Issue: non y sorted Tilemap layer will show on top of y sorted layer
Labels: bug,topic:rendering,topic:2d

### Godot version

4.0.4 , 4.1.2, 4.2b3

### System information

Windows 10

### Issue description

Hello Guys
when trying to avoid enabling y sort on layer 0 / floor in the tilemap , I faced the below issue:
a tilemap that an artist I hired made for me , she put the origin point of the tilemap node at (0,0) but started drawing in all directions (0+-, 0+-). and I faced an issue turning on Y sort , specifically for tile that were drawn anything above the origin point (0-, 0-) , where sprites in a specific layer (which has y sort enabled) they will be drawn under the tilemap its self (or under Layer 0 / non y sorted layer) 😭 .

The only solution I was able to think of is to drag all the tiles to the region under (0+,0+) , but it was impossible to do due to the size of the tile map and because it has so many layers (i can only drag on layer at a time).

Because otherwise , when I enable y sort on layer 0 , I have to adjust the origin point for all other tile to be below origin point of floor tiles which is pain and will not allow me to add common gameplay scenario (ex : show player behind , in front of tree tiles).

I will attach two gifs to explain , please help😊


https://github.com/godotengine/godot/assets/18246137/1b58b889-794b-4dc9-a0d9-cdacec515526



### Steps to reproduce

you can draw tiles on the tile map above the origin points , then enable y sort on the tilemap node and the specific layer your tiles on.

### Minimal reproduction project

[Tilemap_Issue.zip](https://github.com/godotengine/godot/files/13193770/Tilemap_Issue.zip)