sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: create-react-app
Issue: Error: Service worker has an unsupported MIME type ('text/html')
Labels: needs triage,issue: bug report

### Describe the bug
Using the create-react-app-typescript-pwa template to generate a progressive web app returns the following error when `serviceWorker.register() is called:

```
index.js:1 Error during service worker registration: DOMException: Failed to register a ServiceWorker for scope ('http://localhost:3000/') with script ('http://localhost:3000/serviceWorker.js'): The script has an unsupported MIME type ('text/html').
```

- I'm only able to see the error message after I remove the following condition in the `checkValidServiceWorker()` function in `./src/serviceWorkerRegistration.ts`:

```
if (
        response.status === 404 ||
        (contentType != null && contentType.indexOf('javascript') === -1)
      ) {
```

### Did you try recovering your dependencies?
Yes

  Please paste the output of `npm --version` and/or `yarn --version` to confirm.
-->

7.6.1

### Which terms did you search for in User Guide?
PWA, TypeScript, Workbox, Service worker

### Environment
current version of create-react-app: 4.0.3
System:
    OS: Windows 10 10.0.17763

### Steps to reproduce
 - Run `npx create-react-app my-app --template cra-template-pwa-typescript`
 - modify `serviceWorker.unregister()` to `serviceWorker.register()`

### Expected behavior
- Service worker should be registered

### Actual behavior
Service worker not registered
Repository: rust
Issue: the trait `for<'r> FnMut<(&'r char,)>` is not implemented for `char`
Labels: A-diagnostics,T-compiler

I was aplitting a vector and when I tried to debug print it.
It resulted in an error:

My Code:
```
let splitted_vec = be.splitn(2, '-');
            for i in splitted_vec {
                println!("{:?}",i);
}
```


The error:

```
let splitted_vec = be.splitn(2, '-');
   |                                             ^^^ expected an `FnMut<(&char,)>` closure, found `char`
   |
   = help: the trait `for<'r> FnMut<(&'r char,)>` is not implemented for `char`


```

My program is the answer for advenofcode day two, and i am still working on it.
I want the program as simple as possible because I kind of have to present it to someone.
Repository: pytorch
Issue: Show methods of the class in the right sidebar
Labels: module: docs,triaged

## 📚 Documentation
It would be easy to navigate/scan through the documentation for the classes if the available methods are shown in the right sidebar.
Current nn.Module docs: available methods are not shown in the right sidebar

![Screen Shot 2021-03-07 at 22 22 59](https://user-images.githubusercontent.com/32727188/110246530-58688980-7f96-11eb-812e-ac2106d8fd55.png)

tf.keras.Model docs: available methods are shown, easy to navigate, no need to search

![Screen Shot 2021-03-07 at 22 28 37](https://user-images.githubusercontent.com/32727188/110246595-9665ad80-7f96-11eb-8045-8bf19af98893.png)

---

Currently workaround would be adding respective methods title and using `.. automethod::` but this is intense for classes which have many methods.

Tensorflow is using its own custom made docs generator AFAIK so not sure how it's done.

So just bringing up a ticket if someone has an idea for that.

Thanks!

cc @brianjo @mruberry
Repository: go
Issue: net/http: better error detection to allow at-most-once sending for an HTTP request
Labels: NeedsDecision,FeatureRequest

Say I am making a request to a HTTP server that will send an email, charge a credit card or send a SMS to a user's phone.<sup>1</sup> It would be bad to do those things multiple times so I would like to try once, and then stop if the request had any chance at succeeding. 

If you think of an HTTP request as three steps:

- Connect
- Write headers and request data
- Read data

The request can fail at any step. The safest thing to do, if you wanted to avoid sending multiple SMS messages, would be to just abort on any error.

```go
req, err := http.Post("https://smsservice.com/...")
if err != nil {
    return err
}
```

There are some cases where we know it's safe to retry though. If we try to connect to a server and we get back `connection refused`, for example, it's safe to retry. If we get a DNS error we haven't sent any data and can retry. Generally, if it fails at the connect step, or before I have written the whole request, I can assume that it's safe to retry. Once I've written some data to the socket, I have to assume the server received it and started processing, even if I don't get any response back. 

The current error handling exposed by the Go library don't do a good job of exposing this abstraction. `Temporary()` returns true in the case of all timeouts, but I can only retry if the timeout occurred on the connect or before the full write. That means it would be possible to send data to a misbehaving server, get Temporary() = true back, try the request again, and end up sending 2 SMS's to someone's phone. 

Today, what you have to do if you want to do this right is a lot of digging into the different types of errors that can be returned into the syscall or HTTP request phase represented by the error, and then make a decision based on that.

It would be nice to have some new API designed to help make that easier. Maybe 

```go
// IsBeforeWrite returns true if an error occurred before any data was sent to the remote socket. 
// These errors indicate that the request can be safely retried, since no data was sent.
func IsBeforeWrite(err error) bool { ... }
```

in the golang.org/x/net/netutil package? 

The advantage is, if you do this right, you can use it for any socket abstraction, for example, database reads and writes.

<sup>1</sup> I am sure Google has great tools for this, but outside of Google, you generally accomplish these by making a HTTP request to a third party, for example Sendgrid, Stripe, or Twilio. Sometimes these services have tools to allow idempotent retry of a failed request - ie, they have internal tracking of whether a given message was sent or not, but most of the time they don't.
Repository: rust
Issue: Account for incorrect `cfg` in fn argument types
Labels: C-enhancement,A-attributes,A-diagnostics,A-parser,T-compiler,D-newcomer-roadblock

[Given the following code](): <!-- Please provide a link to play.rust-lang.org -->

```rust
fn foo(a: #[cfg(feature = "x32")] u32 #[cfg(feature = "x64")] u64) {}
```

The current output is:

```
error: attributes cannot be applied to a function parameter's type
 --> src/lib.rs:1:11
  |
1 | fn foo(a: #[cfg(feature = "x32")] u32 #[cfg(feature = "x64")] u64) {}
  |           ^^^^^^^^^^^^^^^^^^^^^^^ attributes are not allowed here

error: expected one of `:`, `@`, or `|`, found `)`
 --> src/lib.rs:1:66
  |
1 | fn foo(a: #[cfg(feature = "x32")] u32 #[cfg(feature = "x64")] u64) {}
  |                                                                  ^ expected one of `:`, `@`, or `|`
  |
  = note: anonymous parameters are removed in the 2018 edition (see RFC 1685)
help: if this is a parameter name, give it a type
  |
1 | fn foo(a: #[cfg(feature = "x32")] u32 #[cfg(feature = "x64")] u64: TypeName) {}
  |                                                               ^^^^^^^^^^^^^
help: if this is a type, explicitly ignore the parameter name
  |
1 | fn foo(a: #[cfg(feature = "x32")] u32 #[cfg(feature = "x64")] _: u64) {}
  |                                                               ^^^^^^

error: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `#`
 --> src/lib.rs:1:39
  |
1 | fn foo(a: #[cfg(feature = "x32")] u32 #[cfg(feature = "x64")] u64) {}
  |                                      -^ expected one of 7 possible tokens
  |                                      |
  |                                      help: missing `,`

error: aborting due to 3 previous errors
```

Ideally the output should look like:

```
error: attributes cannot be applied to a function parameter's type
 --> src/lib.rs:1:11
  |
1 | fn foo(a: #[cfg(feature = "x32")] u32 #[cfg(feature = "x64")] u64) {}
  |           ^^^^^^^^^^^^^^^^^^^^^^^     ^^^^^^^^^^^^^^^^^^^^^^^ attributes are not allowed here
  |           |
  |           attributes are not allowed here
  |
help: you can instead introduce a type alias
  |
  | #[cfg(feature = "x32")]
  | type Alias = u32;
  | #[cfg(feature = "x64")]
  | type Alias = u64;
  | fn foo(a: Alias) {}
  |
help: alternatively, you can use the `cfg` attribute on the argument
  |
1 | fn foo(#[cfg(feature = "x32")] a: u32, #[cfg(feature = "x64")] a: u64) {}
  |        ^^^^^^^^^^^^^^^^^^^^^^^   --  ^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^--
```

_Case taken from https://kevinlynagh.com/rust-zig/_
Repository: go
Issue: x/sys/windows: add HeapAlloc and related functions
Labels: OS-Windows,NeedsDecision,FeatureRequest,compiler/runtime

x/sys/windows has LocalAlloc and VirtualAlloc, but not HeapAlloc. HeapAlloc is generally recommended over using LocalAlloc and should be used when you're allocating memory that's not page sized. 

Would necessitate HeapCreate and HeapFree.
Repository: rust
Issue: Imprecise visibility error message
Labels: A-diagnostics,A-visibility,T-compiler,D-terse

When an associated function is declared as `pub(crate)` and attempt is made to call it from outside of the crate, the error message is 

```
error[E0624]: associated function `new` is private
 --> src/bin/tool/main.rs:4:39
  |
4 |     let c = rust_scratchpad::Cluster::new();
  |                                       ^^^ private associated function
```

Notice that error says that function is `private` when in fact it is `pub(crate)`. Compiler makes conclusion, that from outside of crate it is as good as `private` but does not spell this logical step.
In big project with complex exporting this skipped explanation can add to confusion.

If function is not associated, then error message is still the same, but attempt to reexport is supplemented with useful tip `note: consider marking `f` as `pub` in the imported module`:

```
error[E0364]: `f` is private, and cannot be re-exported
  --> src/lib.rs:11:9
   |
11 | pub use self::cluster::f;
   |         ^^^^^^^^^^^^^^^^
   |
note: consider marking `f` as `pub` in the imported module
  --> src/lib.rs:11:9
   |
11 | pub use self::cluster::f;
   |         ^^^^^^^^^^^^^^^^

```

`src/lib.rs`
```rust
mod cluster {
    pub struct Cluster{}
    impl Cluster {
        pub(crate) fn new() -> Self {unimplemented!()}
    }

    pub(crate) fn f() {}
}

pub use self::cluster::Cluster;
// pub use self::cluster::f;
```

`bin/tool/main.rs`
```rust
use rust_scratchpad;

fn test1() {
    let c = rust_scratchpad::Cluster::new();
}

fn main() {}
```

It would be nice to have more precise error message which quote visibility problem as-is, or even better, explain that crate `pub(crate) of crate B is private from crate A point of view`.
Repository: vscode
Issue: Can’t debug VS Code extensions on iPadOS PWA
Labels: upstream,debug,ios-ipados

<!-- ⚠️⚠️ 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. -->
- VS Code Version: Codespaces
- OS Version: iPadOS 14.4

Steps to Reproduce:

1. Open a VS Code extension on Codespaces
2. Build the extension
3. Open the Debug panel and click the Start/Play button
4. The debugging starts and you see the debug toolbar, but no [Development ...] window/tab appears.

> Tested opening Codespaces directly from Safari browser and via PWA (Add to Home Screen). Same issue.

<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

Originally reported in #107386, which was closed as fixed, even tho I didn’t have success verifying myself back then. So, I suppose it’s probably a regression in recent releases.

Thank you

<!-- 🪓 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 direct to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
Repository: flutter
Issue: Custom (non gregorian) calendar in showDatePicker 
Labels: framework,f: material design,f: date/time picker,a: internationalization,dependency: dart,c: proposal,team-design,triaged-design

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill out the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Use case
There are many calendar systems besides for common Gregorian. For example, there is the [Jewish Calendar](https://www.chabad.org/library/article_cdo/aid/526874/jewish/The-Jewish-Month.htm), which is a lunar calendar, but extra months are added (according to a fixed mathematical system) to make it more or less end up matching the solar calendar.

I would like to allow users to select a date on the Jewish calendar, which is easier for users because the holidays are according to that calendar.

It would be great if the date picker wasn't hard coded to use gregorian, and could be configured to use other calendar systems.

<!--
     Please tell us the problem you are running into that led to you wanting
     a new feature.

     Is your feature request related to a problem? Please give a clear and
     concise description of what the problem is.

     Describe the alternative solutions you've considered. Is there a package
     on pub.dev/flutter that already solves this?
-->

## Proposal
I am by no means a calendar expert. For inspiration, angular material [date picker](https://material.angular.io/components/datepicker/overview#choosing-a-date-implementation-and-date-format-settings) has been calendar agnostic for some time now.

In C#, the one and only John Skeet supports many [calendars](https://nodatime.org/2.1.x/api/NodaTime.CalendarSystem.html#NodaTime_CalendarSystem_GetHebrewCalendar_NodaTime_Calendars_HebrewMonthNumbering_) in noda time

Perhaps is this something which should be handled in dart first?

[This](https://www.jewfaq.org/calendr2.htm) looks like a good rundown of how the Jewish calendar is calculated, but really my intent with this issue is more about the general methods by which support could be added for any calendar system, not so much that support for a particular calendar system be added (although that would be great!)
<!--
     Briefly but precisely describe what you would like Flutter to be able to do.

     Consider attaching images showing what you are imagining.

     Does this have to be provided by Flutter directly, or can it be provided
     by a package on pub.dev/flutter? If so, maybe consider implementing and
     publishing such a package rather than filing a bug.
-->
Repository: godot
Issue: Signal cannot be attached to plugin node
Labels: bug,topic:editor,topic:plugin

**Godot version:**
<img width="500" alt="Screenshot 2021-03-07 at 23 55 58" src="https://user-images.githubusercontent.com/100964/110254539-aaaea800-7fa0-11eb-8e7b-118d4f5201a6.png">


**OS/device including version:**
<img width="500" alt="Screenshot 2021-03-07 at 23 56 15" src="https://user-images.githubusercontent.com/100964/110254547-b4d0a680-7fa0-11eb-85be-a770db81fbfb.png">

**Issue description:**

When using a custom plugin node, signals cannot be addressed as inbound to that script, as seen in the screenshot below, the plugin node is greyed out, and cannot be selected.

<img width="500" alt="Screenshot 2021-03-07 at 23 57 11" src="https://user-images.githubusercontent.com/100964/110254581-d7fb5600-7fa0-11eb-83e2-fed0b604739c.png">


**Steps to reproduce:**
1. Create an EditorPlugin, which adds a custom type (`add_custom_type`)
2. Create an instance of that custom node type
3. Try to address a signal to that node

**Minimal reproduction project:**
https://github.com/tavurth/godot-signal-bug

**Workarounds**
You can add the signal as normal if you double click on the node (which is greyed out)
Repository: godot
Issue: Seemingly Unpredictable Mono Editor Crash
Labels: bug,topic:editor,needs testing,topic:dotnet,crash

**Godot version:**
3.2.4.rc3


**OS/device including version:**
OS: Manjaro Linux x86_64
Kernel: 5.9.16-1-MANJARO
CPU: AMD Ryzen 7 1700X (16) @ 3.400GHz
GPU: AMD ATI Radeon RX 5600 XT


**Issue description:**
When working in the editor with a C# Mono project, there are occasional editor crashes with my current codebase. I grabbed the Mono output log from the terminal and it is attached here: 
[monolog.txt](https://github.com/godotengine/godot/files/6098101/monolog.txt)

I had a look through the stack-trace and compared it to the symbols in the codebase and it seems like it's coming from `GDMonoClass::get_nesting_class`. If I had to guess, the editor isn't liking me using nested classes that extend from the Godot C# API?

I have a few classes that are structured like this:

```c#
class Foo : StaticBody
{
    class Bar : Spatial
    {
        // ...
    }

    // ...
}
```

I've tried removing them / moving them to their own files, but as the crash doesn't seem to be reliably reproducible it's hard to determine if it's more stable or not as a result.

**Steps to reproduce:**
See above comments.

**Minimal reproduction project:**
See above comments.
Repository: create-react-app
Issue: [doc] The pwa template install command seems wrong.
Labels: needs triage,issue: bug report

### Describe the bug

In the [create a pwa](https://create-react-app.dev/docs/making-a-progressive-web-app/) page of the doc, the commands to create a new pwa is 
> `npx create-react-app my-app --template cra-template-pwa`

and 

> `npx create-react-app my-app --template cra-template-pwa-typescript`

which seem wrong, for instance, I tried the 2nd one, and what I got was neither a pwa nor with typescript.

And by looking at the [readme](https://www.npmjs.com/package/cra-template-pwa) and [reamde](https://www.npmjs.com/package/cra-template-pwa-typescript), the correct commands seem to be 
> `npx create-react-app my-app --template pwa`

and 
> `npx create-react-app my-app --template pwa-typescript`

### Steps to reproduce

Do `npx create-react-app my-app --template cra-template-pwa-typescript` according to the doc.

### Expected behavior

Get a pwa typescript project.

### Actual behavior
Got a project that's neither pwa nor typescript.

### Environment

<!--
  To help identify if a problem is specific to a platform, browser, or module version, information about your environment is required.
  This enables the maintainers quickly reproduce the issue and give feedback.

  Run the following command in your React app's folder in terminal.
  Note: The result is copied to your clipboard directly.

  `npx create-react-app --info`

  Paste the output of the command in the section below.
-->

```
Environment Info:

  current version of create-react-app: 4.0.3
  running from C:\Users\Zhi\AppData\Roaming\npm-cache\_npx\23384\node_modules\create-react-app

  System:
    OS: Windows 10 10.0.19041
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  Binaries:
    Node: 14.15.4 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.5 - ~\scoop\apps\yarn\current\Yarn\bin\yarn.CMD
    npm: 6.14.10 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Chrome: 88.0.4324.190
    Edge: Spartan (44.19041.423.0), Chromium (89.0.774.45)
    Internet Explorer: 11.0.19041.1
  npmPackages:
    react: Not Found
    react-dom: Not Found
    react-scripts: Not Found
  npmGlobalPackages:
    create-react-app: Not Found
```
Repository: TypeScript
Issue: Typescript fails to resolve module when type definitions are placed outside the root path (with typesVersions)
Labels: Needs Investigation,Rescheduled

# Bug Report

If you have a project with embedded type definitions that are not in root path. i.e.: `src/index.d.ts` and `src/ts4.1/index.d.ts`, TypeScript fails to resolve this module when using the following approach:
```json
  "types": "./src/index.d.ts",
  "typesVersions": {
    ">=4.1": {
      "*": [
        "src/ts4.1/*"
      ]
    }
  },
```

> src/i18n/config.ts:4:34 - error TS2307: Cannot find module 'react-i18next' or its corresponding type declarations.
> 
> import { useTranslation } from 'react-i18next';


It works, if we replace `*` to `index.d.ts`, like this:
```json
  "types": "./src/index.d.ts",
  "typesVersions": {
    ">=4.1": {
      "*": [
        "src/ts4.1/index.d.ts"
      ]
    }
  },
```
However, when we replace it with the actual file (`src/ts4.1/index.d.ts`), VS Code sometimes imports the module incorrectly, i.e.:
```ts
import { useTranslation } from 'react-i18next/*';
```
Rather than:
```ts
import { useTranslation } from 'react-i18next';
```

[Here](https://github.com/i18next/react-i18next/issues/1264) you can find some context.

### 💻 Code

https://github.com/i18next/react-i18next/blob/master/package.json#L7

```json
"types": "./src/index.d.ts",
"typesVersions": {
  ">=4.1": {
    "*": [
      "src/ts4.1/index.d.ts"
    ]
  }
},
```

### 🙁 Actual behavior

It fails to compile, and fails to auto-import properly.
```ts
import { useTranslation } from 'react-i18next/*';
```

### 🙂 Expected behavior
Resolve the module and import it properly.
```ts
import { useTranslation } from 'react-i18next';
```
Repository: flutter
Issue: Support decode only imageinfo，But not image data
Labels: c: new feature,framework,a: images,c: proposal,P3,team-framework,triaged-framework

## Use case

like Android 
``
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
``
iOS
``
UIImage *image = [UIImage imageWithData: data];
``
This will consume less time in order to obtain basic ImageInfo.
In most cases, we may read only image width and height; and then calculate a suitable targetWidth and targetHeight when decoding image.

## Proposal

maybe add a new api for decode ImageInfo only