sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: create-react-app
Issue: output.globalObject set to this is undefined when "use strict" #8608
Labels: needs triage,issue: bug report

### Describe the bug
#7742 by @kentcdodds changed the webpack config for output.globalObject to be this instead of webpack's default window, so that webpack chunk loading would work in Workers.

Unfortunately, making the assumption that this is the global object isn't always safe because if the code is concatenated or otherwise wrapped into code that has "use strict" strict mode will also apply to inner functions within that scope, and this will be undefined in some cases, most notably in the webpack runtime chunk/code since itself contains code that executes inside of an IIFE and so this === undefined

I admit, this is very much an edge case and outside the normal usage of CRA. But if there's a fairly trivial way for us to solve this, it would notably help my use case because I cannot control the code provided to me--I would have to no longer support users who use CRA unless they ejected so that they could change that webpack config option. That's not your problem of course lol just clarifying why I'm checking in.

Wanted to at least open the dialog and see if someone had thoughts on a simple solution?

Did you try recovering your dependencies?
n/a

Which terms did you search for in User Guide?
globalObject, runtime, webpack, etc.

### Environment
n/a

Steps to reproduce
Build a CRA project
Concatenate one or more of the chunks together, with the runtime.
Put "use strict" at the the top of the code.
Run the code in any supported JS env.
See error of this being undefined due to strict mode.
Expected behavior
Something other than this is used. I'm not immediately sure, since globalThis isn't supported in IE (which CRA supports) and forcing folks to include a polyfill is presumably off the table.

### Actual behavior
TypeError: Cannot read property 'webpackJsonpsomeproject' of undefined because this is undefined under strict mode.

Reproducible demo
Non-trivial to provide, but if required I can consider making one. I think those who are familiar with how CRA + webpack builds work will likely know immediately what I'm referring to, but maybe not hehe 😄
Repository: pytorch
Issue: multi scripted model on the same gpu on multi gpu machine
Labels: needs reproduction,module: multi-gpu,triaged

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->
multi scripted model on the same GPU on of a multi GPU machine
## To Reproduce

Steps to reproduce the behavior:

1. get 2 scripted models with different architecture
1.load 2 of each on cuda:3
1.run
it will crash

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->

## Environment

Please copy and paste the output from our
[environment collection script](https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py)
(or fill out the checklist below manually).

You can get the script and run it with:
```
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py
```

 - PyTorch Version (e.g., 1.0):
 - OS (e.g., Linux): linux
 - How you installed PyTorch (`conda`, `pip`, source): pip
 - Build command you used (if compiling from source):
 - Python version: 3.6.9
 - CUDA/cuDNN version:10.2
 - GPU models and configuration:
 - Any other relevant information:

## Additional context

<!-- Add any other context about the problem here. -->
Repository: pytorch
Issue: Example code for is_storage missing
Labels: module: docs,triaged

## 📚 Documentation

I found no example for below function,i would like to  contribute example for below  function
Can raise the PR for below 

def is_storage(obj):
    r"""Returns True if `obj` is a PyTorch storage object.
    Args:
        obj (Object): Object to test
    """
    return type(obj) in _storage_classes


cc @brianjo @mruberry
Repository: pytorch
Issue: what():  result type Float can't be cast to the desired output type Long
Labels: needs reproduction,module: cpp,triaged

core dump when I use  torch::hann_window(400)  in libtorch

![微信图片_20210608195009](https://user-images.githubusercontent.com/53263206/121179915-ce7cd500-c892-11eb-935e-db6954a23604.png)



cc @yf225 @glaringlee
Repository: pytorch
Issue: Potentially misleading note in documentation for PackedSequence
Labels: module: docs,module: nn,module: rnn,triaged,module: nestedtensor

## Issue

The notes for the `PackedSequence` class 
[https://pytorch.org/docs/stable/generated/torch.nn.utils.rnn.PackedSequence.html#torch.nn.utils.rnn.PackedSequence](https://pytorch.org/docs/stable/generated/torch.nn.utils.rnn.PackedSequence.html#torch.nn.utils.rnn.PackedSequence) state

> Instances of this class should never be created manually. They are meant to be instantiated by functions like pack_padded_sequence().

It seems however that there are instances where creating them manually is (I think) unavoidable. For example I have a use case in RL where I am passing variable length sequences of images through a conv net and then passing the output to an LSTM layer. The easiest thing to do here is to pack the padded sequences of input images with `pack_padded_sequence` and then pass the `.data` field of the resulting `PackedSequence` through the conv net before reconstituting a `PackedSequence` with the output of the conv net and passing that as an argument to the recurrent layer. Indeed this is a technique recommended in other issues and the forums. For example in [https://github.com/pytorch/pytorch/issues/25310](https://github.com/pytorch/pytorch/issues/25310) @andreaskoepf elegantly suggests creating a function such as
```
def squash_packed(x, fn=torch.tanh):
    return torch.nn.utils.rnn.PackedSequence(fn(x.data), x.batch_sizes, 
                 x.sorted_indices, x.unsorted_indices)
```
to map the first `PackedSequence` to the second by applying a given function. The critical thing is that the `.batch_sizes, .sorted_indices` and `.unsorted_indices` fields from the original `PackedSequence` output by `pack_padded_sequence` must be preserved and used when manually creating the new one. Given the instruction not to create them manually in the note I struggled for a while to work out how to do this.

## Suggested documentation revision

Remove the stipulation that `PackedSequences` "should never be created manually" and instead include something like the above with caveats on how to do it safely.

## Possible enhancement suggestion

Add a mapping function such as the above to the `PackedSequence` class to abstract the details away from the user in case there are any other potential pitfalls to be avoided.



cc @svekars @holly1238 @albanD @mruberry @jbschlosser @walterddr @kshitij12345 @saketh-are @zou3519 @cpuhrsch @bhosmer @brianjo
Repository: create-react-app
Issue: play.js - ReferenceError: WebAssembly is not defined
Labels: needs triage

Hello,

a few weeks ago I downloaded the [play.js](https://apps.apple.com/de/app/play-js-javascript-ide/id1423330822) app on my ipad. With this app I should be able to create node projects. There are already some templates to use for react (uses webpack directly), vue, angular and react native. I am a big fan of `create-react-app`. So I tried to clone some of my projects, installed the dependencies and tried to start in dev mode. But Its not working, because I got an error: `ReferenceError: WebAssembly is not defined`. So I searched through the internet for some solution, but I coulndn't find anything related to that. Then I decided to message the play.js team via [email](mailto:hello@codesandbox.io) which I found on the playjs support page. Now weeks have passed and I have not yet received an answer. But there is a new update with which I also tested out and I get the same error.

![image](https://user-images.githubusercontent.com/60048565/121187082-f86cd200-c867-11eb-88ef-43492a38f235.png)
I also made an [video](https://drive.google.com/file/d/1IO6xjkKPxkmHG2xuJKBvz9hPvgOYwdeg/view?usp=drive_web) how I run into this issue. 

Steps to reproduce.
1. download [play.js](https://apps.apple.com/de/app/play-js-javascript-ide/id1423330822) app on an apple device
1. create a project and choose `https://github.com/luwol03/empty-react-project.git` as git repository.
2. resolve the dependencies.
3. start the app.
4. open the browser.
5. see error.

I hope I can get help here.
Have a nice day.

luwol03
Repository: create-react-app
Issue: Regular Expression Denial of Service (ReDoS) vulnerability in the glob-parent.
Labels: needs triage,issue: bug report

There is a Regular Expression Denial of Service (ReDoS) vulnerability in the glob-parent dependency.

This is the dependency tree:
 -  devDependencies (optional): react-scripts>webpack>watchpack>watchpack-chokidar2>chokidar>glob-parent
 -  devDependencies: react-scripts>webpack-dev-server>chokidar>glob-parent

The vulnerability has been fixed in glob-parent version >5.1.2
Repository: angular
Issue: QueryList not sorted according to the actual state
Labels: area: core,core: queries,P3

# Bug Report

### Affected Package
This issue is caused by  package `@angular/core`.

### Is this a regression?
Not my case.

### Description
I display a list of components via `* ngFor` and query them with` ViewChildren`.
The list can be reordered (from the data), visually it's ok, the `QueryList` triggers` changes` (it's ok too), but the list in the `QueryList` is not sorted, is the same as at the beginning.

I found the cause, each component is encapsulated in an `ng-template` in the` * ngFor`. If I make my components direct children of the `* ngFor`, it works. 

I made a minimal reproduction with a sorted list `1, 2, 3, 4`, I reorganized` 3, 4, 1, 2` but in the `QueryList` it is still` 1, 2, 3, 4` .


## Minimal Reproduction
https://ng-run.com/edit/B0RMoh8QgGE9Syf3GBSf?open=app%2Fapp.component.ts&layout=1


## Exception or Error
None.


## Your Environment

**Angular Version:**
<pre><code>
Angular CLI: 11.2.13
Node: 14.15.4
OS: win32 x64

Angular: 11.2.14
... animations, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.13
@angular-devkit/build-angular   0.1102.13
@angular-devkit/core            11.2.13
@angular-devkit/schematics      11.2.13
@angular/cdk                    11.2.13
@angular/cli                    11.2.13
@angular/flex-layout            11.0.0-beta.33
@schematics/angular             11.2.13
@schematics/update              0.1102.13
rxjs                            6.6.3
typescript                      4.0.3
</code></pre>

**Anything else relevant?**
Nothing.
Repository: next.js
Issue: [i18n] Domain Routing: Only default locale domain should trigger automatic locale detection
Labels: Internationalization (i18n)

### What version of Next.js are you using?

10.2.3

### What version of Node.js are you using?

14

### What browser are you using?

All of them

### What operating system are you using?

macOS

### How are you deploying your application?

Other platform

### Describe the Bug

When I link from the index page to another locale with `<Link href="/" locale="fr">` and I'm using domain-based i18n routing, I always get redirected back to the default locale's domain.

E.g. linking from foo.com to fr.foo.com does not work and I end up on foo.com again.

Or when I access fr.foo.com directly, I get redirected to foo.com.

This does not happen with sub-path routing.

I assume this is because of [automatic locale detection](https://nextjs.org/docs/advanced-features/i18n-routing#automatic-locale-detection) and that all domains without sub-path are always (incorrectly) treated as "/" thus triggering it.

### Expected Behavior

To be consistent with how sub-path routing works, locale redirects should only be triggered on the domain **that matches the default locale**.

E.g. if my Accept-Language is `fr`

Sub-path routing:
- / -> will redirect to /fr
- /it -> will NOT redirect to /fr

Domain routing:
- foo.com -> will redirect to fr.foo.com
- it.foo.com -> should NOT redirect to fr.foo.com

### To Reproduce

Sorry, I can't add a repro at this point because it's tedious to set up with different domains.
Repository: TypeScript
Issue: Type `[x, x]` is not assignable to type `x[] & { length: 2; }`
Labels: Suggestion,In Discussion

# Bug Report

This error is probably self-explanatory. Either this is supposed to work and it’s a bug, or I’m misunderstanding something in which case please feel free to close.

```
Type '(Record<string, any> | null)[] & { length: 2; }' is not assignable to type '[Record<string, any> | null, Record<string, any> | null]'.ts(2322)
```

Outer function is typed to return the latter. It calls an inner function, typed to return the former. One would assume this should work.

Possibly related: #44309

### 🔎 Search Terms

array literal length

### 🕗 Version & Regression Information

TypeScript 4.1.3

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
async function readObjectVersions
<L extends number, C extends string[] & { length: L }>
(objectPath: string, versions: C):
Promise<(Record<string, any> | null)[] & { length: L }> {
  return versions.map(version => ({ foo: 'bar' }));
}

const version1: string = 'x';
const version2: string = 'y';

async function _readObjectVersions(objectPath: string):
Promise<[ Record<string, any> | null, Record<string, any> | null ]> {
  return await readObjectVersions(objectPath, [version1, version2]);
}

_readObjectVersions('abc');
```

### 🙁 Actual behavior

The error as described above.

### 🙂 Expected behavior

No type error.
Repository: material-ui
Issue: [system] Passing incompatible `grey` color to palette does not throw
Labels: new feature,package: system

<!-- Provide a general summary of the issue in the Title above -->

**This issue exists in alpha.36**

<!--
  Thank you very much for contributing to Material-UI by creating an issue! ❤️
  To avoid duplicate issues we ask you to check off the following list.
-->

<!-- Checked checkbox should look like this: [x] -->

- [x] The issue is present in the latest release.
- [x] I have searched the [issues](https://github.com/mui-org/material-ui/issues) of this repository and believe that this is not a duplicate.

## Current Behavior 😯

<!-- Describe what happens instead of the expected behavior. -->
When creating a custom Chip variant+color combination, I see an error in the JavaScript console that throws an exception. Note that custom variant props work, but not color.

## Expected Behavior 🤔

<!-- Describe what should happen. -->
I should be able to customize both the variant and colour of a Chip.

## Steps to Reproduce 🕹

https://codesandbox.io/s/mui-chip-error-1vntn?file=/src/index.js
<!--
  Provide a link to a live example (you can use codesandbox.io) and an unambiguous set of steps to reproduce this bug.
  Include code to reproduce, if relevant (which it most likely is).

  You should use the official codesandbox template as a starting point: https://material-ui.com/r/issue-template-next

  If you have an issue concerning TypeScript please start from this TypeScript playground: https://material-ui.com/r/ts-issue-template

  Issues without some form of live example have a longer response time.
-->

Steps:

1.
2.
3.
4.

## Context 🔦

<!--
  What are you trying to accomplish? How has this issue affected you?
  Providing context helps us come up with a solution that is most useful in the real world.
-->

I started receiving this error message after upgrading from alpha.24 to alpha.36

## Your Environment 🌎

<!--
  Run `npx @material-ui/envinfo` and post the results.
  If you encounter issues with TypeScript please include the used tsconfig.
-->
<details>
  <summary>`npx @material-ui/envinfo`</summary>
  
```
  Don't forget to mention which browser you used.
  Output from `npx @material-ui/envinfo` goes here.
```
</details>
Repository: PowerToys
Issue: [Run-Plugin] [Unit Convertor] Enable localized conversions
Labels: Issue-Bug,Area-Localization,Priority-2,Run-Plugin

### Provide a description of the new feature / enhancement

Right now we have to use English abbreviations for values to use Unit Converter. Use abbreviations depending on current culture.
Repository: godot
Issue: Error setting index on variable in @onready var'd node with a custom class when running inside the editor
Labels: bug,topic:gdscript

### Godot version

4.0.dev (006cb7def4918ec61df8bfb7d5e672eb8ee71258)

### System information

Windows 10

### Issue description

I create a main control plugin like I would on 3.x and the scene has an error when accessing one of the child nodes, it's as if the property never existed.

In my case the error is:

```
SCRIPT ERROR: Invalid set index 'test' (on base: 'Sprite2D (TestThing)') with value of type 'int'.
          at: _ready (res://addons/test_plugin/TestScene.gd:8)
```

The same code works when running the scene independently (aka F6ing it)

### Steps to reproduce

Load the MRP and toggle on and off the test plugin, a strange error will be output into the console.

### Minimal reproduction project

[EditorInstanceBug.zip](https://github.com/godotengine/godot/files/6618099/EditorInstanceBug.zip)
Repository: youtube-dl
Issue: Add support for chaturbate mirror sites
Labels: site-support-request

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2021.06.06. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser.
- Make sure that site you are requesting is not dedicated to copyright infringement, see https://yt-dl.org/copyright-infringement. youtube-dl does not support such sites. In order for site support request to be accepted all provided example URLs should not violate any copyrights.
- Search the bugtracker for similar site support requests: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm reporting a new site support request
- [x] I've verified that I'm running youtube-dl version **2021.06.06**
- [x] I've checked that all provided URLs are alive and playable in a browser
- [x] I've checked that none of provided URLs violate any copyrights
- [x] I've searched the bugtracker for similar site support requests including closed ones


## Example URLs

<!--
Provide all kinds of example URLs support for which should be included. Replace following example URLs by yours.
-->

- https://www.interzet.org/andy_bjorn/
- https://www.webmodels.live/damien_diamond/


## Description

<!--
Provide any additional information.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

Where I live, chaturbate is blocked by government request, but its mirrors (interzet.org, webmodels.live and others) work fine. I suggest adding support for these sites as a way to download CB streams without having to use VPN.
Repository: flutter
Issue: Add plugin tooling to enforce documentation of minimum supported OS versions
Labels: team,p: tooling,d: api docs,package,team-ecosystem,P3,triaged-ecosystem

Currently we don't document what the minimum OS version of our plugins is, for any platform. On iOS, it's mostly a non-issue at the moment since like Flutter they all support iOS 8 (at build time at least; camera doesn't mostly work before iOS 10), but there's no guarantee of that being true in general; on Android it's already a build-time issue (https://github.com/flutter/flutter/issues/34999).

The risk of such documentation is of course that it isn't the source of truth, so could become outdated. We should
- [x] Design a standard format we use to document this in all of our READMEs (extensible to all platforms)
  - This format should have both an easily parsed version for the step below, but also a place for general notes like ("functionality X requires a higher minimum version Y")
- [x] Add it to all our plugin READMEs
- [ ] Add tooling support to detect that plugins have that entry, and wherever possible enforce that it is no lower than the source of truth (as we do with CHANGELOG and pubspec.yaml versions, for instance):
  - iOS/macOS: `s.platform` in the podspec
  - Android: `minSdkVersion` in build.gradle
  - Windows: I don't know that there's a formal way to express this in the build
  - Linux: There's not really a good way of expressing this; the build requirements are in the form of library versions

The check needs to be "no lower" rather than "equal" so that we have the ability to express things like the current iOS camera plugin situation, where we may want to allow the plugin to build in projects that target older iOS versions, but not work at runtime.