id int64 393k 2.82B | repo stringclasses 68
values | title stringlengths 1 936 | body stringlengths 0 256k ⌀ | labels stringlengths 2 508 | priority stringclasses 3
values | severity stringclasses 3
values |
|---|---|---|---|---|---|---|
2,656,373,094 | flutter | [flutter_svg] Add errorBuilder to SvgPicture and adjust underlying vector_graphics errorBuilder (to trigger on BytesLoader errors) | _Imported from https://github.com/dnfield/flutter_svg/issues/996_
Original report by @Yagorundy on Oct 11, 2023
My use case: I am trying to fallback to a svg in assets if my `SvgPicture.network()` fails for any reason (wrong url, request returns 404, invalid svg format, ...)
widgets like the Flutter `Image` fully support this `errorBuilder` and any error in the process (image loading/parsing/rendering) triggers the `errorBuilder` callback
From my observations:
- SvgPicture widget does not accept `errorBuilder`
- The `vector_graphics` package does not trigger `errorBuilder` for `BytesLoader` objects `loadBytes()` calls, it only triggers it for errors in `decodeVectorGraphics()`
image from `vector_graphics.dart`

---
Comment by @guopeng1994 on Nov 24, 2023
WE NEED THIS!!
---
Comment by @mnayef95 on Sep 12, 2024
I've created a PR on `vector_graphics`. Once @dnfield approves it, we can update `flutter_svg` to handle it.
https://github.com/dnfield/vector_graphics/pull/255
| package,P3,p: flutter_svg | low | Critical |
2,656,373,234 | flutter | [flutter_svg] Proposal to add `ColorMapper.fromCallback` constructor | _Imported from https://github.com/dnfield/flutter_svg/issues/1003_
Original report by @jtarkowski27 on Oct 19, 2023
Personally I find it a bit excessive having to write a new class extending `ColorMapper` just to override one method which is `ColorMapper.substitute`. This method is usually quite simple an can be expressed in few lines of code without any complex logic.
For cases like that I propose to add the new `ColorMapper.fromCallback` named constructor that would take the `substitute` method as a callback. Somewhat precise implementation would be something like this.
```dart
abstract class ColorMapper {
const ColorMapper();
const factory ColorMapper.fromCallback(
SubstituteCallback substitute,
) = _ColorMapperCallback;
Color substitute(
String? id,
String elementName,
String attributeName,
Color color,
);
}
class _ColorMapperCallback implements ColorMapper {
const _ColorMapperCallback(this._substitute);
final Color Function(
String? id,
String elementName,
String attributeName,
Color color,
) _substitute;
@override
Color substitute(
String? id,
String elementName,
String attributeName,
Color color,
) =>
_substitute(
id,
elementName,
attributeName,
color,
);
}
```
---
Comment by @dnfield on Oct 19, 2023
I don't see why not. It could make evolving the ColorMapper interface harder but I'm not sure how much evolution it really would/will need.
| package,P3,p: flutter_svg | low | Minor |
2,656,373,728 | flutter | [flutter_svg] Scaling for flutter web is broken in version 3.16.0 | _Imported from https://github.com/dnfield/flutter_svg/issues/1013_
Original report by @ifuterman on Nov 20, 2023
We are forced to use supersampling to display images correctly. After updating flutter to version 3.16.0, part of the icon is cut off when scaling. everything worked correctly in version 3.13.8
```
Transform.scale(
filterQuality: FilterQuality.medium,
scale: 0.5,
alignment: Alignment.center,
child: Transform.scale(
scale: 2,
child: SvgPicture.asset(
asset,
width: width,
height: height,
colorFilter: color != null ? ColorFilter.mode(overrideColor ?? color, BlendMode.srcIn) : null,
clipBehavior: Clip.antiAlias,
),
),
);
```


---
Comment by @dnfield on Nov 20, 2023
What platform(s) are you observing this on?
---
Comment by @ifuterman on Nov 21, 2023
> What platform(s) are you observing this on?
WEB canvasKit. We test it in chrome (windows, Mac)
---
Comment by @ifuterman on Nov 22, 2023
Maybe is this the solution? https://github.com/dnfield/flutter_svg/issues/668#issuecomment-1786082177
---
Comment by @adonisRodxander on Dec 4, 2023
Same issue with flutter sdk 3.13.6
---
Comment by @ifuterman on Dec 4, 2023
> Same issue with flutter sdk 3.13.6
For me it works with 3.13.xx
| package,P3,p: flutter_svg | low | Critical |
2,656,373,809 | flutter | [flutter_svg] unknown issue with svg not loading. | _Imported from https://github.com/dnfield/flutter_svg/issues/1016_
Original report by @thecodepapaya on Dec 1, 2023
I have an SVG which opens fine on browser and mac preview, but when I add it to my code via below code, nothing renders on the screen. I've added the asset path to `pubspec.yaml`. There's nothing on the console either so it's almost impossible to figure out if something went wrong.
```
SvgPicture.asset(
IconAsset.tabloid,
height: 100,
width: 100,
fit: BoxFit.fitHeight,
placeholderBuilder: (context) {
return Container(
color: Colors.black,
height: 40,
width: 40,
);
},
),
```
```
<svg width="865" height="1200" viewBox="0 0 865 1200" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5439_1210)">
<circle opacity="0.2" cx="150.5" cy="-52.5" r="288.5" stroke="#333333"
style="stroke:#333333;stroke:color(display-p3 0.2000 0.2000 0.2000);stroke-opacity:1;" stroke-width="2"
stroke-dasharray="8 8" />
<circle opacity="0.6" cx="666.5" cy="1274.5" r="280" stroke="#333333"
style="stroke:#333333;stroke:color(display-p3 0.2000 0.2000 0.2000);stroke-opacity:1;"
stroke-dasharray="8 8" />
<circle opacity="0.1" cx="150.5" cy="-52.5" r="244.5" fill="#333333"
style="fill:#333333;fill:color(display-p3 0.2000 0.2000 0.2000);fill-opacity:1;" />
<circle opacity="0.6" cx="666.5" cy="1274.5" r="244" stroke="#333333"
style="stroke:#333333;stroke:color(display-p3 0.2000 0.2000 0.2000);stroke-opacity:1;" />
<circle opacity="0.15" cx="666.5" cy="1274.5" r="202" fill="#333333" stroke="#333333"
style="fill:#333333;fill:color(display-p3 0.2000 0.2000 0.2000);fill-opacity:1;stroke:#333333;stroke:color(display-p3 0.2000 0.2000 0.2000);stroke-opacity:1;" />
<g opacity="0.15">
<path
d="M748.953 444.742L748.953 444.742C748.772 443.546 748.59 442.35 748.407 441.156C746.084 425.923 743.788 410.868 744.435 395.266C750.224 279.749 796.538 187.67 896.732 131.03L895.748 129.288L896.732 131.029C964.893 92.4953 1036.21 92.7105 1093.45 122.179C1150.7 151.653 1194.06 210.494 1206.07 289.588C1225.93 420.522 1150.23 558.53 1031.05 608.616L1031.83 610.46L1031.05 608.616C904.955 661.615 769.899 583.306 748.953 444.742ZM862.734 215.594L862.732 215.597L863.838 237.737L862.643 239.341C862.643 239.341 862.644 239.341 862.644 239.342C864.885 241.012 867.082 241.979 869.261 242.254C871.459 242.532 873.484 242.086 875.33 241.18C878.897 239.428 881.895 235.891 884.572 232.362C890.902 224.156 897.879 216.315 905.785 210.012C927.513 192.753 952.825 185.091 980.235 183.57C983.425 183.418 986.691 182.92 989.5 181.449C992.392 179.934 994.67 177.453 995.931 173.633C997.925 167.621 995.301 161.528 990.165 159.242L990.138 159.23L990.111 159.218C987.276 158.055 984.248 157.517 981.432 157.171C980.162 157.015 978.995 156.902 977.892 156.795C976.412 156.652 975.048 156.52 973.706 156.31L973.461 156.272L973.215 156.294C927.628 160.439 890.418 178.69 862.734 215.594Z"
stroke="#333333" style="stroke:#333333;stroke:color(display-p3 0.2000 0.2000 0.2000);stroke-opacity:1;"
stroke-width="4" />
<path
d="M834.915 630.924L834.918 630.917L834.922 630.911C836.988 627.122 839.056 623.9 841.528 622.109C842.716 621.249 843.958 620.751 845.329 620.664C846.708 620.577 848.375 620.897 850.417 621.926C854.348 623.925 855.709 626.582 855.864 629.474C856.03 632.579 854.811 636.198 852.945 639.875C835.58 673.273 810.456 694.618 776.024 696.999C762.532 696.846 752.863 694.208 743.329 690.543L743.317 690.539C740.241 689.378 737.814 687.729 736.407 685.678C735.058 683.711 734.51 681.18 735.52 677.831L735.521 677.829C736.514 674.519 738.177 672.403 740.173 671.34C742.152 670.287 744.803 670.086 748.173 671.3L748.175 671.301C768.794 678.71 785.763 677.368 800.021 669.62C814.182 661.926 825.404 648.054 834.915 630.924Z"
stroke="#333333" style="stroke:#333333;stroke:color(display-p3 0.2000 0.2000 0.2000);stroke-opacity:1;"
stroke-width="4" />
</g>
</g>
<defs>
<clipPath id="clip0_5439_1210">
<rect width="865" height="1200" fill="white" style="fill:white;fill:white;fill-opacity:1;" />
</clipPath>
</defs>
</svg>
```
---
Comment by @usamakareem on Dec 1, 2023
I'm also facing same issue. Svg picture is opening fine in my system and browser but when i add it in my code and run it then it doesn't shows.
Using flutter_svg: ^2.0.9.
When i run project on profile mode. Then it shows error in console
error: "unhandled element <filter/>; Picture key: Svg loader"
```
SvgPicture.asset(
Images.myPlan,
),
```
---
Comment by @ManishMK1438 on Dec 2, 2023
same issue with me. Even android studio is loading the svg perfectly in the IDE but nothing shows up in the app.

---
Comment by @zamirszn on Dec 6, 2023
im also having this issue
---
Comment by @BodenTide on Dec 8, 2023
im also having this issue
---
Comment by @zamirszn on Dec 8, 2023
I'm going to try this solution https://github.com/dnfield/flutter_svg/issues/980#issuecomment-1712234729 and see if it works
---
Comment by @BodenTide on Dec 9, 2023
> 我将尝试这个解决方案[#980(评论)](https://github.com/dnfield/flutter_svg/issues/980#issuecomment-1712234729),看看它是否有效
Yes, this method can indeed display svg normally.
| package,P3,p: flutter_svg | low | Critical |
2,656,374,157 | flutter | [flutter_svg] preserveAspectRatio is not used when rendering the SVG. | _Imported from https://github.com/dnfield/flutter_svg/issues/1021_
Original report by @samorian on Dec 18, 2023
We display the following SVG with SvgPicture.memory(...) and SvgPicture.string(...) in our Flutter App(flutter_svg: 2.0.9).
```
<svg id="Ebene_1" data-name="Ebene 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 640 360">
<image preserveAspectRatio="xMidYMid meet" width="136" height="136" transform="translate(550.5 276) scale(.47)" href="data:image/png;base64,{base64image}" />
</svg>
```
`preserveAspectRatio="xMidYMid meet"` is not applied and the image is incorrectly stretched by a different aspect ratio.
Rendered in the browser:

Rendered in the app:

| package,P3,p: flutter_svg | low | Minor |
2,656,374,228 | flutter | [flutter_svg] Issues with rendering SVG with colorFilter | _Imported from https://github.com/dnfield/flutter_svg/issues/1026_
Original report by @ajimal1992 on Jan 10, 2024
### Overview
Flutter SVG renders correctly for version `3.10.6` but rendered differently/wrongly for version `3.16.5` when used with colorFilter.
#### Expected result (running with version 3.10.6)
<img width="33" alt="image" src="https://github.com/dnfield/flutter_svg/assets/22025784/e0c06538-7837-4af3-9650-698a86e8dc97">
#### Actual result (running with version 3.16.5)
<img width="33" alt="image" src="https://github.com/dnfield/flutter_svg/assets/22025784/ce332731-930b-4bcd-a97c-968a3305e0b3">
<details>
<summary>flutter doctor -v (running with version 3.10.6)</summary>
```
[✓] Flutter (Channel stable, 3.10.6, on macOS 14.2.1 23C71 darwin-arm64 (Rosetta), locale en-US)
• Flutter version 3.10.6 on channel stable at /Users/ajmohame/sdk/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f468f3366c (6 months ago), 2023-07-12 15:19:05 -0700
• Engine revision cdbeda788a
• Dart version 3.0.6
• DevTools version 2.23.1
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/ajmohame/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Users/ajmohame/Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15A507
• CocoaPods version 1.14.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1)
• Android Studio at /Users/ajmohame/Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.2.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.85.1)
• VS Code at /Users/ajmohame/Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.80.0
[✓] Connected device (3 available)
• iPhone 15 Pro Max (mobile) • AB39AAEC-B46A-4333-8BC6-EFC487072106 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.2.1 23C71 darwin-arm64 (Rosetta)
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.199
[✓] Network resources
• All expected network resources are available.
• No issues found!
```
</details>
<details>
<summary>flutter doctor -v (running with version 3.16.5)</summary>
```
[✓] Flutter (Channel stable, 3.16.5, on macOS 14.2.1 23C71 darwin-arm64, locale
en-US)
• Flutter version 3.16.5 on channel stable at /Users/ajmohame/sdk/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 78666c8dc5 (3 weeks ago), 2023-12-19 16:14:14 -0800
• Engine revision 3f3e560236
• Dart version 3.2.3
• DevTools version 2.28.4
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/ajmohame/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Users/ajmohame/Applications/Android
Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15A507
• CocoaPods version 1.14.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.1)
• Android Studio at /Users/ajmohame/Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build
17.0.7+0-17.0.7b1000.6-10550314)
[✓] IntelliJ IDEA Ultimate Edition (version 2023.2.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.85.1)
• VS Code at /Users/ajmohame/Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.80.0
[✓] Connected device (3 available)
• iPhone 15 Pro Max (mobile) • AB39AAEC-B46A-4333-8BC6-EFC487072106 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.2.1 23C71 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.199
[✓] Network resources
• All expected network resources are available.
• No issues found!
```
</details>
<details>
<summary>Sample code</summary>
```dart
class TestView extends StatelessWidget {
const TestView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Center(
child: SvgPicture.asset(
"assets/images/sample.svg",
colorFilter: const ColorFilter.mode(
Colors.green,
BlendMode.color,
),
),
),
);
}
}
```
</details>
<details>
<summary>Sample SVG</summary>
```xml
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" fill="white" stroke="#0E50D0" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<rect x="6" y="6" width="12" height="12" rx="6" fill="#0E50D0"/>
</svg>
```
</details>
---
Comment by @sejong2401 on Jan 16, 2024
Try use **BlendMode.srcATop** instead of **BlendMode.color**.
---
Comment by @3kdeveloper on Jan 17, 2024
try this:
SvgPicture.asset('svg path',
colorFilter: const ColorFilter.mode(
AppColors.whiteColor, BlendMode.srcIn)),
---
Comment by @jonahwilliams on Apr 20, 2024
Hi, Flutter team member here. If you're hitting Impeller specific rendering bugs you need to file them on the main flutter repo. We do not triage this repo, so these will be missed.
| package,p: flutter_svg | low | Critical |
2,656,374,389 | flutter | [flutter_svg] Major Crash on Mobile Web when using SvgPicture.asset with flutter_svg | _Imported from https://github.com/dnfield/flutter_svg/issues/1032_
Original report by @SzymonDziak on Jan 18, 2024
## Description
When using `SvgPicture.asset` to render SVG images on a mobile web application, the app experiences a major crash. This issue seems to occur only on the mobile web and not on other platforms.
## Steps to Reproduce
1. Use `SvgPicture.asset` to load and display an SVG image in a Flutter application.
2. Run the application on a mobile web browser.
3. Navigate to the page where the SVG is rendered.
## Expected results:
The SVG image should render correctly without causing any crashes.
## Actual results:
The application crashes when attempting to render the SVG image.
## Additional Information
- Flutter version: 3.16.0
- flutter_svg version: 2.0.9
- Browser(s) tested: Chrome, Safari, DuckDuckGo
- Can't find any error logs or stack traces that occur during the crash as it only happens on mobile browsers.
## Example Code
dart
```
Padding(
padding: const EdgeInsets.only(right: 12.0),
child: SvgPicture.asset(
"assets/svg/open_right_lock.svg",
width: 22,
colorFilter: ColorFilter.mode(
CustomColor.textFieldText.value,
BlendMode.srcATop,
),
),
)
```
Link to the icon used in the example code: https://fonts.google.com/icons?selected=Material+Symbols+Outlined:lock_open_right:FILL@0;wght@400;GRAD@0;opsz@24&icon.query=open+ri&icon.platform=web
---
Comment by @dnfield on Jan 18, 2024
Could you crete a dartpad example?
| package,P3,p: flutter_svg | low | Critical |
2,656,374,852 | flutter | [flutter_svg] Add support for marker-end. | _Imported from https://github.com/dnfield/flutter_svg/issues/1039_
Original report by @Zeebzog on Feb 19, 2024
Hi,
I do need to know how to resolve this issue, if necessary I will try to address in the code if you point me in the right direction.
I appreciate that this is a known issue and the library does not support markers, but my comment on the previous request got no response.
Thank you.
The library is great, but I also need marker-end implemented. The library fails to draw the arrow head of the svg below.
`<svg` width="2788" height="1232" viewBox="0 -1232 2788 1232" xmlns="http://www.w3.org/2000/svg"><marker id="arrow" `refX="1" refY="5" markerWidth="4" markerHeight="4" viewBox="0 0 10 10" orient="auto" ><path d="M 0 0 L 10 5 L 0 10 z" `fill="black" /></marker><line x1="104" y1="-225" x2="164" y2="-225" stroke="black" stroke-width="2" marker-`end="url(#arrow)" /></svg>
Thank you.
| package,P3,p: flutter_svg | low | Minor |
2,656,374,931 | flutter | [flutter_svg] Italic font style not supported in text tag. | _Imported from https://github.com/dnfield/flutter_svg/issues/1040_
Original report by @guman24 on Feb 20, 2024
It's now working when I used font-style="italic" in svg text.
```
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:svgjs="http://svgjs.dev/svgjs" width="1024" height="1024">
<rect width="1024" height="1024" fill="url(#SvgjsLinearGradient1015)"></rect>
<defs>
<linearGradient x1="0.5" y1="1" x2="0.5" y2="0" id="SvgjsLinearGradient1015">
<stop stop-opacity="0" stop-color="#ffd700" offset="40%"></stop>
<stop stop-opacity="1" stop-color="#ffd700" offset="100%"></stop>
</linearGradient>
</defs><text font-family="Helvetica" font-size="96" text-anchor="start" font-weight="900" fill="#007f00"
stroke-width="1" stroke="#000000" x="40" y="20" svgjs:data="{"leading":"1.3"}"></text><text
font-family="Poppins" font-size="63" text-anchor="start" font-weight="500" fill="#000000" x="40"
y="126.884765625" font-style="italic" svgjs:data="{"leading":"1.3"}">
<tspan dy="0" x="40" svgjs:data="{"newLined":true}">Adventure-Ready Elegance</tspan>
<tspan dy="81.9" x="40" svgjs:data="{"newLined":true}">new in the town now</tspan>
</text>
<rect width="383.6015625" height="144.05078125" fill="#000000" rx="72.025390625" ry="72.025390625" x="32"
y="846.94921875"></rect>
<rect width="379.6015625" height="138.05078125" fill="#1b1b1b" rx="69.025390625" ry="69.025390625" x="40"
y="845.94921875"></rect><text font-family="Monoton" font-size="72" text-anchor="middle"
font-weight="500" fill="#ffd700" x="229.80078125" y="942.90625"
svgjs:data="{"leading":"1.3"}">
<tspan dy="0" x="229.80078125" svgjs:data="{"newLined":true}">Buy Now</tspan>
</text>
</svg>
```
| package,P3,p: flutter_svg | low | Minor |
2,656,384,042 | flutter | [flutter_svg] accept "viewBox" or "viewbox" in vector_graphics_compiler. | _Imported from https://github.com/dnfield/flutter_svg/issues/1043_
Original report by @higaski on Feb 25, 2024
I keep getting `Bad state: SVG did not specify dimensions` errors when using the SVG attached here and I can't wrap my head around why? The SVG clearly contains all the 3 attributes the error message is complaining about?
This is the error in detail
```sh
Bad state: SVG did not specify dimensions
The SVG library looks for a `viewBox` or `width` and `height` attribute to determine the viewport boundary of the SVG. Note that these attributes, as with all SVG attributes, are case sensitive.
```
And this is the beginning of the SVG data
```xml
<svg
width="271.099mm"
height="155.14697mm"
viewBox="0 0 271.099 155.14699"
version="1.1"
...
```

---
Comment by @LucaCoduriV on Mar 3, 2024
same for me
---
Comment by @rajrushilmakkar on Mar 7, 2024
facing the same issue with this svg

---
Comment by @dnfield on Mar 7, 2024
> facing the same issue with this svg
viewBox is case sensitive. Maybe I should lighten this up though since browsers seem to.
---
Comment by @dnfield on Mar 7, 2024
@higaski your example has a couple pattern elements in it that are using not well supported features for this package, and also includes JavaScript which will never work with this package.
It _is_ a bug that we're requiring a `viewBox` on a `pattern` that has no `width` or `height`, but fixing that won't fix your SVG unfortunately.
---
Comment by @rajrushilmakkar on Mar 7, 2024
> viewBox is case sensitive.
Hi, thanks, changing to viewBox did fix my issue
> Maybe I should lighten this up though since browsers seem to.
I think that would be nice. Happy to create a PR @dnfield
| package,P3,p: flutter_svg | low | Critical |
2,656,384,544 | flutter | [flutter_svg] State what SVG version is supported in README | _Imported from https://github.com/dnfield/flutter_svg/issues/1052_
Original report by @gisborne on Mar 29, 2024
I’ve looked at the README and perused the docs. I still have no idea if this supports SVG 1.1, 2, Tiny, SVGT, SVGB or what.
| package,P3,p: flutter_svg | low | Minor |
2,656,384,626 | flutter | [flutter_svg] Rendering wrong when upgrading from flutter_svg 1.1.6 to 2.0.0 and later | _Imported from https://github.com/dnfield/flutter_svg/issues/1053_
Original report by @quanghd96 on Apr 1, 2024
Rendering wrong when upgrading from flutter_svg 1.1.6 to 2.0.0 and later. So can not use camera to read it. Can you check it?
- 2.0.0 and later

- 1.1.6

- Origin

| package,P3,p: flutter_svg | low | Minor |
2,656,384,759 | flutter | [flutter_svg] Rendering problem: Text overlapping | _Imported from https://github.com/dnfield/flutter_svg/issues/1055_
Original report by @IDIM-CGN on Apr 4, 2024
Hi,
I am using the latest version of flutter_svg (2.0.10+1) and was building it on Android.
The used vector image is displayed correctly in commonly used viewers (e.g. Firefox) but is rendered disrupted inside the app widget:

Mainly the texts is overlapping (e.g. "Score" in the title). SVG was exported with the recommended values (see flutter_svg readme).
Also trying to convert svg to a more flat format with svg cleaner - but no success. I would be very happy about any tips!
Thanks!
SVG-File:

| package,P3,p: flutter_svg | low | Minor |
2,656,384,844 | flutter | [flutter_svg] SVG filter spec not supported. | _Imported from https://github.com/dnfield/flutter_svg/issues/1058_
Original report by @modulovalue on Apr 17, 2024
Hello Dan,
Consider the following SVG:

which appears to be rendered incorrectly by flutter_svg.
Here's what I'm seeing in a Flutter App:
<img width="272" alt="actual" src="https://github.com/dnfield/flutter_svg/assets/24444584/15f729d2-717e-4bf3-b522-187ac279e46e">
Here's what I was expecting:

Notice how some of the gradients appear to be wrong.
The file was designed in Figma and exported from Figma.
I'm using the following to load that SVG:
```dart
... SvgPicture.asset(path_to_asset) ...
```
With the following flutter release:
```
Flutter 3.16.7 • channel stable • https://github.com/flutter/flutter.git
Framework • revision ef1af02aea (3 months ago) • 2024-01-11 15:19:26 -0600
Engine • revision 4a585b7929
Tools • Dart 3.2.4 • DevTools 2.28.5
```
And the newest flutter_svg release:
```
flutter_svg: ^2.0.10+1
```
Do you know if there are any limitations that might make this unlikely to ever be fixed or could this be an actual bug?
---
Comment by @sketchitbiz on May 25, 2024
me .. too is there any updates?
---
Comment by @modulovalue on May 25, 2024
I ended up using PNGs instead.
---
Comment by @jonahwilliams on May 28, 2024
The SVG filter spec isn't supported in the package.
---
Comment by @nbetsaif on Jun 30, 2024
same issue
| package,P3,p: flutter_svg | low | Critical |
2,656,385,304 | flutter | [flutter_svg] image cannot be displayed | _Imported from https://github.com/dnfield/flutter_svg/issues/1073_
Original report by @yykou on May 30, 2024
An SVG image on a web page that can be opened normally will result in a black area when loaded using the latest version of the library, and the image cannot be displayed.
SVG image path:https://ccdn1.goodq.top/caches/3802cdfcb59f037aa40858825f9f3e24/aHR0cHM6Ly9zdmdzLjR2eC5uZXQvcWZ5LWNvbnRlbnQvdXBsb2Fkcy8yMDIxLzA0LzBhYTNlNzQwYzU0ZjMxZjY0YmIyODE3OTc2ZjQwODJkLnN2Zw_p_p100_p_3D_p_p100_p_3D.svg
code:
`SvgPicture.network( 'https://ccdn1.goodq.top/caches/3802cdfcb59f037aa40858825f9f3e24/aHR0cHM6Ly9zdmdzLjR2eC5uZXQvcWZ5LWNvbnRlbnQvdXBsb2Fkcy8yMDIxLzA0LzBhYTNlNzQwYzU0ZjMxZjY0YmIyODE3OTc2ZjQwODJkLnN2Zw_p_p100_p_3D_p_p100_p_3D.svg',
semanticsLabel: 'A shark?!',
width: 50.0,
height: 50.0,
placeholderBuilder: (BuildContext context) => Container(
padding: const EdgeInsets.all(30.0),
child: const CircularProgressIndicator()),
)`
The final display effect:

---
Comment by @yykou on May 30, 2024
[√] Flutter (Channel stable, 3.19.0, on Microsoft Windows [版本 10.0.19045.4412], locale zh-CN)
• Flutter version 3.19.0 on channel stable at C:\yykou\flutter_sdk\flutter_windows_3.19.0-stable\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision bae5e49bc2 (4 months ago), 2024-02-13 17:46:18 -0800
• Engine revision 04817c99c9
• Dart version 3.3.0
• DevTools version 2.31.1
---
Comment by @s681562 on Jun 24, 2024
Same error. Either black rectangle is showing or nothing is showing.
It looks like flutter_svg can not encode svg images created by
`<!-- Generator: Adobe Illustrator 27.5.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->`
Code:
` IconButton(
padding: EdgeInsets.zero,
constraints: BoxConstraints(),
icon: SvgPicture.asset("assets/images/gdb_logo_negative.svg"),
onPressed: () {
// ToDo https://gemeinsamdigital.berlin.de/de/
},
),`
Try this out:

Result:
<img width="177" alt="KakaoTalk_20240624_091003776" src="https://github.com/dnfield/flutter_svg/assets/3010920/e28c1bcf-bf86-43f9-b442-79043d7c637f">
Try this out:

Result:
<img width="173" alt="KakaoTalk_20240624_091017138" src="https://github.com/dnfield/flutter_svg/assets/3010920/029d4d32-05a4-4e0a-b6a6-361291ab19c6">
Try this out:

Result:
<img width="846" alt="KakaoTalk_20240624_091028986" src="https://github.com/dnfield/flutter_svg/assets/3010920/45c26236-a3b2-4ad0-8866-68d6a60a6c86">
| package,P3,p: flutter_svg | low | Critical |
2,656,385,396 | flutter | [flutter_svg] [BUG] Caching is not working correctly. | _Imported from https://github.com/dnfield/flutter_svg/issues/1074_
Original report by @darkstarx on May 30, 2024
You use `SvgCacheKey` that has `keyData` which is `SvgNetworkLoader`.
1. Implement `operator==` and `hashCode` for ColorMapper (actually there is only `TestColorMapper` yet).
2. Fix calculating `hashCode` and comparing the `SvgNetworkLoader.headers` which is `Map<String, String>`.
```dart
@override
int get hashCode => Object.hash(url, headers /* HERE */, theme, colorMapper);
@override
bool operator ==(Object other) {
return other is SvgNetworkLoader &&
other.url == url &&
other.headers == headers && // You NEVER get here true until these are identical maps.
other.theme == theme &&
other.colorMapper == colorMapper;
}
```
It's hardly ever to be happend when user writes the same Map of headers on different pages, usually these are different maps with the same entries.
You have two options:
1. Use `const MapEquality().equals(headers, other.headers)` in the `operator==` and `Object.hashAll([ ...headers.keys, headers.values, ... ])` in the `hashCode` getter.
2. Remove headers from `hashCode` and `operator==` since `headers` don't define the the source of svg data like `url` does.
| package,P3,p: flutter_svg | low | Critical |
2,656,388,547 | godot | Modifying a node when using inherited scenes causes warning about vanishing | ### Tested versions
- Reproducible in v4.3.stable.mono.official [77dcf97d8]
### System information
M2 macOS - Sonoma 14.6.1
### Issue description
Repro:
- Download the minimal repro
- Open `base.tscn`
- Right-click the `CanvasGroup` and make it the scene root
- Run the project
It will output this warning:
```
W 0:00:00:0715 instantiate: Node './Label' was modified from inside an instance, but it has vanished.
<C++ Source> scene/resources/packed_scene.cpp:254 @ instantiate()
```
What's unusual is that Godot will actually fix¹ the underlying `derived.tscn` file, but only if you open `derived.tscn` in Godot first, otherwise the warning will print every time you run. This is part of why this issue was so insidious for me in particular—I only ever run from VSCode, and it doesn't fix the `tscn` file when you do that.
Here are some expectations I have around this behavior:
- The warning would tell me more information about why this is happening and how to fix it
- I wouldn't need to open the scene file in Godot for it to be changed
- If the file _is_ going to be changed, I think I'd want to be aware of what's changing
Note: I don't know exactly whether I would expect the file to be changed or unchanged; it's hard to know what _should_ happen here. 🤔
¹By "fix", I mean it will remove these lines from `derived.tscn`:
```
[node name="Label" parent="." index="0"]
visible = true
```
### Minimal reproduction project (MRP)
[vanishednoderepro.zip](https://github.com/user-attachments/files/17737443/vanishednoderepro.zip)
| discussion,topic:editor | low | Minor |
2,656,394,850 | flutter | [flutter_svg] some 'style' attribute will cause the svg file to fail to render. | _Imported from https://github.com/dnfield/flutter_svg/issues/1077_
Original report by @xyqjay on Jun 11, 2024
1. With the `style` attribute, it can be rendered
```
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="icon/file">
<path id="Vector (Stroke)" fill-rule="evenodd" clip-rule="evenodd" d="M0.666992 1.66667C0.666992 1.29848 0.965469 1 1.33366 1H14.667C15.0352 1 15.3337 1.29848 15.3337 1.66667V14.0573C15.3337 14.1046 15.3287 14.1507 15.3194 14.1952C15.3288 14.2398 15.3337 14.286 15.3337 14.3333C15.3337 14.7015 15.0352 15 14.667 15H4.33886C3.97067 15 3.67219 14.7015 3.67219 14.3333C3.67219 13.9651 3.97067 13.6667 4.33886 13.6667H14.0003V6.33333H2.00033V10.0573C2.00033 10.4255 1.70185 10.724 1.33366 10.724C0.965469 10.724 0.666992 10.4255 0.666992 10.0573V1.66667ZM2.00033 5V2.33333H14.0003V5H2.00033ZM2.66699 3.66553C2.66699 3.29734 2.96547 2.99887 3.33366 2.99887H3.66699C4.03518 2.99887 4.33366 3.29734 4.33366 3.66553C4.33366 4.03372 4.03518 4.3322 3.66699 4.3322H3.33366C2.96547 4.3322 2.66699 4.03372 2.66699 3.66553ZM5.00033 3.66667C5.00033 3.29848 5.2988 3 5.66699 3H12.667C13.0352 3 13.3337 3.29848 13.3337 3.66667C13.3337 4.03486 13.0352 4.33333 12.667 4.33333H5.66699C5.2988 4.33333 5.00033 4.03486 5.00033 3.66667ZM9.79538 8.52821C10.0534 8.27056 10.4706 8.26808 10.7318 8.52264L12.2253 9.97864C12.4889 10.2357 12.4943 10.6577 12.2373 10.9214C11.9802 11.185 11.5582 11.1904 11.2945 10.9334L10.272 9.93648L8.05631 12.1485C7.79987 12.4045 7.3859 12.4088 7.12419 12.1582L5.40469 10.5115L1.80747 14.1457C1.54845 14.4074 1.12635 14.4095 0.864672 14.1505C0.602994 13.8915 0.600835 13.4694 0.859849 13.2077L4.91838 9.10745C5.17438 8.84882 5.59048 8.84325 5.8533 9.09495L7.5756 10.7443L9.79538 8.52821Z" fill="white" style="fill:white;fill-opacity:1;"/>
</g>
</svg>
```
2. With the `style` attribute, it can't be rendered!!! (It can be render by Chrome or Edge or Mac's Preview)
```
<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="icon">
<path id="Vector" d="M9 4.5L6.5 7.5L4 4.5H9Z" fill="#888888" stroke="#888888" style="fill:#888888;fill:color(display-p3 0.4784 0.4941 0.5294);fill-opacity:1;stroke:#888888;stroke:color(display-p3 0.4784 0.4941 0.5294);stroke-opacity:1;" stroke-linejoin="round"/>
</g>
</svg>
```
2.1 Delete the `style` attribute in 2 , it can be rendered
```
<svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="icon">
<path id="Vector" d="M9 4.5L6.5 7.5L4 4.5H9Z" fill="#888888" stroke="#888888" stroke-linejoin="round"/>
</g>
</svg>
```
| package,P3,p: flutter_svg | low | Minor |
2,656,395,134 | flutter | [flutter_svg] SVG showing Black bacground when rendered | _Imported from https://github.com/dnfield/flutter_svg/issues/1083_
Original report by @manandharsudhir on Jun 24, 2024

Above I have provided the SVG also maximum SVG that I download from Figma doesnt seem to work in Flutter
I am using
flutter_svg: ^2.0.10+1
dart: 3.4.1
flutter: 3.22.1
Here is the code:
`SvgPicture.asset("assets/svg/otp.svg"),`
---
Comment by @yargm on Jul 18, 2024
same issue here
| package,P3,p: flutter_svg | low | Minor |
2,656,395,269 | flutter | [flutter_svg] Error found in FirebaseCrashlytics | _Imported from https://github.com/dnfield/flutter_svg/issues/1085_
Original report by @suhailpatel49 on Jun 26, 2024
I am facing this similar issue [660](https://github.com/dnfield/flutter_svg/issues/660). We are using a third party api and displaying svgs from there so there is no way for us to fix the svgs. Is there any way we can catch the exceptions from the library itself or tell the library to ignore the errors?
| package,p: flutter_svg | low | Critical |
2,656,395,593 | flutter | [flutter_svg] Can't rotate svg | _Imported from https://github.com/dnfield/flutter_svg/issues/1091_
Original report by @erperejildo on Jul 30, 2024
I have this svg:
```
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg fill="#000000" height="800px" width="800px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 44 44" xml:space="preserve">
<path d="M22,44c-3.309,0-6-2.665-6-5.941V28H5.941C2.665,28,0,25.309,0,22s2.665-6,5.941-6H16V5.941C16,2.665,18.691,0,22,0
s6,2.665,6,5.941V16h10.059C41.335,16,44,18.691,44,22s-2.665,6-5.941,6H28v10.059C28,41.335,25.309,44,22,44z M5.941,18
C3.805,18,2,19.832,2,22s1.805,4,3.941,4H18v12.059C18,40.195,19.832,42,22,42s4-1.805,4-3.941V26h12.059C40.195,26,42,24.168,42,22
s-1.805-4-3.941-4H26V5.941C26,3.805,24.168,2,22,2s-4,1.805-4,3.941V18H5.941z"/>
</svg>
```
And I edited it rotating it 45 degrees looking now like this:
```
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Transformed by: SVG Repo Mixer Tools -->
<svg fill="#000000" height="800px" width="800px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 44 44" xml:space="preserve" transform="rotate(45)">
<g id="SVGRepo_bgCarrier" stroke-width="0"/>
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"/>
<g id="SVGRepo_iconCarrier"> <path d="M22,44c-3.309,0-6-2.665-6-5.941V28H5.941C2.665,28,0,25.309,0,22s2.665-6,5.941-6H16V5.941C16,2.665,18.691,0,22,0 s6,2.665,6,5.941V16h10.059C41.335,16,44,18.691,44,22s-2.665,6-5.941,6H28v10.059C28,41.335,25.309,44,22,44z M5.941,18 C3.805,18,2,19.832,2,22s1.805,4,3.941,4H18v12.059C18,40.195,19.832,42,22,42s4-1.805,4-3.941V26h12.059C40.195,26,42,24.168,42,22 s-1.805-4-3.941-4H26V5.941C26,3.805,24.168,2,22,2s-4,1.805-4,3.941V18H5.941z"/> </g>
</svg>
```
I'm using this page to check and both seem correct.


| package,P3,p: flutter_svg | low | Minor |
2,656,395,682 | flutter | [flutter_svg] SVG produced by verovio doesn't work | _Imported from https://github.com/dnfield/flutter_svg/issues/1092_
Original report by @mkanada on Aug 2, 2024
A simple SVG produced by Verovio Music Notation Engraving Library doesn't work.

| package,P3,p: flutter_svg | low | Major |
2,656,395,783 | flutter | [flutter_svg] Add colorMapper argument to named SvgPicture constructors | _Imported from https://github.com/dnfield/flutter_svg/issues/1095_
Original report by @Joshix-1 on Aug 12, 2024
in #856 you mentioned that people should use ColorMapper and that was exactly what I wanted anyway. But as the named constructors do not have a colorMapper argument, I didn't know it existed as an option. The argument could be passed through to the SvgLoader which then could use it. That would be more convinient than having to use the unnamed constructor with the correct BytesLoader.
---
Comment by @Add00w on Sep 1, 2024
The answer is in the same issue [comment](https://github.com/dnfield/flutter_svg/issues/856#issuecomment-1549320661)
---
Comment by @Joshix-1 on Sep 1, 2024
I know how to use ColorMapper. That's not the issue. I want to use the named SvgPicture constructors and use ColorMapper.
---
Comment by @Ali1Ammar on Oct 16, 2024
currently to use ColorMapper , we need to use the loader directly (SvgAssetLoader/SvgFileLoader/SvgStringLoader/SvgBytesLoader classes) , and we can not use it with SvgPicture
which make it harder to use
| package,P2,p: flutter_svg | low | Minor |
2,656,395,882 | flutter | [flutter_svg] Failed to display svg with a mask attribute on Flutter 3.24 | _Imported from https://github.com/dnfield/flutter_svg/issues/1096_
Original report by @WeiCongcong on Aug 13, 2024
With the latest version flutter and flutter_svg, svg with a `mask` attribute could not be displayed.
For example: [us_flag](https://github.com/HatScripts/circle-flags/blob/gh-pages/flags/us.svg) could not be displayed. But if the mask attribute is removed (the shape will be changed), it could be displayed.
| package,P2,p: flutter_svg | low | Critical |
2,656,395,951 | flutter | [flutter_svg] Aspect ratio of container is not maintained when FittedBox is at play | _Imported from https://github.com/dnfield/flutter_svg/issues/1098_
Original report by @Ortes on Aug 19, 2024
When FlutterSvg is used with `contain` or `fitWidth` visually the svg is correctly fitted like the option but the container does not keep the aspect ratio of the svg.
For example if the SvgPicture is contained in a Container with a background the background is visible outside of the svg boundary.
Here is an illustration:

Code:
``` dart
Container(
width: 300,
color: Colors.green,
child: SvgPicture.asset(
'assets/background/svg/pattern-single.svg',
fit: BoxFit.fitWidth,
),
),
```
In this example my svg is 768x821 and I it is contained in a 300 width container as we can see the svg in the center look correct but the container is still 821 pixel tall which makes my background overflow above and bellow the svg. Would it be nicer if the container resized the same way ?
I have found 2 workaround:
``` dart
Container(
width: 300,
color: Colors.green,
child: AspectRatio(
aspectRatio: 768 / 821,
child: SvgPicture.asset(
'assets/background/svg/pattern-single.svg',
),
),
),
```
In this one you have to manually fill the pixel size of the image.
``` dart
Container(
width: 300,
color: Colors.green,
child: FittedBox(
child: SvgPicture.asset(
'assets/background/svg/pattern-single.svg',
),
),
),
```
This one works fine but I suppose you already use FittedBox in your code that is weird to use 2 nested Fittedbox Right ?
| package,P2,p: flutter_svg | low | Minor |
2,656,396,021 | flutter | [flutter_svg] Illegal argument in isolate message: object is unsendable - Library:'dart:async' Class: _Future | _Imported from https://github.com/dnfield/flutter_svg/issues/1099_
Original report by @8symbols on Sep 2, 2024
If you provide a `bundle` argument to `SvgPicture.asset` and use `Image.asset(...)`, then in profile and release modes the following exception will be thrown and svg won't be displayed:
<details>
<summary>Exception</summary>
```
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Illegal argument in isolate message: object is unsendable - Library:'dart:async' Class: _Future@4048458 (see restrictions listed at `SendPort.send()` documentation for more information)
<- _List len:8 (from dart:core)
<- _Map len:1 (from dart:collection)
<- Instance of 'PlatformAssetBundle' (from package:flutter/src/services/asset_bundle.dart)
<- Instance of 'SvgAssetLoader' (from package:flutter_svg/src/loaders.dart)
<- Context num_variables: 2 <- SvgLoader._load.<anonymous closure>.<anonymous closure> (from package:flutter_svg/src/loaders.dart)
<- Context num_variables: 2 <- compute.<anonymous closure> (from package:flutter/src/foundation/_isolates_io.dart)
<- resultPort in Instance of '_RemoteRunner<ByteData>' (from dart:isolate)
#0 Isolate._spawnFunction (dart:isolate-patch/isolate_patch.dart:398)
#1 Isolate.spawn (dart:isolate-patch/isolate_patch.dart:378)
#2 Isolate.run (dart:isolate:285)
#3 compute (package:flutter/src/foundation/_isolates_io.dart:18)
#4 compute (package:flutter/src/foundation/isolates.dart:82)
#5 SvgLoader._load.<anonymous closure> (package:flutter_svg/src/loaders.dart:154)
<asynchronous suspension>
#6 _VectorGraphicWidgetState._loadPicture.<anonymous closure> (package:vector_graphics/src/vector_graphics.dart:355)
<asynchronous suspension>
#7 _VectorGraphicWidgetState._loadPicture.<anonymous closure> (package:vector_graphics/src/vector_graphics.dart:369)
<asynchronous suspension>
#8 _VectorGraphicWidgetState._loadAssetBytes.<anonymous closure> (package:vector_graphics/src/vector_graphics.dart:402)
<asynchronous suspension>
```
</details>
That's because CachingAssetBundle [stores futures in its fields](https://github.com/flutter/flutter/blob/main/packages/flutter/lib/src/services/asset_bundle.dart#L187), SvgAssetLoader [stores bundle](https://github.com/dnfield/flutter_svg/blob/master/packages/flutter_svg/lib/src/loaders.dart#L363) (if you provided one) and SvgLoader somehow [sends it to other isolate in compute](https://github.com/dnfield/flutter_svg/blob/master/packages/flutter_svg/lib/src/loaders.dart#L154).
Debug build doesn't have this problem because [it doesn't use other isolate](https://github.com/dnfield/flutter_svg/blob/master/packages/flutter_svg/lib/src/utilities/compute.dart#L21).
Reproducible with Flutter 3.24.1 and `flutter_svg: 2.0.10+1`.
<details>
<summary>Sample app</summary>
`assets/any_svg.svg` and `assets/any_png.png` are literally any svg and png files respectively.
```dart
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
void main() {
runApp(
const MaterialApp(
home: Screen(),
),
);
}
class Screen extends StatelessWidget {
const Screen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Row(
children: [
SvgPicture.asset(
'assets/any_svg.svg',
bundle: DefaultAssetBundle.of(context),
),
Image.asset(
'assets/any_png.png',
width: 100.0,
height: 100.0,
),
],
),
);
}
}
```
</details>
Problem can be fixed with the following change, but I don't sure how adequate it is.
<details>
<summary>Change that fixes problem</summary>
```dart
Future<ByteData> _load(BuildContext? context) {
final SvgTheme theme = getTheme(context);
return prepareMessage(context).then((T? message) {
return _compute<T>(
message: message,
xml: provideSvg(message),
theme: theme,
colorMapper: colorMapper,
);
});
}
static Future<ByteData> _compute<T>({
required T? message,
required String xml,
required SvgTheme theme,
required ColorMapper? colorMapper,
}) {
return compute((T? message) {
return vg
.encodeSvg(
xml: xml,
theme: theme.toVgTheme(),
colorMapper: colorMapper == null
? null
: _DelegateVgColorMapper(colorMapper),
debugName: 'Svg loader',
enableClippingOptimizer: false,
enableMaskingOptimizer: false,
enableOverdrawOptimizer: false,
)
.buffer
.asByteData();
}, message, debugLabel: 'Load Bytes');
}
```
</details>
| package,P2,p: flutter_svg | low | Critical |
2,656,402,630 | flutter | package tool_format check should output diff | The packages repo tool format says which files require formatting. It would be helpful if it also printed the patch diff like the other format command does.
https://github.com/flutter/packages/blob/26e123a6ce039da6b75fe4248e93c8aeeb6d395b/script/tool/lib/src/format_command.dart#L196-L198
Current `tool_format` output:
```
Formatted lib/src/drive_examples_command.dart
Formatted test/drive_examples_command_test.dart
Formatted 94 files (2 changed) in 3.10 seconds.
```
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8731414599540111569/+/u/Run_package_tests/tool_format/stdout | team,package,c: proposal,team-ecosystem,P2,triaged-ecosystem | low | Minor |
2,656,412,202 | node | Expose the "enhanced" stack trace from uncaught exceptions to the `uncaughtException` and `uncaughtExceptionMonitor` handlers on `process` | ### What is the problem this feature will solve?
In my app, I have a logging system which writes entries to files and/or the network in a machine-parsable form. I use the `uncaughtException` handler on `process` in order to get uncaught exceptions written out to this logging system. I noticed that if there's no `uncaughtException` handler, Node will print out an extra stack trace to the console indicating the call site of the `<emitter>.emit('error', ...)` call which emitted the ultimately-uncaught exception. However, it seems like there's no programmatic way for me to get that extra trace in my own handler.
This feature will solve the problem of being able to programmatically extract this extra — and quite useful! — information in a way that works well with a system that eschews the console.
### What is the feature you are proposing to solve the problem?
I don't know what tactic would work best within the larger Node ecosystem, but as a straw-man suggestion:
Add a third argument to the `uncaughtException` and `uncaughtExceptionMonitor` callbacks when an "enhanced" error is available, containing information corresponding to the site and target of the `emit()` call. It could, for example, be a plain object containing an `Error` representing the call site and an object reference to the emitter itself. But if that's too dangerous, it might instead have strings representing that info. For example (in the former case), the following would nearly duplicate what the current default `uncaughtException` handler prints out to the console:
```js
process.on('uncaughtException', (err, origin, emitInfo) => {
console.log('%s', err.stack);
if (emitInfo) {
const { emitter, emitSite } = emitInfo;
console.log(`Emitted 'error' event of ${emitter.constructor.name} instance at:\n%s`,
emitSite.stack);
}
});
```
### What alternatives have you considered?
Having a separate process to scrape console output to find things that look like uncaught exceptions, so I can push them into the structured logging system. (Oof.) | events,feature request | low | Critical |
2,656,439,535 | pytorch | DISABLED test_comprehensive_matmul_cuda_float16 (__main__.TestInductorOpInfoCUDA) | Platforms: inductor
This test was disabled because it is failing in CI. See [recent examples](https://hud.pytorch.org/flakytest?name=test_comprehensive_matmul_cuda_float16&suite=TestInductorOpInfoCUDA&limit=100) and the most recent trunk [workflow logs](https://github.com/pytorch/pytorch/runs/32931469088).
Over the past 3 hours, it has been determined flaky in 5 workflow(s) with 5 failures and 5 successes.
**Debugging instructions (after clicking on the recent samples link):**
DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs.
To find relevant log snippets:
1. Click on the workflow logs linked above
2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work.
3. Grep for `test_comprehensive_matmul_cuda_float16`
4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs.
<details><summary>Sample error message</summary>
```
Traceback (most recent call last):
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/testing/_internal/common_device_type.py", line 1152, in test_wrapper
return test(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/testing/_internal/common_device_type.py", line 1434, in only_fn
return fn(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/testing/_internal/common_utils.py", line 2199, in wrapper
fn(*args, **kwargs)
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/testing/_internal/common_device_type.py", line 1229, in dep_fn
return fn(slf, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/testing/_internal/common_device_type.py", line 1229, in dep_fn
return fn(slf, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/testing/_internal/common_device_type.py", line 1229, in dep_fn
return fn(slf, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/testing/_internal/common_utils.py", line 1592, in wrapper
fn(*args, **kwargs)
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/testing/_internal/common_utils.py", line 1528, in wrapper
fn(*args, **kwargs)
File "/opt/conda/envs/py_3.12/lib/python3.12/unittest/mock.py", line 1395, in patched
return func(*newargs, **newkeywargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "/var/lib/jenkins/workspace/test/inductor/test_torchinductor_opinfo.py", line 955, in inner
raise e
File "/var/lib/jenkins/workspace/test/inductor/test_torchinductor_opinfo.py", line 947, in inner
fn(self, device, dtype, op)
File "/var/lib/jenkins/workspace/test/inductor/test_torchinductor_opinfo.py", line 1193, in test_comprehensive
raise e
File "/var/lib/jenkins/workspace/test/inductor/test_torchinductor_opinfo.py", line 1153, in test_comprehensive
self.check_model_gpu(
File "/opt/conda/envs/py_3.12/lib/python3.12/contextlib.py", line 81, in inner
return func(*args, **kwds)
^^^^^^^^^^^^^^^^^^^
File "/var/lib/jenkins/workspace/test/inductor/test_torchinductor.py", line 613, in check_model_gpu
check_model(
File "/var/lib/jenkins/workspace/test/inductor/test_torchinductor.py", line 564, in check_model
actual_grad = compute_grads(example_inputs, kwargs, actual, grads)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/lib/jenkins/workspace/test/inductor/test_torchinductor.py", line 351, in compute_grads
return torch.autograd.grad(
^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/autograd/__init__.py", line 496, in grad
result = _engine_run_backward(
^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/autograd/graph.py", line 825, in _engine_run_backward
return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/autograd/function.py", line 307, in apply
return user_fn(self, *args)
^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/_functorch/_aot_autograd/runtime_wrappers.py", line 1707, in backward
return impl_fn()
^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/_functorch/_aot_autograd/runtime_wrappers.py", line 1697, in impl_fn
out = CompiledFunction._backward_impl(ctx, all_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/_functorch/_aot_autograd/runtime_wrappers.py", line 2068, in _backward_impl
out = call_func_at_runtime_with_args(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/_functorch/_aot_autograd/utils.py", line 135, in call_func_at_runtime_with_args
out = normalize_as_list(f(*args))
^^^^^^^^
TypeError: 'NoneType' object is not callable
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/testing/_internal/common_utils.py", line 3057, in wrapper
method(*args, **kwargs)
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/testing/_internal/common_utils.py", line 3057, in wrapper
method(*args, **kwargs)
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/testing/_internal/common_device_type.py", line 460, in instantiated_test
result = test(self, **param_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/testing/_internal/common_utils.py", line 1592, in wrapper
fn(*args, **kwargs)
File "/opt/conda/envs/py_3.12/lib/python3.12/site-packages/torch/testing/_internal/common_device_type.py", line 1164, in test_wrapper
raise e_tracked from e
Exception: Caused by sample input at index 9: SampleInput(input=Tensor[size=(5, 10), device="cuda:0", dtype=torch.float16], args=TensorList[Tensor[size=(5, 10, 5), device="cuda:0", dtype=torch.float16]], kwargs={}, broadcasts_input=False, name='')
To execute this test, run the following from the base repo dir:
PYTORCH_OPINFO_SAMPLE_INPUT_INDEX=9 python test/inductor/test_torchinductor_opinfo.py TestInductorOpInfoCUDA.test_comprehensive_matmul_cuda_float16
This message can be suppressed by setting PYTORCH_PRINT_REPRO_ON_FAILURE=0
```
</details>
Test file path: `inductor/test_torchinductor_opinfo.py`
cc @clee2000 @ezyang @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @aakhundov | triaged,module: flaky-tests,skipped,oncall: pt2,module: inductor | low | Critical |
2,656,462,754 | flutter | [vector_graphics] Optimize: clips | _Imported from https://github.com/dnfield/vector_graphics/issues/21_
Original report by @dnfield on Mar 24, 2022
We should be able to pre-process clips such that we do not require any clipping at runtime.
For example, use path intersection logic to produce a path or set of paths that fit within the clipped area.
---
Comment by @dnfield on Apr 12, 2022
This has to take into account stroking properties altering the effective size of the path. For example, a path with a stroke width that != 1 or a non-butt cap will draw additional pixels that should be clipped.
For instance, the following relatively simple SVG cannot be clipped without tessellating the stroke into a fill (or at least into vertices):
```svg
<svg width="10" height="10">
<clipPath id="clip0">
<path d="M2 3h7.9v2H1" />
</clipPath>
<path d="M2, 5L8,6" stroke="black" stroke-linecap="round" stroke-width="2" clip-path="url(#clip0)" />
</svg>
```
| package,team-engine,p: vector_graphics | low | Minor |
2,656,462,883 | flutter | [vector_graphics] Optimize masks | _Imported from https://github.com/dnfield/vector_graphics/issues/22_
Original report by @dnfield on Mar 24, 2022
Masks should be optimized away. Today they have to be implemented with a saveLayer/RT switch, which is especially sad.
Consider this SVG:
```svg
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.094 17.092a.882.882 0 01-.623-1.503l2.656-2.66H4.28a.883.883 0 010-1.765h12.846L14.47 8.503a.88.88 0 011.245-1.245l4.611 4.611a.252.252 0 010 .354l-4.611 4.611a.876.876 0 01-.622.258z" fill="#424242" />
<mask id="a" maskUnits="userSpaceOnUse" x="3" y="7" width="18" height="11">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.094 17.092a.882.882 0 01-.623-1.503l2.656-2.66H4.28a.883.883 0 010-1.765h12.846L14.47 8.503a.88.88 0 011.245-1.245l4.611 4.611a.252.252 0 010 .354l-4.611 4.611a.876.876 0 01-.622.258z" fill="#fff" />
</mask>
<g mask="url(#a)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 0h24v24.375H0V0z" fill="#fff" />
</g>
</svg>
```
It is trivially expressed as a single path that should be fast to draw. We should be able to easily calculate everything here and just encode that path.
---
Comment by @dnfield on Mar 29, 2022
To clarify:
```svg
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.094 17.092a.882.882 0 01-.623-1.503l2.656-2.66H4.28a.883.883 0 010-1.765h12.846L14.47 8.503a.88.88 0 011.245-1.245l4.611 4.611a.252.252 0 010 .354l-4.611 4.611a.876.876 0 01-.622.258z" fill="#fff" />
</svg>
```
Draws the same thing as the above SVG with no masks, and would involve no saveLayers.
---
Comment by @dnfield on Mar 29, 2022
(Probably what happened is the designer drew the arrow, selected it, changed the color, and/or maybe used some kind of masking tool in the editor...?)
---
Comment by @dnfield on Jun 6, 2022
Relevant part of spec: https://www.w3.org/TR/SVG11/masking.html#Masking
---
Comment by @dnfield on Jun 6, 2022
MDN: https://developer.mozilla.org/en-US/docs/Web/SVG/Element/mask
---
Comment by @c-h-i-a-m-a-k-a-2 on Jul 20, 2022
Further Masking Optimizer improvement: Multi-path masks should be able to also be resolved.
Example:
```
<svg viewBox="-10 -10 120 120">
<mask id="myMask">
<rect x="0" y="0" width="100" height="100" fill="white" />
<path d="M10,35 A20,20,0,0,1,50,35 A20,20,0,0,1,90,35 Q90,65,50,95 Q10,65,10,35 Z" fill="black" />
</mask>
<polygon points="-10,110 110,110 110,-10" fill="orange" />
<circle cx="50" cy="50" r="50" mask="url(#myMask)" />
</svg>
```
---
Comment by @c-h-i-a-m-a-k-a-2 on Jul 20, 2022
Further Masking Optimizer improvement: Paths that have the "stroke-width" attribute set should be able to be optimized.
Example:
```
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<mask id="a" maskUnits="userSpaceOnUse" x="3" y="7" width="18" height="11">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15.094 17.092a.882.882 0 01-.623-1.503l2.656-2.66H4.28a.883.883 0 010-1.765h12.846L14.47 8.503a.88.88 0 011.245-1.245l4.611 4.611a.252.252 0 010 .354l-4.611 4.611a.876.876 0 01-.622.258z" fill="#fff" stroke-width="2"/>
</mask>
<g mask="url(#a)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M0 0h24v24.375H0V0z" fill="#fff" />
</g>
</svg>
```
| package,team-engine,p: vector_graphics | low | Minor |
2,656,463,003 | flutter | [vector_graphics] Optimize overdraw | _Imported from https://github.com/dnfield/vector_graphics/issues/23_
Original report by @dnfield on Mar 24, 2022
We should be able to eliminate overdraw. This will also require that we pre-calculate blends especially for overlapping transparent shapes. This will mean we can eliminate saveLayers related to group/overlapping opacity.
| package,team-engine,p: vector_graphics | low | Minor |
2,656,463,099 | flutter | [vector_graphics] Optimize paths | _Imported from https://github.com/dnfield/vector_graphics/issues/24_
Original report by @dnfield on Mar 24, 2022
Tessellating paths is showing good results. We should extend this to strokes as well as fills.
---
Comment by @c-h-i-a-m-a-k-a-2 on Jul 26, 2022
Stats from GPay sample assets:
<img width="593" alt="Screen Shot 2022-07-26 at 11 11 08 AM" src="https://user-images.githubusercontent.com/106709586/181080602-bb9b26af-ab4f-4f33-8262-427957bd677b.png">
| package,team-engine,p: vector_graphics | low | Minor |
2,656,471,677 | flutter | [vector_graphics] Add support for relative text sizing | _Imported from https://github.com/dnfield/vector_graphics/issues/45_
Original report by @jonahwilliams on Mar 31, 2022
| package,team-engine,p: vector_graphics | low | Minor |
2,656,471,761 | flutter | [vector_graphics] Add support for relative size paths | _Imported from https://github.com/dnfield/vector_graphics/issues/46_
Original report by @jonahwilliams on Mar 31, 2022
| package,team-engine,p: vector_graphics | low | Minor |
2,656,471,846 | flutter | [vector_graphics] Consider applying color filters to the rasterized vector graphic instead of the resulting image | _Imported from https://github.com/dnfield/vector_graphics/issues/72_
Original report by @jonahwilliams on May 20, 2022
Context: https://github.com/dnfield/vector_graphics/pull/71/files/f6ebe3b00725a95710a345e9e0642fd2911e69ce#diff-6aefb41d5a9139706f33aa4ae6d68a7ed1c69f1ec5ae78f16dbb1f1cc2bee325
The idea is that since some filter types may be expensive, it could be beneficial to performance to instead rasterize them instead of using Paint on the drawImage call. The trade-off here is that we'd have to re-rasterize if the filter changed
| package,team-engine,p: vector_graphics | low | Major |
2,656,471,934 | flutter | [vector_graphics] Set up Skia Gold | _Imported from https://github.com/dnfield/vector_graphics/issues/76_
Original report by @jonahwilliams on May 21, 2022
This may require moving to a flutter org repo.
I'd like to use an existing SVG test suite to ensure we're rendering correctly, especially as we work on new optimizations and features. I'd also like to not rely so much on customer scubas, as the volume itself is difficult to deal with
| package,team-engine,p: vector_graphics | low | Minor |
2,656,472,005 | flutter | [vector_graphics] <image> preserveAspectRatio support | _Imported from https://github.com/dnfield/vector_graphics/issues/112_
Original report by @jonahwilliams on Aug 2, 2022
Currently images are simply stretched to fill the given bounds. We should implement https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/preserveAspectRatio to allow customizing how this behaves
| package,team-engine,p: vector_graphics | low | Minor |
2,656,472,082 | flutter | [vector_graphics] runtime themeing of colors | _Imported from https://github.com/dnfield/vector_graphics/issues/119_
Original report by @jonahwilliams on Aug 17, 2022
I've spoken to several client teams that use some combination of SVG parsing and the SVG theme API to provide dynamic colors to an SVG. We should support a compile time option for this, perhaps accepting a map of identifier -> color in the VectorGraphic constructor.
TBD: how should we indicate dynamic color in the SVG?
---
Comment by @dnfield on Aug 17, 2022
I think part of this would be needing to make `currentColor` work.
Do you have some examples of what you'd like to support?
And is this `runtime` or `compiletime` support?
---
Comment by @jonahwilliams on Aug 17, 2022
Does currentColor work with more than one color? It would have to be runtime support, but implemented so that the compiler didn't optimize these colors out
---
Comment by @dnfield on Aug 17, 2022
No, currentColor is just one color and a hard coded string in the doc.
Every time I've come up against this problem it hasn't been clear to me how to do it in an abstract way short of just offering color filtering. I vaguely remember considering some kind of `Map<Color, Color>` solution, but also being worried it'd get hard to reason about when tranparency/gradients/overlapping colors get involved.
---
Comment by @jonahwilliams on Aug 17, 2022
Yeah, if you have a dynamic color you basically can't do any optimizations/folding with it. I think that could still work, but we'd also still need a way to declare it, and I wonder if we could just steal use css classes or ids?
---
Comment by @dnfield on Aug 17, 2022
It'd help to have some examples of what the internal customers are currently doing and what they expect to achieve.
| package,team-engine,p: vector_graphics | low | Minor |
2,656,472,170 | flutter | [vector_graphics] Optimize patterns | _Imported from https://github.com/dnfield/vector_graphics/issues/122_
Original report by @dnfield on Aug 23, 2022
Patterns which only ever tile their image once do not need to create an image shader and can be replaced with a simple draw call.
| package,team-engine,p: vector_graphics | low | Minor |
2,656,472,250 | flutter | [vector_graphics] Backwards/Forward compatibility | _Imported from https://github.com/dnfield/vector_graphics/issues/129_
Original report by @jonahwilliams on Sep 1, 2022
## Overview
We'd still like the ability to make major revisions, so we'll communicate via semver: Major changes indicate that the format is completely incompatible with old clients. Minor changes indicate that both new clients can use old vg files and old clients can use new vg files. At the time of a major version release, we can increment the version number and possibly consider bundling the old decoder as a fallback - but this is out of scope at the time.
## Background
The VG binary format is divided into sections which compose a topologically sorted description of a Flutter picture. The intention is that we can trivially convert the binary format into a Flutter picture "online" without creating and traversing a secondary tree structure. First, we describe shaders and gradients. Then we describe paints, which may reference those shaders/gradients. Then we describe paths. Then we describe text. Then finally we describe commands which may reference any of those objects.
Each section is composed of objects which are indicated by an integer identifier that is specific to that section. Each object is then composed of a fixed size number of fields that are implicit in the type of that object.
## Adding backwards/forwards compatibility.
There are a few dimensions to backwards compatibility. One would be the ability to add new fields to existing objects.
Consider the encoded paint. Suppose we want to add the ability to provide a `ColorFilter` object. Today we would expand the size of the object, breaking old clients. An alternative to allow objects to consider growing is to include the size of the object as the first field after the type. This would allow old clients to ignore and read past unknown new fields, while new clients could fill in default values. This does not allow re-arranging of existing fields. Newly added values would need to be nullable in the decoder, or have default values provided. This would need to handled on a case by case basis.
Another dimension of backwards compatibility is new command types. This can be handled by making the command decode tolerate and skip over these commands with an embedded size tag.
The next dimension would be the addition of new sections. Because the sections are in a reasonable topological order, we need to be more careful. Instead of a more generic solution, let us consider some known missing features: filters and _. We know that these will need to be defined before paint, so we will simply insert an empty section that could be filled in later on. We also give each command section a header size and update the decoder to skip over them.
This does not address all possible backwards compatibility problems, but does allow continued iteration. A major backwards compatibility change could allow us to make further changes, but none are known at this time
---
Comment by @dnfield on Sep 1, 2022
One thing that might get sad:
Let's say we come up with some way to significantly compress the size of the binary (for example, when we dropped precision by at least half a ways back).
That will always be a major break. Our Google based customers won't really care that we're using semver unless we completely fork the thing internally, which I don't think we or they will want.
I guess the main thing is: if and once we do this, we've created a format we're committed to supporting. That might be ok but it's contrary to our initial design goals.
In particular, there will be little to no reason to run the compiler as part of the build anymore, and destructive optimizations may make it nearly impossible to recover any meaningful vector data once compilation has occurred. And customers will have no way to know if they got the latest optimizations or not, or even necessarily what optimizations could still be applied.
---
Comment by @jonahwilliams on Sep 1, 2022
> I guess the main thing is: if and once we do this, we've created a format we're committed to supporting. That might be ok but it's contrary to our initial design goals.
Yes this is true, but at the time I think we were a bit more hopeful this could be solved with infra on the client teams side. If thats less possible than we initially thought then we should change course instead.
> That will always be a major break. Our Google based customers won't really care that we're using semver unless we completely fork the thing internally, which I don't think we or they will want.
We could techinically bundle both old and new. The decoders are quite small. If we did this, say, once a year for 10 years. We'd end up with 10 decoders to maintian forever. If we assume they can share a lot of code, its not the worst but its definitely more complicated than having a single active version.
> In particular, there will be little to no reason to run the compiler as part of the build anymore, and destructive optimizations may make it nearly impossible to recover any meaningful vector data once compilation has occurred. And customers will have no way to know if they got the latest optimizations or not, or even necessarily what optimizations could still be applied
I'm not following this at all
---
Comment by @dnfield on Sep 1, 2022
Customers will stop rebuilding using the latest version of the compiler and miss out on optimizations we add.
---
Comment by @jonahwilliams on Sep 1, 2022
for network assets, yes that is true. Also worth considering that impeller will have completely different performance characteristics, so we may want to actually make more intrusive changes based on expected renderer as well. Though its not quite far enough along for extensive benchmarking
---
Comment by @zanderso on Sep 1, 2022
Breaking changes only need a migration path between two successive versions. A totally cromulent migration path is, "Over the course of the next N months, you must stop using old assets." Client teams can deploy updates to achieve that.
---
Comment by @jonahwilliams on Sep 1, 2022
That could also be achieved by bundling more than one version of the decoder at a time. i.e. we have 1 major version per year, and we support the last major version, which gives folks a 2 year migration window.
---
Comment by @jonahwilliams on Sep 1, 2022
That is, the policy + bundling multiple deocders could allow us to have "major versions"
| package,team-engine,p: vector_graphics | low | Major |
2,656,472,319 | flutter | [vector_graphics] Overdraw optimization can leave artifacts | _Imported from https://github.com/dnfield/vector_graphics/issues/139_
Original report by @dnfield on Oct 3, 2022
This svg:
```
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="57 42 20 20">
<g>
<g>
<path d=" M 77 49.767 L 74.095 49.767 L 74.095 44.905 L 69.233 44.905 L 69.233 42 L 77 42 L 77 49.767 Z " fill="rgb(111,161,234)"/>
<rect x="70.937" y="42.145" width="2.905" height="8.93" transform="matrix(-0.707,-0.707,0.707,-0.707,90.618,130.756)" fill="rgb(111,161,234)"/>
</g>
</g>
</svg>
```

---
Comment by @dnfield on Oct 3, 2022
In this case, because the paths are the same color, we could safely merge them instead of creating distinct ones. If they were different colors, we could not and would end up with these AA related issues.
| package,team-engine,p: vector_graphics | low | Minor |
2,656,472,406 | flutter | [vector_graphics] Extract Impeller tessellation code to allow for stroke to vertices conversion | _Imported from https://github.com/dnfield/vector_graphics/issues/158_
Original report by @jonahwilliams on Nov 5, 2022
With impeller we believe that this will still be a performant path. Furthermore, it may allow even more SVG simplification if we the overdraw optimizer can work on these paths. FYI @dnfield
| package,team-engine,p: vector_graphics | low | Minor |
2,656,472,496 | flutter | [vector_graphics] Combine shapes where possible | _Imported from https://github.com/dnfield/vector_graphics/issues/159_
Original report by @dnfield on Nov 7, 2022
We can do this for shapes with identical painting properties when
- The shapes have no overlap
- Any overlap is completely opaque
This would have the benefit of safely removing overdraw in some cases.
| package,team-engine,p: vector_graphics | low | Minor |
2,656,472,582 | flutter | [vector_graphics] [Suggestion] Automatically convert and create asset class | _Imported from https://github.com/dnfield/vector_graphics/issues/177_
Original report by @ikbendewilliam on Feb 5, 2023
I've played around with the vector graphics and have a suggestion, a simple annotation where you can set all data to convert the svg's into vector files. I've made a working PoC ([fork](https://github.com/ikbendewilliam/vector_graphics/tree/feature/generate-vec-from-svg-using-annotation)) that does the following:
This package provides a tool to generate vector graphics from svg files and creates a dart file with the vector graphics locations.
For example if you have the following structure:
```bash
- assets
- images
- subfolder
- squares.svg
- flutter.svg
- different_folder
- green_rectangle.svg
```
And the following annotation:
```dart
@VectorGraphics(
svgSources: [
VectorGraphicsSource(
input: 'assets/different_folder/green_rectangle.svg',
),
VectorGraphicsSource(
inputDir: 'assets/images',
),
],
)
class VectorGraphicsAssets {}
```
The generator will create .vec files for each svg and create a dart file with the following content:
```dart
class VectorGraphicsAssets {
static const greenRectangle = 'assets/different_folder/green_rectangle.vec';
static const squares = 'assets/images/subfolder/squares.vec';
static const flutter = 'assets/images/flutter.vec';
}
```
I'd love to hear some opinions. The upside is that it is easier to convert, there is automatically a class with all paths and it is updated quite easily. The downside is the use of build_runner, this might not be the best place and the converter command might already be sufficient. 🤔
---
Comment by @dnfield on Feb 9, 2023
Neat. I haven't though enough about this yet to know if it's really the right path forward but it seems interesting. We've been talking with the flutter_tools team about having some kind of asset transformation available in the build process itself.
/cc @jonahwilliams @andrewkolos FYI
---
Comment by @jonahwilliams on Feb 9, 2023
One big caveat is that we've intentionally avoided specing anything around generating source code. its really unclear what the path forward there would be, at least until we have more information on macros. I suspect that will only come after Dart 3.
---
Comment by @ikbendewilliam on Feb 9, 2023
> One big caveat is that we've intentionally avoided specing anything around generating source code. its really unclear what the path forward there would be, at least until we have more information on macros. I suspect that will only come after Dart 3.
I understand, however this might still take some time as they are indeed working hard on Dart 3. I think I'll have another look and discuss with my colleagues if it's worth releasing a package like this (under my account). It makes it easier to adapt to vector_graphics as you can just add the SVG and a class is generated. But will be obsolete or converted when macro's become available or something similar.
---
Comment by @dnfield on Feb 9, 2023
If you're interested in maintaining this package I'd be happy to mention it in the readme in this repo. I'd rather keep it separate for now.
---
Comment by @ikbendewilliam on Feb 10, 2023
That would be perfect, I'll let you know if we decide something 😄
---
Comment by @ikbendewilliam on Feb 13, 2023
I'm going to check some stuff and make sure that it only generates bin files that it needs to generate etc. Optimise and add some tests. Then I'll publish it and let you know 👍
---
Comment by @ikbendewilliam on Mar 6, 2023
You can find the repo here: https://github.com/ikbendewilliam/vector_graphics_generator
I'll give you a pub.dev link when I'm ready to publish 😁
---
Comment by @oravecz-jpmc on Jul 3, 2024
I would rather see a build tool that pulls SVG files from a folder and generates a discrete Icon component for each. The Icon component contains the compiled svg run through the codec and embedded in the icon class.
I don't think the new asset transformation pipeline or macro support will enable this. Perhaps the Mason/Bricks library would with a pre-gen step to identify the relavant SVG files.
The reason why this is important is to enable tree shaking for large icon libraries. If I use one icon from a package containing 1,000 icons, I don't want to pay the file size penalty for all icons.
| package,p: vector_graphics | low | Minor |
2,656,472,657 | flutter | [vector_graphics] Pattern sizing is wrong | _Imported from https://github.com/dnfield/vector_graphics/issues/182_
Original report by @dnfield on Feb 13, 2023
The size of the pattern is being calculated - it's being done in reference to the root viewbox instead of the destination shape - this will often mean that the pattern image is being drawn with too much spacing around it instead of tiling nicely inside the shape. I'll file a separate bug for that.
For example, the SVG at https://developer.mozilla.org/en-US/docs/Web/SVG/Element/pattern shoudl show ten repeated "stars" across the first circle, but in our case it's calculating the width of the star image based on the viewbox (so 10% of 230 which is 23) instead of the width of the circle (which is 100, so 10% should be 10).
SVG:
```
<svg viewBox="0 0 230 100" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="star" viewBox="0,0,10,10" width="10%" height="10%">
<polygon points="0,0 2,5 0,10 5,8 10,10 8,5 10,0 5,2" />
</pattern>
</defs>
<circle cx="50" cy="50" r="50" fill="url(#star)" />
<circle
cx="180"
cy="50"
r="40"
fill="none"
stroke-width="20"
stroke="url(#star)" />
</svg>
```
| package,team-engine,p: vector_graphics | low | Critical |
2,656,472,754 | flutter | [vector_graphics] Allow transition between placeholder and loaded image to have an animation | _Imported from https://github.com/dnfield/vector_graphics/issues/193_
Original report by @jaggernod on Mar 9, 2023
Images fetched from the network can take significant time to load.
Unfortunately, when a placeholder is defined and the remote asset is loaded we see an immediate switch (pop-in).
Could we provide animation for the transition or have a crossfade (with user-defined duration) between the placeholder and the final image?
The original `flutter_svg` already had this question [posted](https://github.com/dnfield/flutter_svg/issues/796).
P.S. Thank you for the package. It is really useful
---
Comment by @dnfield on Mar 9, 2023
I'm open to this but doubt I will have time to work on it myself anytime soon.
| package,p: vector_graphics | low | Minor |
2,656,472,850 | flutter | [vector_graphics] Question/Improvement: Invalid double "100%" | _Imported from https://github.com/dnfield/vector_graphics/issues/209_
Original report by @AlexDochioiu on Jul 1, 2023
Hey,
I saw this issue reported in Crashlytics. Seems that one SVG contains a percentage instead of a double value somewhere. Not sure whether this is something that could be supported as a feature, or if it's a bad SVG in the first place.
Unfortunately my app deals with a lot of unmanaged online content and I do not have means to obtain the actual SVG that caused this issue.
Sorry for being a bit vague ; I don't really have more info I can provide though.
<img width="585" alt="image" src="https://github.com/dnfield/vector_graphics/assets/38853913/d56bd1be-18b7-48b3-ba2d-745d1452f7f8">
---
Comment by @fransdhinta on Oct 3, 2024
I had the same issue, when using the [flutter_svg](https://pub.dev/packages/flutter_svg) package that depends on this package, and saw a similar error. After checking, this was because when calling the **parseDouble** function, it returned double.parse instead of double.tryParse, in my case it tried to parse "none".
I suggest a fix or check this PR: https://github.com/dnfield/vector_graphics/pull/257 to change the return of **parseDouble** to always double.tryParse so that it will return `null` instead of throwing an error if it parses an invalid String
| package,p: vector_graphics | low | Critical |
2,656,476,348 | flutter | [vector_graphics] Updating colors and shaders at runtime | _Imported from https://github.com/dnfield/vector_graphics/issues/213_
Original report by @aloisdeniel on Aug 24, 2023
One of the benefits of vector graphics is their ability to be updated at runtime. It is pretty common, for example, to change icon's color regarding the brightness or accent color.
I know that `ColorMapper` allows us to do it with SVG, but it would be even better to allow this for binary vector graphics too. My idea is that I will pre-compile all my SVG assets as binary content to make it more efficient to load.
Therefore it would be great if we could override the color table directly in `FlutterVectorGraphicsListener` to update several colors of our vector images.
I would probably create a class like :
```dart
class VectorStylesOverride {
const VectorStylesOverride({
this.shaders = const <int,Shader>{},
this.paints = const <int,Paint>{},
});
final Map<int,Shader> shaders;
final Map<int,Paint> paints;
}
```
Add a property to `FlutterVectorGraphicsListener` :
```dart
final VectorStylesOverride? styleOverrides;
```
And then in the code, when we inserting a paint or shader, we first look at overrides :
```dart
@override
void onPaintObject({
required int color,
required int? strokeCap,
required int? strokeJoin,
required int blendMode,
required double? strokeMiterLimit,
required double? strokeWidth,
required int paintStyle,
required int id,
required int? shaderId,
}) {
assert(_paints.length == id, 'Expect ID to be ${_paints.length}');
/// If we add an override we add it to the paints instead
final Map<int, Paint>? overrides = _styleOverrides?.paints;
if (overrides != null) {
final Paint? override = overrides[id];
if (override != null) {
_paints.add(override);
return;
}
}
// ...
```
Also since `FlutterVectorGraphicsListener` constructor's is private I can't even override this method in a subclass.

Another way of doing this would be to update the binary data from the overrides before reading it, like the `ColorMapper` for SVG.
When using an image we probably would have to create a unique id when giving overrides to cache this alternate version.
---
Comment by @aloisdeniel on Aug 31, 2023
Here is an example of such a listener if `FlutterVectorGraphicsListener ` would have a `raw` public constructor instead of `_`.
```dart
class OverridesFlutterVectorGraphicsListener
extends FlutterVectorGraphicsListener {
factory OverridesFlutterVectorGraphicsListener({
required Map<int, int> colorOverrides,
int id = 0,
Locale? locale,
TextDirection? textDirection,
bool clipViewbox = true,
@visibleForTesting
DefaultPictureFactory pictureFactory = const DefaultPictureFactory(),
}) {
final PictureRecorder recorder = pictureFactory.createPictureRecorder();
return OverridesFlutterVectorGraphicsListener.raw(
id,
pictureFactory,
recorder,
pictureFactory.createCanvas(recorder),
locale,
textDirection,
clipViewbox,
colorOverrides,
);
}
OverridesFlutterVectorGraphicsListener.raw(
int id,
DefaultPictureFactory pictureFactory,
PictureRecorder recorder,
Canvas canvas,
Locale? locale,
TextDirection? textDirection,
bool clipViewbox,
this.colorOverrides,
) : super.raw(
id,
pictureFactory,
recorder,
canvas,
locale,
textDirection,
clipViewbox,
);
final Map<int, int> colorOverrides;
@override
void onLinearGradient(
double fromX,
double fromY,
double toX,
double toY,
Int32List colors,
Float32List? offsets,
int tileMode,
int id,
) {
final colorValues = <int>[];
for (var color in colors) {
final replacedColor = colorOverrides[_colorValue(color)];
colorValues.add(replacedColor ?? color);
}
super.onLinearGradient(
fromX,
fromY,
toX,
toY,
Int32List.fromList(colorValues),
offsets,
tileMode,
id,
);
}
@override
void onPaintObject({
required int color,
required int? strokeCap,
required int? strokeJoin,
required int blendMode,
required double? strokeMiterLimit,
required double? strokeWidth,
required int paintStyle,
required int id,
required int? shaderId,
}) {
/// If we add an override we add it to the paints instead
final int? override = colorOverrides[_colorValue(color)];
if (override != null) {
return super.onPaintObject(
id: id,
color: override,
strokeCap: strokeCap,
strokeJoin: strokeJoin,
blendMode: blendMode,
strokeMiterLimit: strokeMiterLimit,
strokeWidth: strokeWidth,
paintStyle: paintStyle,
shaderId: shaderId,
);
}
return super.onPaintObject(
id: id,
color: color,
strokeCap: strokeCap,
strokeJoin: strokeJoin,
blendMode: blendMode,
strokeMiterLimit: strokeMiterLimit,
strokeWidth: strokeWidth,
paintStyle: paintStyle,
shaderId: shaderId,
);
}
final _colorData = ByteData(4);
int _colorValue(int value) {
_colorData.setInt32(0, value);
return _colorData.getUint32(0);
}
}
```
| package,p: vector_graphics | low | Minor |
2,656,476,448 | flutter | [vector_graphics] not support svg group | _Imported from https://github.com/dnfield/vector_graphics/issues/214_
Original report by @kecson on Sep 7, 2023
https://api-mainnet.suifrens.sui.io/suifrens/0xb58aa2d1d137e480f8bd55094da2bb569cd51e2eb7d9415f7cd5a3c40cbd580b/svg

| package,p: vector_graphics | low | Minor |
2,656,476,548 | flutter | [vector_graphics] Ignore hits on transparent parts of the image | _Imported from https://github.com/dnfield/vector_graphics/issues/217_
Original report by @bramp on Oct 10, 2023
It seems the entire rectangle of the `RenderVectorGraphic` [absorbs hits](https://github.com/dnfield/vector_graphics/blob/c1782b87502fe0e4760dff748bd0cfdcd9407672/packages/vector_graphics/lib/src/render_vector_graphic.dart#L188) (for example when a user taps the screen).
Would it be possible to adjust the hitTestSelf to only return true if the hit is on a non-transparent part of the SVG?
---
Comment by @dnfield on Oct 10, 2023
That would be expensive and probably not quite the desired behavior in a lot of cases.
Imagine, for example, you have an icon you're painting on a button - you don't want to do expensive hit testing logic to see if the hit falls within some complicated path describing the outline of the icon just to end up getting a hit on the button "under" it...
---
Comment by @bramp on Oct 10, 2023
Oh absolutely, it's not desirable for every use case. Maybe I should have framed it as "Could you make it optional" to ignore hits in the transparent parts of the SVG.
In my use case, I have a circular button drawn as a SVG, and with the current hit test you can hit outside of the bounds of what's visible, which is undesirable.
I suspect the work around, is for me calculating a mask and implementing my own "hit test" on top of the SVG.
| package,p: vector_graphics | low | Minor |
2,656,476,796 | flutter | [vector_graphics] Wrong coloring on iOS with Impeller | _Imported from https://github.com/dnfield/vector_graphics/issues/225_
Original report by @Ronan-V on Nov 26, 2023
First of all, I'd like to thank you for your work on this package !
I have some SVGs which are rendered differently when Impeller is running on iOS.
Here are the screenshots:
<details><summary>SVG without Impeller and opacity to 1</summary>
<p>
<img src="https://github.com/dnfield/vector_graphics/assets/57215750/3245e44f-b096-49be-8dec-c5e6806b3e4e" width="140" height="280">
</p>
</details>
<details><summary>SVG with Impeller and opacity to 1</summary>
<p>
<img src="https://github.com/dnfield/vector_graphics/assets/57215750/a1110e55-e614-48cb-8aaa-7363c710b06d" width="140" height="280">
</p>
</details>
<details><summary>SVG with Impeller and opacity to 0.6</summary>
<p>
<img src="https://github.com/dnfield/vector_graphics/assets/57215750/ac4670e6-0e3b-4086-a3aa-f73bb8bf1636" width="140" height="280">
</p>
</details>
Unfortunately my knowledge of SVGs is limited, so I can't help you much. There seems to be a problem with the coloring of some shapes, which are colored when they shouldn't be. I can't share the SVG code, so please let me know if I can help with more information.
---
Comment by @dnfield on Nov 27, 2023
Can you share the SVGs that fail to render correctly, as well as the exact code you're using to do the rendering?
Can you also share whether this reproduces on simulator only or on physical device as well? Simulators have some different rendering characteristics and sometimes the Metal emulation doesn't really work quite correctly (as in, it works more like Metal on desktop than Metal on iOS, but also not quite like Metal on desktop).
---
Comment by @Ronan-V on Nov 27, 2023
I tried on both simulator and physical device and the result is the same.
Here is the SVG I used:
<details><summary>Details</summary>
<p>
`<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512" xml:space="preserve">
<path d="M361.187 88.16h-1.002a7.514 7.514 0 1 0 0 15.028h1.002c4.151 0 7.514-3.364 7.514-7.514s-3.363-7.514-7.514-7.514zm32.058 0h-1.002a7.514 7.514 0 1 0 0 15.028h1.002c4.151 0 7.514-3.364 7.514-7.514s-3.363-7.514-7.514-7.514zm32.058 0h-1.002a7.514 7.514 0 1 0 0 15.028h1.002c4.151 0 7.514-3.364 7.514-7.514s-3.363-7.514-7.514-7.514zm-32.058-24.044h-1.002a7.514 7.514 0 1 0 0 15.028h1.002a7.513 7.513 0 0 0 7.514-7.514 7.513 7.513 0 0 0-7.514-7.514zm-32.058 48.088h-1.002a7.514 7.514 0 1 0 0 15.028h1.002c4.151 0 7.514-3.364 7.514-7.514s-3.363-7.514-7.514-7.514zm32.058 0h-1.002a7.514 7.514 0 1 0 0 15.028h1.002c4.151 0 7.514-3.364 7.514-7.514s-3.363-7.514-7.514-7.514zm32.058 0h-1.002a7.514 7.514 0 1 0 0 15.028h1.002c4.151 0 7.514-3.364 7.514-7.514s-3.363-7.514-7.514-7.514zm-64.116 24.043h-1.002a7.514 7.514 0 0 0 0 15.028h1.002a7.513 7.513 0 0 0 7.514-7.514 7.513 7.513 0 0 0-7.514-7.514zm32.058 0h-1.002a7.514 7.514 0 0 0 0 15.028h1.002a7.513 7.513 0 0 0 7.514-7.514 7.513 7.513 0 0 0-7.514-7.514zm32.058 0h-1.002a7.514 7.514 0 0 0 0 15.028h1.002a7.513 7.513 0 0 0 7.514-7.514 7.513 7.513 0 0 0-7.514-7.514zm-32.058 24.044h-1.002a7.514 7.514 0 1 0 0 15.028h1.002a7.513 7.513 0 0 0 7.514-7.514 7.513 7.513 0 0 0-7.514-7.514zm113.326 281.374c-6.114-32.552-20.473-78.429-54.165-112.122-10.545-10.545-22.971-19.894-36.929-27.787a7.513 7.513 0 1 0-7.397 13.08c12.776 7.225 24.115 15.749 33.699 25.333 24.703 24.702 38.386 56.973 45.942 86.333a78.725 78.725 0 0 0-34.242 16.529l-23.632-23.632 6.022-6.022a7.513 7.513 0 1 0-10.626-10.625l-6.021 6.021-17.71-17.709 6.021-6.021a7.513 7.513 0 1 0-10.626-10.625l-6.021 6.021-17.709-17.709 6.021-6.021a7.513 7.513 0 1 0-10.626-10.625l-6.021 6.021-23.633-23.633a78.702 78.702 0 0 0 16.547-34.323c9.047 2.328 18.366 5.236 27.656 8.88a7.515 7.515 0 0 0 5.489-13.99C333.857 267.555 279.559 270 277.272 270.112a7.512 7.512 0 0 0-7.127 7.128c-.057 1.127-1.308 28.003 5.266 63.01 6.114 32.552 20.473 78.429 54.166 112.122 33.694 33.694 79.57 48.053 112.122 54.166 24.97 4.69 45.801 5.397 56.104 5.397 2.617 0 5.559.27 8.146-.297 3.27-.716 5.722-3.62 5.89-6.962.055-1.126 1.306-28.002-5.268-63.011zm-221.502-156.64c10.405.059 31.303.903 55.743 5.781-2.535 12.372-8.557 23.585-17.58 32.606-8.922 8.923-20.035 14.936-32.286 17.513-4.92-24.52-5.799-45.481-5.877-55.9zm55.132 156.719c-24.658-24.656-38.336-56.856-45.902-86.173a78.854 78.854 0 0 0 33.99-16.477l23.634 23.634-6.021 6.021a7.513 7.513 0 0 0 0 10.625c2.895 2.894 7.731 2.894 10.626 0l6.021-6.021 17.709 17.709-6.021 6.021a7.513 7.513 0 0 0 0 10.625c2.895 2.894 7.731 2.894 10.626 0l6.021-6.021 17.709 17.709-6.021 6.021a7.513 7.513 0 0 0 0 10.625c2.895 2.895 7.731 2.894 10.626 0l6.021-6.021 23.632 23.632a78.697 78.697 0 0 0-16.481 34.025c-29.298-7.562-61.481-21.246-86.169-45.934zm100.821 49.29c2.568-12.261 8.564-23.367 17.515-32.319 9-9 20.186-15.018 32.528-17.563 4.892 24.446 5.766 45.334 5.845 55.733-10.426-.071-31.377-.935-55.888-5.851zM119.749 320.582c-39.497 0-71.63 32.133-71.63 71.63s32.133 71.63 71.63 71.63 71.63-32.133 71.63-71.63-32.133-71.63-71.63-71.63zM77.823 430.199c-9.115-10.051-14.677-23.381-14.677-37.987a56.243 56.243 0 0 1 7.972-28.922c10.757 9.19 17.073 22.672 17.073 36.937 0 10.982-3.654 21.444-10.368 29.972zm41.926 18.615c-11.197 0-21.636-3.282-30.431-8.914 9.003-11.241 13.901-25.11 13.901-39.674 0-18.86-8.409-36.691-22.737-48.724 10.186-9.829 24.029-15.893 39.267-15.893s29.081 6.064 39.267 15.893c-14.328 12.034-22.737 29.864-22.737 48.724 0 14.564 4.898 28.433 13.901 39.675a56.25 56.25 0 0 1-30.431 8.913zm41.926-18.616c-6.714-8.529-10.369-18.989-10.369-29.971 0-14.264 6.316-27.747 17.073-36.937a56.246 56.246 0 0 1 7.972 28.922c.001 14.605-5.56 27.935-14.676 37.986zM135.778 0C60.927 0 .032 60.896.032 135.746s60.896 135.746 135.746 135.746 135.746-60.896 135.746-135.746S210.629 0 135.778 0zm111.108 88.552a119.699 119.699 0 0 1 6.541 20.086l-9.971-7.877 3.43-12.209zM236.66 69.524a7.598 7.598 0 0 0-.234.697l-7.704 27.426-43.309 14.072-42.12-28.081V35.579l24.394-16.263c28.626 7.853 53.032 26.005 68.973 50.208zm-61.888 54.662-12.318 43.123a7.457 7.457 0 0 0-2.418.996h-48.514a7.48 7.48 0 0 0-2.418-.996l-12.32-43.123c.153-.315.297-.636.408-.979.102-.316.175-.632.234-.95l38.353-25.569 38.353 25.569c.059.318.132.634.234.95.109.343.253.665.406.979zM135.779 15.027c3.554 0 7.072.163 10.55.467l-10.55 7.034-10.55-7.034a121.91 121.91 0 0 1 10.55-.467zm-31.854 4.274c.202.167.414.328.637.477l23.702 15.801v48.06l-42.12 28.081-43.31-14.073-7.911-28.164c15.952-24.198 40.368-42.341 69.002-50.182zM24.67 88.552l3.43 12.208-9.971 7.877a119.72 119.72 0 0 1 6.541-20.085zm-9.612 47.194a123.6 123.6 0 0 1 .14-5.726c.215-.137.436-.261.64-.423l22.352-17.659 43.501 14.134 14.629 51.2-25.498 35.095-29.212-1.178c-16.603-20.682-26.552-46.92-26.552-75.443zm41.584 91.089 12.587.508 4.385 11.85a121.53 121.53 0 0 1-16.972-12.358zm121.76 21.851c-13.261 5.021-27.626 7.779-42.625 7.779-15.017 0-29.4-2.765-42.676-7.799a7.446 7.446 0 0 0-.233-.75L82.98 221.2l27.512-37.867h50.573l27.512 37.867-10.175 27.486zm19.539-9.493 4.385-11.85 12.587-.507a121.442 121.442 0 0 1-16.972 12.357zm31.974-27.967a7.44 7.44 0 0 0-.717-.007l-28.464 1.148-25.498-35.095 14.629-51.2 43.501-14.134 22.996 18.168c.086 1.869.136 3.749.136 5.64-.001 28.54-9.962 54.794-26.583 75.48z" fill="#5d2bff" data-original="#000000" opacity="1"/>
</svg>`
</p>
</details>
For the code, we can simplify by using the package's example _svg_string.dart_ and only replacing the content of the _flutterLogoString with the svg code.
<details><summary>svg_string example</summary>
<p>
<img src="https://github.com/dnfield/vector_graphics/assets/57215750/7a37a36d-22ba-4f46-bdbb-ee9a24568ab9" width="150" height="280">
</p>
</details>
---
Comment by @dnfield on Nov 27, 2023
Great, thanks! This is a bug in Impeller's path rendering code.
---
Comment by @Ronan-V on Dec 5, 2023
You're welcome ! Ok, should I post an issue somewhere else then ?
| package,p: vector_graphics | low | Critical |
2,656,476,902 | flutter | [vector_graphics] optimize-clips incorrect with clipPath | _Imported from https://github.com/dnfield/vector_graphics/issues/226_
Original report by @xvrh on Jan 5, 2024
I have this icon
```xml
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" fill="none">
<defs>
<clipPath id="a">
<path fill="#fff" d="M0 0h15v15H0z"/>
</clipPath>
</defs>
<g fill="#374957" clip-path="url(#a)">
<path d="M11.875 1.25h-.625V.625a.625.625 0 1 0-1.25 0v.625H5V.625a.625.625 0 0 0-1.25 0v.625h-.625A3.129 3.129 0 0 0 0 4.375v7.5A3.129 3.129 0 0 0 3.125 15h8.75A3.129 3.129 0 0 0 15 11.875v-7.5a3.129 3.129 0 0 0-3.125-3.125ZM1.25 4.375A1.875 1.875 0 0 1 3.125 2.5h8.75a1.875 1.875 0 0 1 1.875 1.875V5H1.25v-.625Zm10.625 9.375h-8.75a1.875 1.875 0 0 1-1.875-1.875V6.25h12.5v5.625a1.875 1.875 0 0 1-1.875 1.875Z"/>
<path d="M7.5 10.313a.937.937 0 1 0 0-1.875.937.937 0 0 0 0 1.874ZM4.375 10.313a.937.937 0 1 0 0-1.875.937.937 0 0 0 0 1.874ZM10.625 10.313a.937.937 0 1 0 0-1.875.937.937 0 0 0 0 1.874Z"/>
</g>
</svg>
```
When I compile it with `vector_graphics_compiler` like this:
`dart run vector_graphics_compiler -i assets/calendar.svg -o assets/calendar.vec`
<img width="214" alt="Screenshot 2024-01-05 at 11 33 27" src="https://github.com/dnfield/vector_graphics/assets/5110923/286a4574-9405-46df-8856-4a622f59a0ab">
If I pass `--no-optimize-clips` to the compiler, it works correctly.
| package,p: vector_graphics | low | Minor |
2,656,477,003 | flutter | [vector_graphics] Support libpathops on Linux arm. | _Imported from https://github.com/dnfield/vector_graphics/issues/238_
Original report by @aebrahim on Apr 23, 2024
In the file `packages/vector_graphics_compiler/lib/src/_initialize_path_ops_io.dart`, Linux (and Windows) are always assumed to be 64 bit. This leads to the following error when running on Linux ARM64: `Could not locate libpathops at /usr/lib/flutter/bin/cache/artifacts/engine/linux-x64/libpath_ops.so`
Another approach would be to leverage [`Abi.current()`](https://api.dart.dev/stable/2.18.6/dart-ffi/Abi-class.html)
| package,p: vector_graphics | low | Critical |
2,656,477,130 | flutter | [vector_graphics] isn't run for flutter web | _Imported from https://github.com/dnfield/vector_graphics/issues/241_
Original report by @JgomesAT on May 24, 2024
When I try to run my code with vector graphics compiler in Flutter Web, the command always finishes with Exit and don't run the code
---
Comment by @alod2019 on May 25, 2024
I can confirm. In my case the assets section of pubspec.yaml has vector_graphics_compiler appied to folders rather than separte files. On MacOS web build just crashes with
```
Compiling lib/main.dart for the Web...
Target web_release_bundle failed: ProcessException: Too many open files
Command: /Users/admin/flutter-3.22.1/bin/cache/dart-sdk/bin/dart run vector_graphics_compiler --input=/var/folders/6h/rfdkq1md3v79423cgp0_kpbh0000gn/T/flutter_tools.tfmC7z/ic_calendar.svg-transformOutput0.svg --output=/var/folders/6h/rfdkq1md3v79423cgp0_kpbh0000gn/T/flutter_tools.tfmC7z/ic_calendar.svg-transformOutput1.svg
#0 _ProcessImpl._start (dart:io-patch/process_patch.dart:402:33)
#1 Process.start (dart:io-patch/process_patch.dart:38:20)
#2 _runNonInteractiveProcess (dart:io-patch/process_patch.dart:579:18)
#3 Process.run (dart:io-patch/process_patch.dart:49:12)
#4 LocalProcessManager.run (package:process/src/interface/local_process_manager.dart:72:22)
#5 ErrorHandlingProcessManager.run.<anonymous closure> (package:flutter_tools/src/base/error_handling_io.dart:661:24)
#6 _run (package:flutter_tools/src/base/error_handling_io.dart:556:20)
#7 ErrorHandlingProcessManager.run (package:flutter_tools/src/base/error_handling_io.dart:660:12)
#8 AssetTransformer._applyTransformer (package:flutter_tools/src/build_system/tools/asset_transformer.dart:115:56)
#9 AssetTransformer.transformAsset (package:flutter_tools/src/build_system/tools/asset_transformer.dart:64:70)
<asynchronous suspension>
```
on Windows the picture is better and some of SVG files are transformed but finally build also fails with a file error
---
Comment by @willhlas on May 28, 2024
I had this issue too but just needed to update my flutter version to `3.22.1`! Maybe try this?
---
Comment by @alod2019 on May 29, 2024
my crashlog above shows that it happens with flutter 3.22.1
| package,p: vector_graphics | low | Critical |
2,656,477,232 | flutter | [vector_graphics] ffi imported when compiling for web wasm | _Imported from https://github.com/dnfield/vector_graphics/issues/244_
Original report by @flrnsbt on Jun 10, 2024
../../../../../../.pub-cache/hosted/pub.dev/vector_graphics_compiler-1.1.11+1/lib/src/svg/_tessellator_ffi.dart:6:1: Error: 'dart:ffi' can't be
imported when compiling to Wasm.
import 'dart:ffi' as ffi;
---
Comment by @flrnsbt on Jun 10, 2024
Works well with javascript web
---
Comment by @tusharbhambere on Jun 10, 2024
+1
---
Comment by @luckyhandler on Jun 11, 2024
Happens with `Flutter 3.22.2` but not with `Flutter 3.22.1`, so downgrading Flutter to 3.22.1 is currently a workaround
---
Comment by @NotTsunami on Jun 12, 2024
This is currently breaking our build pipeline as well, downgrading to 3.22.1 fixed it
---
Comment by @trunghieuvn on Jun 22, 2024
> Happens with `Flutter 3.22.2` but not with `Flutter 3.22.1`, so downgrading Flutter to 3.22.1 is currently a workaround
thank for sharing, I work well build success with `flutter 3.22.1`
---
Comment by @chandrabezzo on Jun 24, 2024
Hi, any another workaround instead of we downgrade to Flutter 3.22.1. I think that solution just for short term only, we need to fixed it for long term solution? Because Flutter SDK will always upgraded?
---
Comment by @Trung15010802 on Jun 27, 2024
any updates?
---
Comment by @nohli on Jun 27, 2024
You can use one of these overrides in your `pubspec.yaml`:
Please confirm if it works for you, and the compile target platform you've tested (the more, the better).
```
dependency_overrides:
vector_graphics_compiler:
git:
url: https://github.com/nohli/vector_graphics
path: packages/vector_graphics_compiler
ref: js_interop
```
```
dependency_overrides:
vector_graphics_compiler:
git:
url: https://github.com/nohli/vector_graphics
path: packages/vector_graphics_compiler
ref: io
```
---
Comment by @Trung15010802 on Jun 28, 2024
> You can use one of these overrides in your `pubspec.yaml`: Please confirm if it works for you, and the platform you've tested (the more, the better).
>
> ```
> dependency_overrides:
> vector_graphics_compiler:
> git:
> url: https://github.com/nohli/vector_graphics
> path: packages/vector_graphics_compiler
> ref: js_interop
> ```
>
> ```
> dependency_overrides:
> vector_graphics_compiler:
> git:
> url: https://github.com/nohli/vector_graphics
> path: packages/vector_graphics_compiler
> ref: io
> ```
Neither works for me

---
Comment by @nohli on Jun 28, 2024
> Neither works for me
>
> 
>
>
>
>
We need to differentiate. This issue is not caused by `vector_graphics`, but by `win32`.
Is it possible that you are importing it transitively through another package?
---
Comment by @Trung15010802 on Jun 28, 2024
Thank you for your support! I will open a issue in `win32 `package
---
Comment by @uldall on Jul 1, 2024
I tried this override:
```
dependency_overrides:
vector_graphics_compiler:
git:
url: https://github.com/nohli/vector_graphics
path: packages/vector_graphics_compiler
ref: js_interop
```
and it solved the issue when running `flutter build web --wasm` on Linux.
---
Comment by @nohli on Jul 18, 2024
This is [fixed](https://github.com/dart-lang/sdk/issues/55979) in the latest Flutter stable release [3.22.3](https://groups.google.com/g/flutter-announce/c/zThj7-7rQhs/m/Zm933NaLDAAJ).
| package,p: vector_graphics | low | Critical |
2,656,477,351 | flutter | [vector_graphics] 6.6K fatal crashes on Crashlytics | _Imported from https://github.com/dnfield/vector_graphics/issues/248_
Original report by @JCKodel on Jul 13, 2024
I'm getting almost 7000 crashes (on a 84000 user base) in this library, but I can't figure out what is happening or how even to debug it (since it doesn't trigger on my devices).
On https://github.com/dnfield/vector_graphics/blob/357db2575ebbf64280e792228af6724e3d9ef0e9/packages/vector_graphics_codec/lib/vector_graphics_codec.dart#L169
`EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x000000010d307e98`
```
com.apple.main-thread
0 libsystem_kernel.dylib 0x1030 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x12b18 mach_msg2_internal + 76
2 libsystem_kernel.dylib 0x12db8 mach_msg_overwrite + 484
3 libsystem_kernel.dylib 0x1524 mach_msg + 20
4 CoreFoundation 0x74148 __CFRunLoopServiceMachPort + 156
5 CoreFoundation 0x752e0 __CFRunLoopRun + 1208
6 CoreFoundation 0x79d20 CFRunLoopRunSpecific + 584
7 GraphicsServices 0x1998 GSEventRunModal + 160
8 UIKitCore 0x371448 -[UIApplication _run] + 868
9 UIKitCore 0x3710c0 UIApplicationMain + 312
10 Runner 0x4b9c main + 6 (AppDelegate.swift:6)
11 ??? 0x1cc040344 (Missing)
Thread
0 libsystem_pthread.dylib 0x1718 start_wqthread + 270
Thread
0 libsystem_pthread.dylib 0x1718 start_wqthread + 270
Thread
0 libsystem_kernel.dylib 0x14f0 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x1c1c _pthread_wqthread + 360
2 libsystem_pthread.dylib 0x1720 start_wqthread + 8
Thread
0 libsystem_kernel.dylib 0x14f0 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x1c1c _pthread_wqthread + 360
2 libsystem_pthread.dylib 0x1720 start_wqthread + 8
Thread
0 libsystem_kernel.dylib 0x14f0 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x1c1c _pthread_wqthread + 360
2 libsystem_pthread.dylib 0x1720 start_wqthread + 8
Thread
0 libsystem_kernel.dylib 0x14f0 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x1c1c _pthread_wqthread + 360
2 libsystem_pthread.dylib 0x1720 start_wqthread + 8
com.apple.uikit.eventfetch-thread
0 libsystem_kernel.dylib 0x1030 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x12b18 mach_msg2_internal + 76
2 libsystem_kernel.dylib 0x12db8 mach_msg_overwrite + 484
3 libsystem_kernel.dylib 0x1524 mach_msg + 20
4 CoreFoundation 0x74148 __CFRunLoopServiceMachPort + 156
5 CoreFoundation 0x752e0 __CFRunLoopRun + 1208
6 CoreFoundation 0x79d20 CFRunLoopRunSpecific + 584
7 Foundation 0x3eef8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208
8 Foundation 0x3edf4 -[NSRunLoop(NSRunLoop) runUntilDate:] + 60
9 UIKitCore 0x493914 -[UIEventFetcher threadMain] + 404
10 Foundation 0x56a5c __NSThread__start__ + 704
11 libsystem_pthread.dylib 0x30ec _pthread_start + 116
12 libsystem_pthread.dylib 0x172c thread_start + 8
Crashed: io.flutter.1.ui
0 Flutter 0x3482d4 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
1 App 0x9ec28 NativeCanvas._restore$Method$FfiNative + 591144 (painting.dart:591144)
2 App 0x304e40 FlutterVectorGraphicsListener.onRestoreLayer + 425 (listener.dart:425)
3 App 0x2fe148 VectorGraphicsCodec.decode + 169 (vector_graphics_codec.dart:169)
4 App 0x2fd6a8 decodeVectorGraphics + 92 (listener.dart:92)
5 App 0x2fd548 VectorGraphicWidgetState._loadPicture.<anonymous closure> (#3) + 355 (vector_graphics.dart:355)
6 App 0x213dc FutureListener.handleValue + 1662 (zone.dart:1662)
7 App 0x21278 Future._propagateToListeners.handleValueCallback + 849 (future_impl.dart:849)
8 App 0x1f220 Future._propagateToListeners + 880 (future_impl.dart:880)
9 App 0x1eea8 Future._completeWithValue + 647 (future_impl.dart:647)
10 App 0x1ee1c Future._asyncCompleteWithValue.<anonymous closure> + 721 (future_impl.dart:721)
11 App 0x1ec9c microtaskLoop + 34 (schedule_microtask.dart:34)
12 App 0x1eb9c startMicrotaskLoop (#2) + 54 (schedule_microtask.dart:54)
13 App 0x1eb60 startMicrotaskLoop + 44 (schedule_microtask.dart:44)
14 App 0xbbf8 stub InvokeDartCode + 31736
15 Flutter 0x6054a4 InternalFlutterGpu_Texture_AsImage + 260480
16 Flutter 0x71d044 InternalFlutterGpu_Texture_AsImage + 1406240
17 Flutter 0x41c23c (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
18 Flutter 0x2eb710 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
19 Flutter 0x2ee9f4 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
20 CoreFoundation 0xc1bb0 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
21 CoreFoundation 0x82de4 __CFRunLoopDoTimer + 884
22 CoreFoundation 0x2c0fc __CFRunLoopDoTimers + 284
23 CoreFoundation 0x755bc __CFRunLoopRun + 1940
24 CoreFoundation 0x79d20 CFRunLoopRunSpecific + 584
25 Flutter 0x2eeae0 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
26 Flutter 0x2ee728 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
27 Flutter 0x2ee438 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
28 libsystem_pthread.dylib 0x30ec _pthread_start + 116
29 libsystem_pthread.dylib 0x172c thread_start + 8
io.flutter.1.raster
0 libsystem_kernel.dylib 0x1030 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x12b18 mach_msg2_internal + 76
2 libsystem_kernel.dylib 0x12db8 mach_msg_overwrite + 484
3 libsystem_kernel.dylib 0x1524 mach_msg + 20
4 CoreFoundation 0x74148 __CFRunLoopServiceMachPort + 156
5 CoreFoundation 0x752e0 __CFRunLoopRun + 1208
6 CoreFoundation 0x79d20 CFRunLoopRunSpecific + 584
7 Flutter 0x2eeae0 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
8 Flutter 0x2ee728 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
9 Flutter 0x2ee438 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
10 libsystem_pthread.dylib 0x30ec _pthread_start + 116
11 libsystem_pthread.dylib 0x172c thread_start + 8
io.flutter.1.io
0 libsystem_kernel.dylib 0x1030 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x12b18 mach_msg2_internal + 76
2 libsystem_kernel.dylib 0x12db8 mach_msg_overwrite + 484
3 libsystem_kernel.dylib 0x1524 mach_msg + 20
4 CoreFoundation 0x74148 __CFRunLoopServiceMachPort + 156
5 CoreFoundation 0x752e0 __CFRunLoopRun + 1208
6 CoreFoundation 0x79d20 CFRunLoopRunSpecific + 584
7 Flutter 0x2eeae0 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
8 Flutter 0x2ee728 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
9 Flutter 0x2ee438 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
10 libsystem_pthread.dylib 0x30ec _pthread_start + 116
11 libsystem_pthread.dylib 0x172c thread_start + 8
io.worker.1
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x260c _pthread_cond_wait$VARIANT$armv81 + 1220
2 Flutter 0x58df4 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
3 Flutter 0x2e84d0 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
4 libsystem_pthread.dylib 0x30ec _pthread_start + 116
5 libsystem_pthread.dylib 0x172c thread_start + 8
io.worker.2
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x260c _pthread_cond_wait$VARIANT$armv81 + 1220
2 Flutter 0x58df4 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
3 Flutter 0x2e84d0 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
4 libsystem_pthread.dylib 0x30ec _pthread_start + 116
5 libsystem_pthread.dylib 0x172c thread_start + 8
io.worker.3
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x260c _pthread_cond_wait$VARIANT$armv81 + 1220
2 Flutter 0x58df4 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
3 Flutter 0x2e84d0 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
4 libsystem_pthread.dylib 0x30ec _pthread_start + 116
5 libsystem_pthread.dylib 0x172c thread_start + 8
io.worker.4
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x260c _pthread_cond_wait$VARIANT$armv81 + 1220
2 Flutter 0x58df4 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
3 Flutter 0x2e84d0 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
4 libsystem_pthread.dylib 0x30ec _pthread_start + 116
5 libsystem_pthread.dylib 0x172c thread_start + 8
io.worker.5
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x260c _pthread_cond_wait$VARIANT$armv81 + 1220
2 Flutter 0x58df4 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
3 Flutter 0x2e84d0 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
4 libsystem_pthread.dylib 0x30ec _pthread_start + 116
5 libsystem_pthread.dylib 0x172c thread_start + 8
io.worker.6
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x260c _pthread_cond_wait$VARIANT$armv81 + 1220
2 Flutter 0x58df4 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
3 Flutter 0x2e84d0 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
4 libsystem_pthread.dylib 0x30ec _pthread_start + 116
5 libsystem_pthread.dylib 0x172c thread_start + 8
dart:io EventHandler
0 libsystem_kernel.dylib 0x2800 kevent + 8
1 Flutter 0x57ddac (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
2 Flutter 0x5a9204 (Missing UUID 4c4c44ce55553144a1c1c6eff75c53e3)
3 libsystem_pthread.dylib 0x30ec _pthread_start + 116
4 libsystem_pthread.dylib 0x172c thread_start + 8
Thread
0 libsystem_pthread.dylib 0x1718 start_wqthread + 270
com.google.firebase.crashlytics.MachExceptionServer
0 FirebaseCrashlytics 0x21c10 FIRCLSProcessRecordAllThreads + 392 (FIRCLSProcess.c:392)
1 FirebaseCrashlytics 0x21ff0 FIRCLSProcessRecordAllThreads + 423 (FIRCLSProcess.c:423)
2 FirebaseCrashlytics 0x18e74 FIRCLSHandler + 34 (FIRCLSHandler.m:34)
3 FirebaseCrashlytics 0x1b804 FIRCLSMachExceptionServer + 521 (FIRCLSMachException.c:521)
4 libsystem_pthread.dylib 0x30ec _pthread_start + 116
5 libsystem_pthread.dylib 0x172c thread_start + 8
com.google.fira.worker
0 libsystem_kernel.dylib 0x16cc stat + 8
1 libsystem_kernel.dylib 0x16cc stat64 + 8
2 libsqlite3.dylib 0x5e5e4 sqlite3_bind_text16 + 2452
3 libsqlite3.dylib 0x96518 sqlite3_sourceid + 48192
4 libsqlite3.dylib 0x47908 sqlite3_free_table + 28452
5 libsqlite3.dylib 0x472bc sqlite3_free_table + 26840
6 libsqlite3.dylib 0x3022c sqlite3_step + 20196
7 libsqlite3.dylib 0x2b71c sqlite3_step + 980
8 Runner 0xa7270 -[APMSqliteStore executeSQLStatement:error:] + 4307513968
9 Runner 0xa5bbc -[APMSqliteStore upsertRecord:inTableWithName:error:] + 4307508156
10 Runner 0x28738 -[APMDatabase upsertDataType:inTableWithName:columnName:columnValue:tableLimit:error:] + 4306995000
11 Runner 0x22cb0 -[APMDatabase updateUserAttribute:error:] + 4306971824
12 Runner 0x4c2e4 -[APMMeasurement setUserPropertyInDatabaseOnWorkerQueue:] + 4307141348
13 Runner 0x4bdf4 -[APMMeasurement setUserAttributeOnWorkerQueue:] + 4307140084
14 Runner 0x4bda0 __35-[APMMeasurement setUserAttribute:]_block_invoke + 4307140000
15 Runner 0x9dcfc __51-[APMScheduler scheduleOnWorkerQueueBlockID:block:]_block_invoke + 4307475708
16 libdispatch.dylib 0x637a8 _dispatch_call_block_and_release + 24
17 libdispatch.dylib 0x64780 _dispatch_client_callout + 16
18 libdispatch.dylib 0x3f6fc _dispatch_lane_serial_drain$VARIANT$armv81 + 600
19 libdispatch.dylib 0x401b0 _dispatch_lane_invoke$VARIANT$armv81 + 380
20 libdispatch.dylib 0x49f14 _dispatch_workloop_worker_thread + 608
21 libsystem_pthread.dylib 0x1bd0 _pthread_wqthread + 284
22 libsystem_pthread.dylib 0x1720 start_wqthread + 8
Thread
0 libsystem_kernel.dylib 0x14f0 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x1c1c _pthread_wqthread + 360
2 libsystem_pthread.dylib 0x1720 start_wqthread + 8
Thread
0 libsystem_kernel.dylib 0x14f0 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x1c1c _pthread_wqthread + 360
2 libsystem_pthread.dylib 0x1720 start_wqthread + 8
AXSpeech
0 libsystem_kernel.dylib 0x1030 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x12b18 mach_msg2_internal + 76
2 libsystem_kernel.dylib 0x12db8 mach_msg_overwrite + 484
3 libsystem_kernel.dylib 0x1524 mach_msg + 20
4 CoreFoundation 0x74148 __CFRunLoopServiceMachPort + 156
5 CoreFoundation 0x752e0 __CFRunLoopRun + 1208
6 CoreFoundation 0x79d20 CFRunLoopRunSpecific + 584
7 Foundation 0x3eef8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 208
8 libAXSpeechManager.dylib 0x134e0 -[AXSpeechThread main] + 548
9 Foundation 0x56a5c __NSThread__start__ + 704
10 libsystem_pthread.dylib 0x30ec _pthread_start + 116
11 libsystem_pthread.dylib 0x172c thread_start + 8
DartWorker
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x2638 _pthread_cond_wait$VARIANT$armv81 + 1264
2 Flutter 0x671130 InternalFlutterGpu_Texture_AsImage + 701964
3 Flutter 0x6acbc0 InternalFlutterGpu_Texture_AsImage + 946332
4 Flutter 0x670afc InternalFlutterGpu_Texture_AsImage + 700376
5 libsystem_pthread.dylib 0x30ec _pthread_start + 116
6 libsystem_pthread.dylib 0x172c thread_start + 8
JavaScriptCore libpas scavenger
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x260c _pthread_cond_wait$VARIANT$armv81 + 1220
2 JavaScriptCore 0x10a54c scavenger_thread_main + 1380
3 libsystem_pthread.dylib 0x30ec _pthread_start + 116
4 libsystem_pthread.dylib 0x172c thread_start + 8
DartWorker
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x2638 _pthread_cond_wait$VARIANT$armv81 + 1264
2 Flutter 0x671130 InternalFlutterGpu_Texture_AsImage + 701964
3 Flutter 0x6acbc0 InternalFlutterGpu_Texture_AsImage + 946332
4 Flutter 0x670afc InternalFlutterGpu_Texture_AsImage + 700376
5 libsystem_pthread.dylib 0x30ec _pthread_start + 116
6 libsystem_pthread.dylib 0x172c thread_start + 8
Thread
0 libsystem_kernel.dylib 0x14f0 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x1c1c _pthread_wqthread + 360
2 libsystem_pthread.dylib 0x1720 start_wqthread + 8
com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x1030 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x12b18 mach_msg2_internal + 76
2 libsystem_kernel.dylib 0x12db8 mach_msg_overwrite + 484
3 libsystem_kernel.dylib 0x1524 mach_msg + 20
4 CoreFoundation 0x74148 __CFRunLoopServiceMachPort + 156
5 CoreFoundation 0x752e0 __CFRunLoopRun + 1208
6 CoreFoundation 0x79d20 CFRunLoopRunSpecific + 584
7 CFNetwork 0x229510 _CFURLStorageSessionDisableCache + 50860
8 Foundation 0x56a5c __NSThread__start__ + 704
9 libsystem_pthread.dylib 0x30ec _pthread_start + 116
10 libsystem_pthread.dylib 0x172c thread_start + 8
DartWorker
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x2638 _pthread_cond_wait$VARIANT$armv81 + 1264
2 Flutter 0x671130 InternalFlutterGpu_Texture_AsImage + 701964
3 Flutter 0x6acbc0 InternalFlutterGpu_Texture_AsImage + 946332
4 Flutter 0x670afc InternalFlutterGpu_Texture_AsImage + 700376
5 libsystem_pthread.dylib 0x30ec _pthread_start + 116
6 libsystem_pthread.dylib 0x172c thread_start + 8
DartWorker
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x2638 _pthread_cond_wait$VARIANT$armv81 + 1264
2 Flutter 0x671130 InternalFlutterGpu_Texture_AsImage + 701964
3 Flutter 0x6acbc0 InternalFlutterGpu_Texture_AsImage + 946332
4 Flutter 0x670afc InternalFlutterGpu_Texture_AsImage + 700376
5 libsystem_pthread.dylib 0x30ec _pthread_start + 116
6 libsystem_pthread.dylib 0x172c thread_start + 8
DartWorker
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x2638 _pthread_cond_wait$VARIANT$armv81 + 1264
2 Flutter 0x671130 InternalFlutterGpu_Texture_AsImage + 701964
3 Flutter 0x6acbc0 InternalFlutterGpu_Texture_AsImage + 946332
4 Flutter 0x670afc InternalFlutterGpu_Texture_AsImage + 700376
5 libsystem_pthread.dylib 0x30ec _pthread_start + 116
6 libsystem_pthread.dylib 0x172c thread_start + 8
DartWorker
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x2638 _pthread_cond_wait$VARIANT$armv81 + 1264
2 Flutter 0x671130 InternalFlutterGpu_Texture_AsImage + 701964
3 Flutter 0x6acbc0 InternalFlutterGpu_Texture_AsImage + 946332
4 Flutter 0x670afc InternalFlutterGpu_Texture_AsImage + 700376
5 libsystem_pthread.dylib 0x30ec _pthread_start + 116
6 libsystem_pthread.dylib 0x172c thread_start + 8
DartWorker
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x2638 _pthread_cond_wait$VARIANT$armv81 + 1264
2 Flutter 0x671130 InternalFlutterGpu_Texture_AsImage + 701964
3 Flutter 0x6acbc0 InternalFlutterGpu_Texture_AsImage + 946332
4 Flutter 0x670afc InternalFlutterGpu_Texture_AsImage + 700376
5 libsystem_pthread.dylib 0x30ec _pthread_start + 116
6 libsystem_pthread.dylib 0x172c thread_start + 8
DartWorker
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x2638 _pthread_cond_wait$VARIANT$armv81 + 1264
2 Flutter 0x671130 InternalFlutterGpu_Texture_AsImage + 701964
3 Flutter 0x6acbc0 InternalFlutterGpu_Texture_AsImage + 946332
4 Flutter 0x670afc InternalFlutterGpu_Texture_AsImage + 700376
5 libsystem_pthread.dylib 0x30ec _pthread_start + 116
6 libsystem_pthread.dylib 0x172c thread_start + 8
DartWorker
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x2638 _pthread_cond_wait$VARIANT$armv81 + 1264
2 Flutter 0x671130 InternalFlutterGpu_Texture_AsImage + 701964
3 Flutter 0x6acbc0 InternalFlutterGpu_Texture_AsImage + 946332
4 Flutter 0x670afc InternalFlutterGpu_Texture_AsImage + 700376
5 libsystem_pthread.dylib 0x30ec _pthread_start + 116
6 libsystem_pthread.dylib 0x172c thread_start + 8
DartWorker
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x2638 _pthread_cond_wait$VARIANT$armv81 + 1264
2 Flutter 0x671130 InternalFlutterGpu_Texture_AsImage + 701964
3 Flutter 0x60beb0 InternalFlutterGpu_Texture_AsImage + 287628
4 Flutter 0x6acbf4 InternalFlutterGpu_Texture_AsImage + 946384
5 Flutter 0x670afc InternalFlutterGpu_Texture_AsImage + 700376
6 libsystem_pthread.dylib 0x30ec _pthread_start + 116
7 libsystem_pthread.dylib 0x172c thread_start + 8
DartWorker
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x2638 _pthread_cond_wait$VARIANT$armv81 + 1264
2 Flutter 0x671130 InternalFlutterGpu_Texture_AsImage + 701964
3 Flutter 0x6acbc0 InternalFlutterGpu_Texture_AsImage + 946332
4 Flutter 0x670afc InternalFlutterGpu_Texture_AsImage + 700376
5 libsystem_pthread.dylib 0x30ec _pthread_start + 116
6 libsystem_pthread.dylib 0x172c thread_start + 8
DartWorker
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x2638 _pthread_cond_wait$VARIANT$armv81 + 1264
2 Flutter 0x671130 InternalFlutterGpu_Texture_AsImage + 701964
3 Flutter 0x6acbc0 InternalFlutterGpu_Texture_AsImage + 946332
4 Flutter 0x670afc InternalFlutterGpu_Texture_AsImage + 700376
5 libsystem_pthread.dylib 0x30ec _pthread_start + 116
6 libsystem_pthread.dylib 0x172c thread_start + 8
DartWorker
0 libsystem_kernel.dylib 0x187c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x2638 _pthread_cond_wait$VARIANT$armv81 + 1264
2 Flutter 0x671130 InternalFlutterGpu_Texture_AsImage + 701964
3 Flutter 0x6acbc0 InternalFlutterGpu_Texture_AsImage + 946332
4 Flutter 0x670afc InternalFlutterGpu_Texture_AsImage + 700376
5 libsystem_pthread.dylib 0x30ec _pthread_start + 116
6 libsystem_pthread.dylib 0x172c thread_start + 8
```
</details>
<details><summary>vector_graphics_codec.dart:169</summary>
| package,p: vector_graphics | low | Critical |
2,656,477,445 | flutter | [vector_graphics] IMPROVEMENT: add an arg to skip non svg files | _Imported from https://github.com/dnfield/vector_graphics/issues/250_
Original report by @alefwd on Jul 30, 2024
I have a folder /assets where I have a mix of svgs and json files, and I cannot change this. I would like to be able to apply the vector_graphics_compiler transformation to the folder.
When I tried something like:
```
- path: assets/
transformers:
- package: vector_graphics_compiler
```
I received exceptions relative to transforming the json files.
What I propose is either to skip non svg files by default, or to enable it using an arg:
```
- path: assets/
transformers:
- package: vector_graphics_compiler
args: ['--svg-only']
```
---
Comment by @t-unit on Aug 9, 2024
I also run into this sometimes with files generated by the OS, very annoying. E.g. for `.DS_Store`:
```
Target debug_android_application failed: Error: User-defined transformation of asset "/Users/***/assets/vector/.DS_Store" failed.
Transformer process terminated with non-zero exit code: 1
Transformer package: vector_graphics_compiler
Full command: /Users/***/flutter/bin/cache/dart-sdk/bin/dart run vector_graphics_compiler --input=/var/folders/5l/cwy_qpwn32bf5r7qcnz2ns740000gn/T/flutter_tools.1xhZrW/.DS_Store-transformOutput0 --output=/var/folders/5l/cwy_qpwn32bf5r7qcnz2ns740000gn/T/flutter_tools.1xhZrW/.DS_Store-transformOutput1
stdout:
XXXXXXXXXXX /var/folders/5l/cwy_qpwn32bf5r7qcnz2ns740000gn/T/flutter_tools.1xhZrW/.DS_Store-transformOutput0 XXXXXXXXXXXXX
FileSystemException: Failed to decode data using encoding 'utf-8', path = '/var/folders/5l/cwy_qpwn32bf5r7qcnz2ns740000gn/T/flutter_tools.1xhZrW/.DS_Store-transformOutput0'
#0 _File._tryDecode (dart:io/file_impl.dart:615:7)
#1 _File.readAsStringSync (dart:io/file_impl.dart:624:7)
#2 IsolateProcessor._process.<anonymous closure> (file:///Users/***/.pub-cache/hosted/pub.dev/vector_graphics_compiler-1.1.11+1/bin/util/isolate_processor.dart:110:37)
isolate_processor.dart:110
#3 _RemoteRunner._run (dart:isolate:1090:47)
#4 _RemoteRunner._remoteExecute (dart:isolate:1084:12)
#5 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:300:17)
#6 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
```
| package,p: vector_graphics | low | Critical |
2,656,477,537 | flutter | [vector_graphics] build: Occasionaly fails to rename vector file after transforming during build | _Imported from https://github.com/dnfield/vector_graphics/issues/252_
Original report by @ZiyadF296 on Aug 8, 2024
When building an app, while transforming assets, the following error gets dumped (built with verbose):
<details>
<summary>Error dump</summary>
[ +19 ms] Target web_release_bundle failed: Error: User-defined transformation of asset
"C:\Users\username\div\My_Cool_Flutter_App\flutter_app\assets\Icons\heart_border.svg" failed.
Transformer process terminated with non-zero exit code: 255
Transformer package: vector_graphics_compiler
Full command: C:\src\flutter\bin\cache\dart-sdk\bin\dart.exe run vector_graphics_compiler
--input=C:\Users\username\AppData\Local\Temp\flutter_tools.9e394f6\heart_border.svg-transformOutput0.svg
--output=C:\Users\username\AppData\Local\Temp\flutter_tools.9e394f6\heart_border.svg-transformOutput1.svg
stdout:
stderr:
Cannot rename file to
'C:\Users\username\div\My_Cool_Flutter_App\flutter_app\.dart_tool/pub\bin\vector_graphics_compiler\vector_graphics_compiler.dart-3.4.4.sn
apshot', path =
'C:\Users\username\div\My_Cool_Flutter_App\flutter_app\.dart_tool/pub\bin\vector_graphics_compiler\tmpb6899b1\vector_graphics_compiler.da
rt-3.4.4.snapshot.incremental.temp' (OS Error: Access is denied.
, errno = 5)
PathAccessException: Cannot rename file to
'C:\Users\username\div\My_Cool_Flutter_App\flutter_app\.dart_tool/pub\bin\vector_graphics_compiler\vector_graphics_compiler.dart-3.4.4.sn
apshot', path =
'C:\Users\username\div\My_Cool_Flutter_App\flutter_app\.dart_tool/pub\bin\vector_graphics_compiler\tmpb6899b1\vector_graphics_compiler.da
rt-3.4.4.snapshot.incremental.temp' (OS Error: Access is denied.
, errno = 5)
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 copyAssets.<anonymous closure> (package:flutter_tools/src/build_system/targets/assets.dart:154:19)
<asynchronous suspension>
#2 Future.wait.<anonymous closure> (dart:async/future.dart:524:21)
<asynchronous suspension>
#3 copyAssets (package:flutter_tools/src/build_system/targets/assets.dart:126:3)
<asynchronous suspension>
#4 WebReleaseBundle.build (package:flutter_tools/src/build_system/targets/web.dart:450:29)
<asynchronous suspension>
#5 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:875:9)
<asynchronous suspension>
#6 Future.wait.<anonymous closure> (dart:async/future.dart:524:21)
<asynchronous suspension>
#7 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:813:32)
<asynchronous suspension>
#8 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:642:16)
<asynchronous suspension>
#9 WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:92:34)
<asynchronous suspension>
#10 BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:230:5)
<asynchronous suspension>
#11 FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1394:27)
<asynchronous suspension>
#12 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#13 CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#14 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:372:9)
<asynchronous suspension>
#15 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#16 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:308:5)
<asynchronous suspension>
#17 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:130:9)
<asynchronous suspension>
#18 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#19 main (package:flutter_tools/executable.dart:93:3)
<asynchronous suspension>
[ +10 ms] Compiling lib\main.dart for the Web... (completed in 118.8s)
[ +1 ms] "flutter web" took 123,432ms.
[ +41 ms] Error: Failed to compile application for the Web.
</details>
Also, please note this is not a persistent error. Subsequently building the app WITHOUT any changes resolves it and the OS no longer throws a permission denied error when build tool tries to rename the vector file. It's a 50/50 chance of a build succeeding.
| package,p: vector_graphics | low | Critical |
2,656,477,628 | flutter | [vector_graphics] Reverse the compile of svg back to svg files | _Imported from https://github.com/dnfield/vector_graphics/issues/253_
Original report by @richardshephard1 on Aug 21, 2024
Hi there,
We have a number of `svg.vec` files that have been compiled but we no longer have the raw svg text.
On an Android app we load them via SvgPicture.
Is there a way of reversing the compile process and output the text version?
I couldn't see an interface in SvgPicture to give the svg xml either?
| package,p: vector_graphics | low | Minor |
2,656,477,725 | flutter | [vector_graphics] image elements within .svg files cause run time crash | _Imported from https://github.com/dnfield/vector_graphics/issues/256_
Original report by @ChristianEdwardPadilla on Sep 19, 2024
An [image element](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/image) within an SVG file parsed with this package was observed to cause crashes at run time with the following stack trace:
```
_TypeError: Flutter framework
at FlutterVectorGraphicsListener.onDrawImage (listener.dart: 773)
at VectorGraphicsCodec.decode (vector_graphics_codec.dart: 218)
at decodeVectorGraphics.process.<anonymous closure> (listener.dart: 99)
at <asynchronous gap> (async)
at VectorGraphicWidgetState._loadPicture.<anonymous closure> (#2) (vector_graphics.dart: 369)
at <asynchronous gap> (async)
at VectorGraphicWidgetState._loadAssetBytes.<anonymous closure> (vector_graphics.dart: 402)
at <asynchronous gap> (async)
```
(internal tracking issue b/368358823)
| package,p: vector_graphics | low | Critical |
2,656,501,840 | node | doc: missing data for `URLSearchParams(urlSearchParams)` constructor | ### Affected URL(s)
https://nodejs.org/docs/latest/api/url.html
### Description of the problem
the history info of the two features doesn't mention these changes below
`URLSearchParams` constructor accepts a `URLSearchParams` object since v7.5.0, though this can be include as an iterable object (but the case is that the support for an iterable object only after v7.10.0)
`URL.prototype.searchParams` returns an empty list when being constructed before v7.5.0
see https://github.com/mdn/browser-compat-data/pull/24998
see https://github.com/mdn/browser-compat-data/pull/24997
also reference to https://github.com/nodejs/node/pull/55840 | doc | low | Major |
2,656,513,071 | godot | [3.x] Controller Triggers stay pressed on Android | ### Tested versions
Reproducible in Android, using Xbox controller with godot engine 3.6 stable
### System information
Android 13 godot 3.6 stable
### Issue description
On Android, Controller Triggers once pressed, stay pressed until the game is restarted
the same of [this issue](https://github.com/godotengine/godot/issues/79263)
### Steps to reproduce
Use controller in android
### Minimal reproduction project (MRP)
Any project | bug,platform:android,topic:input | low | Minor |
2,656,516,239 | PowerToys | Workspaces does not retain application order | ### Microsoft PowerToys version
0.86.0
### Installation method
GitHub
### Running as admin
No
### Area(s) with issue?
Workspaces
### Steps to reproduce
Starting in the 0.86.0 update, Workspaces no longer opens applications in the correct order. To replicate:
1. Open the same application multiple times with different files
2. Capture the workspace, and specify the command line arguments to open the correct file for each instance of the application if necessary
3. Close all files and launch the workspace. The files do not open in the order specified in the workspace
### ✔️ Expected Behavior
In version 0.85.1 and prior, the applications launched in the order they are shown in the workspace edit section (1 opens first, 2 second, etc). When there are multiple instances of a single application, this affects the order in which the files appear on the taskbar when hovering over the app.
### ❌ Actual Behavior
Workspaces does not respect the order in which the apps are listed in the edit workspace section, at least when a single app is open multiple times with a different file specified for each instance of the app. I did not test with multiple apps. Reverting back to 0.85.1 and the apps are opened in the correct order.
### Other Software
_No response_ | Issue-Bug,Status-In progress,Needs-Triage,Needs-Team-Response,Product-Workspaces | low | Major |
2,656,521,792 | kubernetes | Eviction manager should evict terminated pods before running pods | ### What happened?
Consider two pods are running on the node:
1. pod with a large image size but in terminated state.
2. running pod which is utilizing disk space just above the eviction limit.
kubelet's eviction manager will evict the running pod first instead of evicting the terminated pod and cleaning up the image.
### What did you expect to happen?
kubelet should evict terminated pods and clean up images first beforing deciding to evict the running pod.
### How can we reproduce it (as minimally and precisely as possible)?
1. create a pod with large image size and let it run to completion (you can write some data to writable layers if there's no large image).
2. create a pod with different image but it should utilize disk space until eviction limit.
3. watch kubelet evict the running pod first.
### Anything else we need to know?
I think we should modify our node reclaim funcs to prioritize terminated pods first - https://github.com/kubernetes/kubernetes/blob/c9092f69fc0c099062dd23cd6ee226bcd52ec790/pkg/kubelet/eviction/helpers.go#L1222
### Kubernetes version
<details>
```console
$ kubectl version
1.31
```
</details>
### Cloud provider
<details>
</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>
| kind/bug,sig/node,triage/accepted | low | Major |
2,656,528,284 | godot | Subwindows don't close when emitting close_requested() | ### Tested versions
Reproducible in:
- v4.4.dev4.official [36e6207bb] (latest version tested)
- v4.3.stable.official [77dcf97d8]
- v4.2.2.stable.official [15073afe3]
- v4.0.alpha1.official [31a7ddbf8] (oldest version tested)
### System information
Windows 11 Home, Version 23H2, OS build 22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 Laptop GPU (NVIDIA; 32.0.15.6603) - 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 Threads)
### Issue description
I'm running a subwindow in a scene. When pressing the subwindow's exit button, this subwindow emits its `close_requested` signal. However, when this signal is emitted, the subwindow does not close. Alternatively when pressing alt+f4 on a multi-windowed subwindow, it also does not close.
In my Project Settings, `application/config/auto_accept_quit` is enabled. This setting works when the main window is targeted. But this setting does not apply to the subwindows of this main window.
I expect this setting to be applied to the subwindows of the main window.
### Steps to reproduce
Enable `application/config/auto_accept_quit` -> add a Window node to any arbitrary scene -> run the program -> click on the exit button
or...
Enable `application/config/auto_accept_quit` -> add a Window node to any arbitrary scene -> disable `display/window/subwindows/embed_subwindows` -> run the program -> bring the subwindow into focus -> press alt+f4
### Minimal reproduction project (MRP)
N/A, reproducible in brand new project. | needs testing,topic:gui | low | Minor |
2,656,528,442 | terminal | Learn documentation links | ### Description of the new feature
The documentation link refers to docs.microsoft.com but should go to learn.microsoft.com.

Also, the markdown doesn't render as a selectable link.
### Proposed technical implementation details
_No response_ | Issue-Feature,Product-Terminal,Needs-Tag-Fix,Area-Chat | low | Minor |
2,656,565,335 | vscode | Editor GPU: Scroll x doesn't get applied when moving the cursor | Repro:
1. Enable GPU rendering
2. Open a file with a long line
3. Select a line rendered by GPU
4. Scroll to the right
5. Press home, 🐛 the cursor moves but the editor doesn't scroll to the left to reveal it

| bug,editor-gpu | low | Minor |
2,656,567,030 | pytorch | Remove tensor variable default method fallthrough | ### 🐛 Describe the bug
Today at https://github.com/pytorch/pytorch/blob/51e0996d58e6fa40a8d255a26b767c3f3e035943/torch/_dynamo/variables/tensor.py#L589C1-L596C10
we fallthrough and put an arbitrary method in the graph. This is not desired behavior because if this method returns a non-tensor value we will likely hit issues in torch variable that the output generated from a graph node was not the expected type. We should only put methods in the graph which we know we can handle.
To resolve this we should error in this case, which will likely cause many current tests to fail. We should go through these tests and add explicit handlers in tensor variable where they are expected to resolve these failures.
### Versions
N/A
cc @ezyang @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @amjames | good first issue,triaged,enhancement,oncall: pt2,module: dynamo | low | Critical |
2,656,567,740 | vscode | Editor GPU: Lines aren't clipped to the viewport and show under line numbers | Repro:
1. Enable GPU rendering
2. Open a file with a line longer than 200 characters (to get the scroll bar to show up currently)
3. Scroll to the right

| bug,editor-gpu | low | Minor |
2,656,571,386 | pytorch | Inductor pattern matcher - missing val | ### 🐛 Describe the bug
Stacktrace
~~~
File "/home/anijain/local/sam2/notebooks/ued.py", line 104, in <module>
masks, scores, logits = predictor.predict(
^^^^^^^^^^^^^^^^^^
File "/home/anijain/local/sam2/sam2/sam2_image_predictor.py", line 315, in predict
output_path = torch._inductor.aoti_compile_and_package(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anijain/local/pytorch3/torch/_inductor/__init__.py", line 101, in aoti_compile_and_package
return aoti_compile_and_package_debug_wrapper(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anijain/local/pytorch3/torch/_inductor/__init__.py", line 180, in aoti_compile_and_package_debug_wrapper
raise e
File "/home/anijain/local/pytorch3/torch/_inductor/__init__.py", line 158, in aoti_compile_and_package_debug_wrapper
return _aoti_compile_and_package_inner(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anijain/local/pytorch3/torch/_inductor/__init__.py", line 130, in _aoti_compile_and_package_inner
aoti_files = aot_compile(m, args, kwargs, options=inductor_configs) # type: ignore[arg-type]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anijain/local/pytorch3/torch/_inductor/__init__.py", line 286, in aot_compile
return compile_fx_aot(
^^^^^^^^^^^^^^^
File "/home/anijain/local/pytorch3/torch/_inductor/compile_fx.py", line 1247, in compile_fx_aot
compiled_lib_path = compile_fx(
^^^^^^^^^^^
File "/home/anijain/local/pytorch3/torch/_inductor/compile_fx.py", line 1428, in compile_fx
return compile_fx(
^^^^^^^^^^^
File "/home/anijain/local/pytorch3/torch/_inductor/compile_fx.py", line 1470, in compile_fx
return compile_fx(
^^^^^^^^^^^
File "/home/anijain/local/pytorch3/torch/_inductor/compile_fx.py", line 1701, in compile_fx
return inference_compiler(unlifted_gm, example_inputs_)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anijain/local/pytorch3/torch/_inductor/compile_fx.py", line 1525, in fw_compiler_base
return _fw_compiler_base(model, example_inputs, is_inference)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anijain/local/pytorch3/torch/_inductor/compile_fx.py", line 1534, in _fw_compiler_base
_recursive_joint_graph_passes(model)
File "/home/anijain/local/pytorch3/torch/_inductor/compile_fx.py", line 341, in _recursive_joint_graph_passes
joint_graph_passes(gm)
File "/home/anijain/local/pytorch3/torch/_inductor/fx_passes/joint_graph.py", line 468, in joint_graph_passes
).apply_graph_pass(patterns.apply)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anijain/local/pytorch3/torch/fx/passes/graph_transform_observer.py", line 70, in apply_graph_pass
return pass_fn(self.gm.graph)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/anijain/local/pytorch3/torch/_inductor/pattern_matcher.py", line 1776, in apply
entry.apply(m, graph, node) # type: ignore[arg-type]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anijain/local/pytorch3/torch/_inductor/pattern_matcher.py", line 1045, in apply
self.handler(match, *match.args, **match.kwargs)
File "/home/anijain/local/pytorch3/torch/_inductor/fx_passes/joint_graph.py", line 575, in pointless_view
arg_size = list(node.args[0].meta["val"].shape) # type: ignore[union-attr]
~~~~~~~~~~~~~~~~~^^^^^^^
KeyError: 'val'
~~~
Repro instructions are here - https://docs.google.com/document/d/19_pBaIkQl8PRd-m-4TZB_EAm3nsFlqG8-WZ6BwWp888/edit?tab=t.0
Its very possible that some pass is not propagating fake tensor info.
### Error logs
NA
### Versions
NA
cc @ezyang @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @aakhundov | triaged,oncall: pt2,module: inductor | low | Critical |
2,656,599,553 | pytorch | [export][non-strict] Passing in kwargs torch.export fails at non_strict_utils.fakify() | ### 🐛 Describe the bug
# Repro
```
import logging
import math
import os
import requests
import torch
from PIL import Image
from torch.nn import functional as F
from transformers import BlipForConditionalGeneration, BlipProcessor
def main():
processor = BlipProcessor.from_pretrained("Salesforce/blip-image-captioning-large")
model = BlipForConditionalGeneration.from_pretrained(
"Salesforce/blip-image-captioning-large"
).to("cuda")
img_url = (
"https://storage.googleapis.com/sfr-vision-language-research/BLIP/demo.jpg"
)
raw_image = Image.open(requests.get(img_url, stream=True).raw).convert("RGB")
# conditional image captioning
text = "a photography of"
inputs = processor(raw_image, text, return_tensors="pt").to("cuda")
out = model.generate(**inputs)
print(processor.decode(out[0], skip_special_tokens=True))
exported = torch.export.export(model, tuple(), inputs, strict=False)
```
# Error
```
Traceback (most recent call last):
...
File "scripts/henrylhtsang/repros/aot.py", line 50, in main
exported = torch.export.export(model, tuple(), inputs, strict=False)
File "torch/export/__init__.py", line 368, in export
return _export(
File "torch/export/_trace.py", line 1031, in wrapper
raise e
File "torch/export/_trace.py", line 1004, in wrapper
ep = fn(*args, **kwargs)
File "torch/export/exported_program.py", line 122, in wrapper
return fn(*args, **kwargs)
File "torch/export/_trace.py", line 1957, in _export
export_artifact = export_func( # type: ignore[operator]
File "torch/export/_trace.py", line 1707, in _non_strict_export
) = make_fake_inputs(
File "torch/_export/non_strict_utils.py", line 206, in make_fake_inputs
fake_args, fake_kwargs = tree_map_with_path(
File "torch/utils/_pytree.py", line 1608, in tree_map_with_path
return treespec.unflatten(func(*xs) for xs in zip(*all_keypath_leaves))
File "torch/utils/_pytree.py", line 803, in unflatten
leaves = list(leaves)
File "torch/utils/_pytree.py", line 1608, in <genexpr>
return treespec.unflatten(func(*xs) for xs in zip(*all_keypath_leaves))
File "torch/_export/non_strict_utils.py", line 207, in <lambda>
lambda kp, val: fakify(fake_mode, kp, val, t_constraints, sources),
File "torch/_export/non_strict_utils.py", line 96, in fakify
raise ValueError(f"Unsupported input type {type(t)}")
ValueError: Unsupported input type <class 'transformers.image_processing_base.BatchFeature'>
```
# Notes
- If using strict=True, then it's fine.
- If using strict=False and args instead of kwargs, then it's fine.
- If using strict=False and use kwargs, then it fails.
### Versions
n/a
cc @ezyang @chauhang @penguinwu @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4 | module: bootcamp,triaged,oncall: pt2,oncall: export,empathy-day | low | Critical |
2,656,600,273 | flutter | Tools integration tests should always stream output | There are [200 instances in 53 files](https://github.com/search?q=repo%3Aflutter%2Fflutter+path%3A%2F%5Epackages%5C%2Fflutter_tools%5C%2Ftest%5C%2F%2F+%2Fmanager%5C.run%2F&type=code) where tests in `flutter_tools` uses `processManager.run`, or some variant of that command, which runs an external process, effectively blocks (sometimes using async, but still halts execution from a test perspective), and then, upon completion, checks if the result was successful.
For example, something like this:
```dart
test('flutter does great things', () async {
ProcessResult result = processManager.run(flutterBin, ['create', 'foo']);
expect(result, const ProcessResultMatcher());
result = processManager.run(flutterBin, ['build', 'apk']);
expect(result, const ProcessResultMatcher());
});
```
There is an inherit problem with this pattern and timeouts. The `flutter_tools` package insists that [no test take longer than 15 minutes](https://github.com/flutter/flutter/blob/cae3f9acd0d95e61afe2f9561640418d4e220549/packages/flutter_tools/dart_test.yaml#L12), and there are overall timeout commitments at the LUCI and CI level (often between 30m and [60m](https://github.com/flutter/flutter/blob/cae3f9acd0d95e61afe2f9561640418d4e220549/.ci.yaml#L1179)).
In practical terms, that means that if any `processManager.run` goes over either a test or task timeout, the output will appear befuddlingly incomplete, and it will be unclear from a triage perspective if the test shard needs re-sharding, the particular test is just taking too long, or if there is an underlying failure, such as a OOM or crash which does not cause the process to complete as expected.
One such example is https://github.com/flutter/flutter/issues/158560:
```txt
15:26 +87: test/integration.shard/isolated/native_assets_without_cbuild_assemble_test.dart: (setUpAll)
15:26 +87: test/integration.shard/isolated/native_assets_without_cbuild_assemble_test.dart: flutter build "linux" succeeds without libraries
15:51 +88: test/integration.shard/isolated/native_assets_without_cbuild_assemble_test.dart: flutter build "apk" succeeds without libraries
30:54 +88 -1: test/integration.shard/isolated/native_assets_without_cbuild_assemble_test.dart: flutter build "apk" succeeds without libraries [E]
TimeoutException after 0:15:00.000000: Test timed out after 15 minutes.
dart:isolate _RawReceivePort._handleMessage
```
... there is no way to know what `flutter build apk` was doing (was it making progress? did it crash?).
I made a 1-off adjustment in https://github.com/flutter/flutter/pull/158757, but I'd suggest:
- Integration tests in the tool should always stream process output
- There should be a top-level function for doing so, that does it the right way
- A test should assert that integration tests do not call processManager.run directly | tool,P2,c: tech-debt,team-tool | low | Critical |
2,656,603,710 | go | cmd/internal/testdir: Test/fixedbugs/issue57823.go failures | ```
#!watchflakes
default <- pkg == "cmd/internal/testdir" && test == "Test/fixedbugs/issue57823.go"
```
Issue created automatically to collect these failures.
Example ([log](https://ci.chromium.org/b/8731358591670897665)):
=== RUN Test/fixedbugs/issue57823.go
=== PAUSE Test/fixedbugs/issue57823.go
=== CONT Test/fixedbugs/issue57823.go
testdir_test.go:147: exit status 2
panic: never GC'd
goroutine 1 gp=0x9c06128 m=0 mp=0x812f6a0 [running]:
panic({0x80b7c20, 0x80dac6c})
/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/panic.go:806 +0x144 fp=0x9c4e774 sp=0x9c4e720 pc=0x80a7554
main.str({0x80c01ca, 0x8}, {0x80c0302, 0x9})
...
runtime.gcBgMarkWorker(0x9c20400)
/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/mgc.go:1412 +0xfd fp=0x9c7e7e8 sp=0x9c7e78c pc=0x805b44d
runtime.gcBgMarkStartWorkers.gowrap1()
/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/mgc.go:1328 +0x27 fp=0x9c7e7f0 sp=0x9c7e7e8 pc=0x805b337
runtime.goexit({})
/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/asm_386.s:1393 +0x1 fp=0x9c7e7f4 sp=0x9c7e7f0 pc=0x80ab531
created by runtime.gcBgMarkStartWorkers in goroutine 1
/home/swarming/.swarming/w/ir/x/w/goroot/src/runtime/mgc.go:1328 +0x12c
--- FAIL: Test/fixedbugs/issue57823.go (0.46s)
— [watchflakes](https://go.dev/wiki/Watchflakes)
| NeedsInvestigation | low | Critical |
2,656,607,794 | godot | FPS drops considerably if there are a large number of Skeleton3Ds | ### Tested versions
Reproducible in: v4.3.stable.official [77dcf97d8]
### System information
Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated AMD Radeon RX 7700 XT (Advanced Micro Devices, Inc.; 32.0.12019.1028) - AMD Ryzen 7 7700 8-Core Processor (16 Threads)
### Issue description
I wanted to create an RTS game similar to BFME, but I ran into the problem that the engine is terribly optimized when using many units with a skeleton and animation based on it. I created the simplest model with the simplest animation and only with them I already get 100 fps with 1k units and below 10 fps with 10k units. In this case, the GPU and CPU are practically not involved. I can't use RenderingServer because I don't see that skeletal animations are implemented there in any way, the documentation seems completely unfinished at this point.
### Steps to reproduce
1. Run scene.
### Minimal reproduction project (MRP)
[reproduction.zip](https://github.com/user-attachments/files/17738473/reproduction.zip) | discussion,topic:animation,performance | medium | Major |
2,656,646,191 | flutter | Unsafe `GlobalKey` subtypes | ```dart
enum AppKeys implements GlobalKey {
home,
search,
settings;
GlobalKey get _key => GlobalObjectKey(this);
@override
BuildContext? get currentContext => _key.currentContext;
@override
State? get currentState => _key.currentState;
@override
Widget? get currentWidget => _key.currentWidget;
}
```
This crashes because the `GlobalKey` subtype is missing the private `_currentElement` getter. | framework,a: annoyance,P3,team-framework,triaged-framework | low | Critical |
2,656,646,319 | rust | compiletest: `//@ aux-crate` seems to only actually work for dylibs | ... And it seems to never hit staticlibs or rlibs? | T-bootstrap,C-bug,A-compiletest,E-needs-investigation | low | Minor |
2,656,662,315 | flutter | [camera_android] Crash CameraDevice was already closed `unlockAutoFocus` > `checkIfCameraClosedOrInError` | Seeing this in packages CI as Firebase flakes:
```
java.lang.IllegalStateException: CameraDevice was already closed
FATAL EXCEPTION: CameraBackground
Process: io.flutter.plugins.cameraexample, PID: 23790
java.lang.IllegalStateException: CameraDevice was already closed
at android.hardware.camera2.impl.CameraDeviceImpl.checkIfCameraClosedOrInError(CameraDeviceImpl.java:2445)
at android.hardware.camera2.impl.CameraDeviceImpl.submitCaptureRequest(CameraDeviceImpl.java:1237)
at android.hardware.camera2.impl.CameraDeviceImpl.capture(CameraDeviceImpl.java:1099)
at android.hardware.camera2.impl.CameraCaptureSessionImpl.capture(CameraCaptureSessionImpl.java:189)
at io.flutter.plugins.camera.Camera.unlockAutoFocus(Camera.java:807)
at io.flutter.plugins.camera.Camera$3.onCaptureCompleted(Camera.java:719)
at android.hardware.camera2.impl.CameraCaptureSessionImpl$1.lambda$onCaptureCompleted$4$android-hardware-camera2-impl-CameraCaptureSessionImpl$1(CameraCaptureSessionImpl.java:708)
at android.hardware.camera2.impl.CameraCaptureSessionImpl$1$$ExternalSyntheticLambda1.run(Unknown Source:8)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.os.HandlerThread.run(HandlerThread.java:67)
```
See link from https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8731360356815402769/+/u/Run_package_tests/Firebase_Test_Lab/stdout
I see this mentioned in comment https://github.com/flutter/flutter/issues/92762#issuecomment-1408013677 but I _think_ that issue is tracking something different. | platform-android,p: camera,package,P2,c: flake,team-android,triaged-android | low | Critical |
2,656,673,577 | godot | Godot internationalization system has an API design error regarding pluralization | ### Tested versions
4.3
### System information
any
### Issue description
The two apis for pluralization in the Godot i18n system (Object.tr_n and TranslationServer.translate_plural) only allow two strings to be passed as arguments (one normal and one plural).
Of course, this api assumes that the game is developed in a language that only has two pluralization cases (I'm guessing this is English). But there are obviously a lot of languages with different cases.
If a game development team chooses a language that uses more than two cases as their dev language, then this api will not work at all!
The correct api design would be to pass an array of pluralization strings here to handle languages with different pluralization rules.
Reference:
[cldr plurals rule](https://github.com/unicode-org/cldr-json/blob/ab05c489c485b9b7a3b90dabb13d612a044a67cb/cldr-json/cldr-core/supplemental/plurals.json)
[GNU gettext plural chapter](https://www.gnu.org/software/gettext/manual/html_node/Plural-forms.html)
### Steps to reproduce
N / A
### Minimal reproduction project (MRP)
N / A | enhancement,discussion,usability,topic:gui | low | Critical |
2,656,724,179 | rust | "one of the expressions' fields has a method of the same name"'s help suggests adding `0.` instead of `.0` | ### Code
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=899783497cf148043b6fe15a5af2efba
```Rust
struct Outer<'a>(&'a str);
fn main() {
let outer = Outer("hi");
outer.contains("foo");
}
```
### Current output
```Shell
error[E0599]: no method named `contains` found for struct `Outer` in the current scope
--> src/main.rs:5:11
|
1 | struct Outer<'a>(&'a str);
| ---------------- method `contains` not found for this struct
...
5 | outer.contains("foo");
| ^^^^^^^^ method not found in `Outer<'_>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `contains`, perhaps you need to implement it:
candidate #1: `RangeBounds`
help: one of the expressions' fields has a method of the same name
|
5 | outer.0.contains("foo");
| ++
For more information about this error, try `rustc --explain E0599`.
error: could not compile `playground` (bin "playground") due to 1 previous error
```
### Desired output
```Shell
error[E0599]: no method named `contains` found for struct `Outer` in the current scope
--> src/main.rs:5:11
|
1 | struct Outer<'a>(&'a str);
| ---------------- method `contains` not found for this struct
...
5 | outer.contains("foo");
| ^^^^^^^^ method not found in `Outer<'_>`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `contains`, perhaps you need to implement it:
candidate #1: `RangeBounds`
help: one of the expressions' fields has a method of the same name
|
5 | outer.0.contains("foo");
| ++
For more information about this error, try `rustc --explain E0599`.
error: could not compile `playground` (bin "playground") due to 1 previous error
```
### Rationale and extra context
This is an incredibly small change but I feel like suggesting `.0` rather than `0.` is more intuitive, as it better represents accessing the inner field rather than `0.`, which feels like an invalid rust snippet.
In Rust analyzer, the suggestion is also a little more confusing:
```
no method named `contains` found for reference `&Purged<'_>` in the current scope
method not found in `&Purged<'_>`rustc Click for full compiler diagnostic
example.rs(487, 48): one of the expressions' fields has a method of the same name: `0.`
```
Ultimately it produces correct code but it's just not as straightforward.
### Other cases
```Rust
```
### Rust Version
```Shell
Build using the Nightly version: 1.84.0-nightly
(2024-11-12 f7273e0044ad8f35ad27)
```
### Anything else?
_No response_ | A-diagnostics,T-compiler | low | Critical |
2,656,749,038 | pytorch | torch.from_numpy() returns a cpu tensor, even under `with torch.device("meta")` | repro:
```
import torch
import numpy as np
with torch.device('meta'):
x = torch.from_numpy(np.ones(3))
# prints "cpu"
print(x.device)
```
We've worked pretty hard to get most constructors to work on the device context manager (e.g. `torch.tensor(3)`), so it seems reasonable to get `torch.from_numpy()` to behave similarly.
internal xref: https://fb.workplace.com/groups/1075192433118967/permalink/1543954622909410/
cc @mruberry @rgommers @ezyang @eellison | triaged,module: numpy,module: meta tensors | low | Minor |
2,656,764,677 | pytorch | Bad error message for malformed args during export | Found during user empathy day 11-13-24
### 🐛 Describe the bug
The below repro yields a cryptic dynamo error:
`torch._dynamo.exc.Unsupported: Observed exception`
see full error: https://gist.github.com/mlazos/697b326977dad55c5298d74e8d8df103
This was tricky as I had to guess what the exception is. It looks like we just need to add more information to `ExceptionVariable` to render properly and give more information to the user about which exception was thrown. I was able to guess my way out of this, but our users would definitely be confused by this.
```
from transformers import T5Tokenizer, T5ForConditionalGeneration
import os
tokenizer = T5Tokenizer.from_pretrained("google-t5/t5-small")
model = T5ForConditionalGeneration.from_pretrained("google-t5/t5-small")
input_ids = tokenizer("The <extra_id_0> walks in <extra_id_1> park", return_tensors="pt").input_ids
labels = tokenizer("<extra_id_0> cute dog <extra_id_1> the <extra_id_2>", return_tensors="pt").input_ids
import torch
# exported = torch.export.export(model, (), kwargs={"input_ids": input_ids, "labels": labels}, strict=True)
exported = torch.export.export(model, (input_ids, labels), strict=True)
```
### Versions
e754611d190b323e53c5d17db0dc39a96687513c
cc @ezyang @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @amjames @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4 | oncall: pt2,module: dynamo,oncall: export | low | Critical |
2,656,784,252 | flutter | flutter_driver does not record all timeline events | ### Steps to reproduce
While attempting to benchmark my app, I am noticing that `flutter_driver` seems to stop recording timeline events after a certain limit.
In the tests outlined in the code samples section, I have added a parameter called `kTestCount`. This determines how many times the code in the test is looped before ending the test.
The bug becomes evident when you change it from **1 loop to, let's say, 10 loops**. One would expect the number of timeline events to be roughly 10 times, however, the resultant json files are more or less the same size. When looking at the summary.json files, they both seem to have only recorded ~350-400 frames (`frame_count`).
Running similar tests with both `flutter_driver` and `integration_test` (which uses `flutter_driver` under the hood) yields more or less the exact same results.
All tests were run on a **Pixel 3a**, though I had the same issue when running the tests on an emulator.
### Expected results
When running an integration test, either with the `flutter_driver` package or `integration_test package`, I expect all timeline events to be exported via the `stopTracingAndDownloadTimeline` (flutter_driver) or `responseDataCallback` (integration_test) functions.
### Actual results
Both of these seem to hit a hard limit at trying to generate timeline.json files larger than ~8mb or ~40,000 lines, though I don't know if the limit is related to the file size or event count.
### Code sample
<details open><summary>main.dart</summary>
```dart
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
bool isAnimating = false;
void _toggleAnimation() async {
setState(() => isAnimating = true);
await Future.delayed(const Duration(milliseconds: 2500)).then((_) {
setState(() => isAnimating = false);
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: isAnimating
? const SizedBox(
width: 48,
height: 48,
child: CircularProgressIndicator(),
)
: const SizedBox(),
),
floatingActionButton: FloatingActionButton(
key: const ValueKey('fab'),
onPressed: () => _toggleAnimation(),
child: const Icon(Icons.play_arrow_rounded),
),
);
}
}
```
</details>
<details open><summary>flutter_driver test</summary>
run with:
```console
flutter drive --target=test_driver/driver.dart --profile
```
**driver.dart**
```dart
import 'package:flutter_driver/driver_extension.dart';
import 'package:integration_test_example/main.dart' as app;
void main() {
enableFlutterDriverExtension();
app.main();
}
```
**driver_test.dart**
```dart
import 'package:flutter_driver/flutter_driver.dart';
import 'package:test/test.dart';
const kTestCount = 1;
final fab = find.byValueKey('fab');
void main() {
group(
'end-to-end test',
() {
FlutterDriver? driver;
setUpAll(() async => driver = await FlutterDriver.connect());
tearDownAll(() async => driver?.close());
test('Tests timeline events', () async {
await driver?.startTracing();
await Future.forEach(List.generate(kTestCount, (i) => i), (i) async {
print('Test count: $i');
await Future.delayed(const Duration(seconds: 1));
await driver?.tap(fab);
await Future.delayed(const Duration(milliseconds: 3000));
await driver?.tap(fab);
await Future.delayed(const Duration(milliseconds: 3000));
await driver?.tap(fab);
await Future.delayed(const Duration(milliseconds: 3000));
await driver?.tap(fab);
await Future.delayed(const Duration(milliseconds: 3000));
});
final timeline = await driver?.stopTracingAndDownloadTimeline(
timeout: const Duration(minutes: 1),
);
if (timeline != null) {
final summary = TimelineSummary.summarize(timeline);
await summary.writeTimelineToFile(
'flutter_driver_timeline_${DateTime.now()}',
pretty: true,
includeSummary: true,
);
}
});
},
);
}
```
</details>
<details open><summary>integration_test test</summary>
run with:
```console
flutter drive \
--driver=test_driver/perf_driver.dart \
--target=integration_test/loading_animation_integration_test.dart \
--profile --no-dds -d 06JAY1YQ6A
```
**perf_driver.dart**
```dart
import 'package:flutter_driver/flutter_driver.dart' as driver;
import 'package:integration_test/integration_test_driver.dart';
Future<void> main() {
return integrationDriver(
responseDataCallback: (data) async {
if (data != null) {
final timeline = driver.Timeline.fromJson(
data['timeline'] as Map<String, dynamic>,
);
// Convert the Timeline into a TimelineSummary that's easier to
// read and understand.
final summary = driver.TimelineSummary.summarize(timeline);
// Then, write the entire timeline to disk in a json format.
// This file can be opened in the Chrome browser's tracing tools
// found by navigating to chrome://tracing.
// Optionally, save the summary to disk by setting includeSummary
// to true
await summary.writeTimelineToFile(
'integration_test_timeline${DateTime.now()}',
pretty: true,
includeSummary: true,
);
}
},
);
}
```
**loading_animation_integration_test.dart**
```dart
// ignore_for_file: avoid_print
import 'package:flutter/foundation.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:integration_test_example/main.dart';
const kTestCount = 1;
void main() {
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.benchmarkLive;
group('end-to-end test', () {
testWidgets('Tests timeline events', (tester) async {
final fab = find.byKey(const ValueKey('fab'));
await binding.traceAction(() async {
await tester.pumpWidget(const MyApp());
await Future.delayed(const Duration(seconds: 3));
await Future.forEach(List.generate(kTestCount, (i) => i), (i) async {
print('Test count: $i');
await Future.delayed(const Duration(seconds: 1));
await tester.tap(fab);
await Future.delayed(const Duration(milliseconds: 3000));
await tester.tap(fab);
await Future.delayed(const Duration(milliseconds: 3000));
await tester.tap(fab);
await Future.delayed(const Duration(milliseconds: 3000));
await tester.tap(fab);
await Future.delayed(const Duration(milliseconds: 3000));
});
});
});
});
}
```
</details>
### Logs
<details open><summary>flutter_driver logs</summary>
```console
pauldhaliwal@Pauls-MacBook-Pro integration_test_example % flutter drive --target=test_driver/driver.dart --profile
Resolving dependencies...
Downloading packages...
_fe_analyzer_shared 70.0.0 (76.0.0 available)
analyzer 6.5.2 (6.11.0 available)
async 2.11.0 (2.12.0 available)
boolean_selector 2.1.1 (2.1.2 available)
characters 1.3.0 (1.3.1 available)
clock 1.1.1 (1.1.2 available)
collection 1.18.0 (1.19.1 available)
fake_async 1.3.1 (1.3.2 available)
file 7.0.0 (7.0.1 available)
flutter_lints 4.0.0 (5.0.0 available)
http_parser 4.0.2 (4.1.1 available)
leak_tracker 10.0.5 (10.0.8 available)
leak_tracker_flutter_testing 3.0.5 (3.0.9 available)
lints 4.0.0 (5.1.0 available)
macros 0.1.2-main.4 (0.1.3-main.0 available)
matcher 0.12.16+1 (0.12.17 available)
material_color_utilities 0.11.1 (0.12.0 available)
meta 1.15.0 (1.16.0 available)
path 1.9.0 (1.9.1 available)
platform 3.1.5 (3.1.6 available)
process 5.0.2 (5.0.3 available)
shelf 1.4.1 (1.4.2 available)
stack_trace 1.11.1 (1.12.0 available)
string_scanner 1.2.0 (1.4.0 available)
test 1.25.7 (1.25.8 available)
test_api 0.7.2 (0.7.3 available)
test_core 0.6.4 (0.6.5 available)
typed_data 1.3.2 (1.4.0 available)
vm_service 14.2.5 (14.3.1 available)
webdriver 3.0.3 (3.0.4 available)
Got dependencies!
30 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Running Gradle task 'assembleProfile'... 3.2s
✓ Built build/app/outputs/flutter-apk/app-profile.apk (15.1MB)
Installing build/app/outputs/flutter-apk/app-profile.apk... 1,413ms
00:00 +0: end-to-end test (setUpAll)
VMServiceFlutterDriver: Connecting to Flutter application at http://127.0.0.1:58502/3Xb8MEqfNSY=/
VMServiceFlutterDriver: Isolate found with number: 7105564028724491
VMServiceFlutterDriver: Isolate is paused at start.
VMServiceFlutterDriver: Attempting to resume isolate
VMServiceFlutterDriver: Connected to Flutter application.
00:00 +0: end-to-end test Tests timeline events
I/Gralloc4(26041): mapper 4.x is not supported
W/Gralloc3(26041): mapper 3.x is not supported
Test count: 0
W/Gralloc4(26041): allocator 4.x is not supported
W/Gralloc3(26041): allocator 3.x is not supported
D/ProfileInstaller(26041): Installing profile for com.example.integration_test_example
00:13 +1: end-to-end test (tearDownAll)
00:13 +1: All tests passed!
```
</details>
<details open><summary>integration_test logs</summary>
```console
pauldhaliwal@Pauls-MacBook-Pro integration_test_example % fvm flutter drive \
--driver=test_driver/perf_driver.dart \
--target=integration_test/loading_animation_integration_test.dart \
--profile --no-dds -d 06JAY1YQ6A
Resolving dependencies...
Downloading packages...
_fe_analyzer_shared 70.0.0 (76.0.0 available)
analyzer 6.5.2 (6.11.0 available)
async 2.11.0 (2.12.0 available)
boolean_selector 2.1.1 (2.1.2 available)
characters 1.3.0 (1.3.1 available)
clock 1.1.1 (1.1.2 available)
collection 1.18.0 (1.19.1 available)
fake_async 1.3.1 (1.3.2 available)
file 7.0.0 (7.0.1 available)
flutter_lints 4.0.0 (5.0.0 available)
http_parser 4.0.2 (4.1.1 available)
leak_tracker 10.0.5 (10.0.8 available)
leak_tracker_flutter_testing 3.0.5 (3.0.9 available)
lints 4.0.0 (5.1.0 available)
macros 0.1.2-main.4 (0.1.3-main.0 available)
matcher 0.12.16+1 (0.12.17 available)
material_color_utilities 0.11.1 (0.12.0 available)
meta 1.15.0 (1.16.0 available)
path 1.9.0 (1.9.1 available)
platform 3.1.5 (3.1.6 available)
process 5.0.2 (5.0.3 available)
shelf 1.4.1 (1.4.2 available)
stack_trace 1.11.1 (1.12.0 available)
string_scanner 1.2.0 (1.4.0 available)
test 1.25.7 (1.25.8 available)
test_api 0.7.2 (0.7.3 available)
test_core 0.6.4 (0.6.5 available)
typed_data 1.3.2 (1.4.0 available)
vm_service 14.2.5 (14.3.1 available)
webdriver 3.0.3 (3.0.4 available)
Got dependencies!
30 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Running Gradle task 'assembleProfile'... 2,118ms
✓ Built build/app/outputs/flutter-apk/app-profile.apk (17.8MB)
Installing build/app/outputs/flutter-apk/app-profile.apk... 1,355ms
I/AdrenoGLES-0(26506): QUALCOMM build : 781e7d0, I46ff5fc46f
I/AdrenoGLES-0(26506): Build Date : 12/01/20
I/AdrenoGLES-0(26506): OpenGL ES Shader Compiler Version: EV031.31.04.01
I/AdrenoGLES-0(26506): Local Branch : QPR1
I/AdrenoGLES-0(26506): Remote Branch :
I/AdrenoGLES-0(26506): Remote Branch :
I/AdrenoGLES-0(26506): Reconstruct Branch :
I/AdrenoGLES-0(26506): Build Config : C P 11.0.1 AArch64
I/AdrenoGLES-0(26506): Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so
I/AdrenoGLES-0(26506): PFP: 0x016ee190, ME: 0x00000000
VMServiceFlutterDriver: Connecting to Flutter application at http://127.0.0.1:59326/JNVdMK9wqpY=/
VMServiceFlutterDriver: Isolate found with number: 8653515500389835
VMServiceFlutterDriver: Isolate is paused at start.
VMServiceFlutterDriver: Attempting to resume isolate
I/flutter (26506): 00:00 +0: end-to-end test Tests timeline events
I/Gralloc4(26506): mapper 4.x is not supported
W/Gralloc3(26506): mapper 3.x is not supported
W/Gralloc4(26506): allocator 4.x is not supported
W/Gralloc3(26506): allocator 3.x is not supported
VMServiceFlutterDriver: Connected to Flutter application.
I/flutter (26506): Test count: 0
D/ProfileInstaller(26506): Installing profile for com.example.integration_test_example
I/flutter (26506): 00:16 +1: (tearDownAll)
I/flutter (26506): 00:17 +2: All tests passed!
All tests passed.
```
</details>
### Flutter Doctor output
<details open><summary>Doctor output</summary>
```console
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.4, on macOS 14.6 23G80 darwin-arm64, locale en-CA)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.2)
[✓] IntelliJ IDEA Community Edition (version 2023.3.4)
[✓] Connected device (3 available)
[✓] Network resources
• No issues found!
```
</details>
| framework,t: flutter driver,f: integration_test,has reproducible steps,P2,team-framework,triaged-framework,found in release: 3.24,found in release: 3.27 | low | Critical |
2,656,814,430 | node | Expose an `id` for concurrent test runners (like `JEST_WORKER_ID`) | ### What is the problem this feature will solve?
When running tests concurrently (the default setting in the Node test runner), it's common practice to split concurrent test runs across multiple local resources (like locally running servers, databases, etc).
Many other popular test runners offer this feature via an environment variable:
- **`jest`**: [`JEST_WORKER_ID`](https://jestjs.io/docs/environment-variables#jest_worker_id)
- **`mocha`**: [`MOCHA_WORKER_ID`](https://mochajs.org/#parallel-mode-worker-ids)
- **`vitest`**: [`VITEST_POOL_ID`](https://vitest.dev/guide/migration.html#envs)
This makes it very easy to set up the proper database connection. For example, here's a snippet from my codebase:
```ts
if (process.env.STAGE === "test" && process.env.JEST_WORKER_ID) {
process.env.DB_DATABASE = `myapp_tests_${process.env.JEST_WORKER_ID}`;
}
```
Then, in my database docker container, I create `n` databases, one for each worker. For example, if I run `jest` with `--maxWorkers 8`, I create `myapp_tests_1` -> `myapp_tests_8`. During tests, the parallel test suites talk to a different database to avoid deadlocks.
### What is the feature you are proposing to solve the problem?
The simplest solution for users coming from other frameworks would be to provide an environment variable just like the other test runners (e.g., `NODE_TEST_WORKER_ID`).
However, if that's not feasible, adding a `workerId` to the `TestContext` could also be a good solution. This solution is not as ideal as the environment variable because people would need to pass the test context to whatever establishes their db/server/etc connection. In my case, at least, this would require refactoring of code. Right now, I rely on that variable being set at file import time.
### What alternatives have you considered?
I considered trying to find a solution based on `pid`, but it's not reliable enough. @RedYetiDev mentioned [in Slack](https://openjs-foundation.slack.com/archives/C06UJ98LY6R/p1731530605970959?thread_ts=1731521632.433829&cid=C06UJ98LY6R) that there might be a solution using `hooks`. I have not dug into this yet. | good first issue,feature request,test_runner | medium | Major |
2,656,883,806 | pytorch | Non-actionable error message when output type is not pytree-able for aoti artifact | From user empathy day 11-13-24
### 🐛 Describe the bug
Script to generate aoti artifact:
```
from transformers import T5Tokenizer, T5ForConditionalGeneration
import os
tokenizer = T5Tokenizer.from_pretrained("google-t5/t5-small")
model = T5ForConditionalGeneration.from_pretrained("google-t5/t5-small")
input_ids = tokenizer("The <extra_id_0> walks in <extra_id_1> park", return_tensors="pt").input_ids
labels = tokenizer("<extra_id_0> cute dog <extra_id_1> the <extra_id_2>", return_tensors="pt").input_ids
import torch
exported = torch.export.export(model, (), kwargs={"input_ids": input_ids, "labels": labels}, strict=True)
output_path = torch._inductor.aoti_compile_and_package(
exported,
(),
kwargs={"input_ids": input_ids, "labels": labels},
package_path=os.path.join(os.getcwd(), "model.pt2"),
)
```
Script to run the artifact and repro error:
```
import os
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
model = torch._inductor.aoti_load_package(os.path.join(os.getcwd(), "model.pt2"))
print(model(torch.randn(8, 10, device=device)))
```
error:
https://gist.github.com/mlazos/b459671d7a481631cc87351f7ac72366
In this case the solution is to import transformers, but also perhaps sharing the registration API for users would be useful here as well if they return their own data structures.
### Versions
e754611d190b323e53c5d17db0dc39a96687513c
cc @ezyang @chauhang @penguinwu @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4 | oncall: pt2,oncall: export | low | Critical |
2,656,891,239 | vscode | Add snake_case to transform grammar in snippets | <!-- ⚠️⚠️ 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. -->
VS Code snippet transform syntax supports converting capture groups to a variety of formats, including lowercase, camelCase, and PascalCase. Support for snake_case would be awesome.
See https://code.visualstudio.com/docs/editor/userdefinedsnippets#_grammar
---
This feature would be helpful when trying to define a snippet that automatically adds a json struct tag to Go fields, for example:
```go
type Person struct {
FirstName `json:"first_name"`
}
```
This is the snippet definition I'm using right now, though it's buggy:
```json
"property with JSON and YAML": {
"prefix": "prop",
"body": [
"${1:name} ${2:string} `yaml:\"${1/([A-Z]?[a-z]+)([A-Z])/${1:/downcase}_${2:/downcase}/g}\" json:\"${1/([A-Z]?[a-z]+)([A-Z])/${1:/downcase}_${2:/downcase}/g}\"`"
],
},
``` | feature-request,snippets | low | Critical |
2,656,938,746 | godot | Context menu empty or corrupted when closing with RMB | ### 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
When you close context menu using right mouse button, it can "open" another menu, which will be empty and may take weird shapes.
https://github.com/user-attachments/assets/e76a69ab-b11b-4ab0-80a9-9ede797141ef
### Steps to reproduce
1. Right-click FileSystem dock to open context menu
2. Right-click the dock again, outside menu, to close it
### Minimal reproduction project (MRP)
N/A | bug,needs testing,topic:gui | low | Major |
2,656,942,027 | vscode | Support fish completions | We need to adjust for ghost text, that's why it's not working ATM.
https://github.com/microsoft/vscode/blob/499475f2ff2d07e4bcdfb69eaba2a8c67d3d4f46/extensions/terminal-suggest/src/terminalSuggestMain.ts#L42-L52
| feature-request,terminal-suggest | low | Minor |
2,656,955,280 | deno | deno 2 mishandles "@types/" installs for "npm:" packages | Version: Deno 2.0.6
Given the following `package.json`:
```json
{
"name": "foo",
"devDependencies": {
"@types/cacache": "^17.0.2"
},
"dependencies": {
"cacache": "^19.0.1"
}
}
```
and the following file:
```ts
// foo.ts
import * as cacache from 'npm:cacache'
```
After running `deno install`, running `deno check foo.ts` yields the following error:
```
error: Failed resolving types. [ERR_TYPES_NOT_FOUND] Could not find types for 'file:///~/example/node_modules/.deno/cacache@19.0.1/node_modules/cacache/index.js' imported from 'file:///~/example/foo.ts'
at file:///~/example/foo.ts:1:26
```
Because Cacache sets `"main": "lib/index.js"` in its `package.json`, `node_modules/cacache/index.js` does not exist. Deno _should_ be looking at `node_modules/cacache/lib/index.js` instead.
(TypeScript itself – run with a vanilla config generated by `tsc --init` – is able to process `foo.ts` once the `npm:` prefix is removed.) | bug | low | Critical |
2,656,974,497 | yt-dlp | [youtube] `--mark-watched` seems to be partially marking some videos as watched | ### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE
- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field
### Checklist
- [X] I'm reporting that yt-dlp is broken on a **supported** site
- [X] I've verified that I have **updated yt-dlp to nightly or master** ([update instructions](https://github.com/yt-dlp/yt-dlp#update-channels))
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required
### Region
United States
### Provide a description that is worded well enough to be understood
Recently yt-dlp `--mark-watched` hasn't been working consistently on my token, it only happens on some videos, while the others get fully marked as watched. Repeating the command multiple times results in the same video progress level.

### Provide verbose output that clearly demonstrates the problem
- [X] Run **your** yt-dlp command with **-vU** flag added (`yt-dlp -vU <your command line>`)
- [X] If using API, add `'verbose': True` to `YoutubeDL` params instead
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below
### Complete Verbose Output
```shell
[debug] Command-line config: ['https://www.youtube.com/watch?v=Aof3f58xw9E', '-Uv']
[debug] Portable config "~\scoop\apps\yt-dlp-master\current\yt-dlp.conf": ['--cookies-from-browser', 'firefox:%APPDATA%/librewolf/Profiles/xxxxxxx.dev-edition-default', '--mark-watched', '--simulate']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version master@2024.11.12.233022 from yt-dlp/yt-dlp-master-builds [f2a4983df] (win_exe)
[debug] Python 3.10.11 (CPython AMD64 64bit) - Windows-10-10.0.19044-SP0 (OpenSSL 1.1.1t 7 Feb 2023)
[debug] exe versions: ffmpeg N-117753-g9ec042c1aa-20241111 (setts), ffprobe N-117753-g9ec042c1aa-20241111
[debug] Optional libraries: Cryptodome-3.21.0, brotli-1.1.0, certifi-2024.08.30, curl_cffi-0.5.10, mutagen-1.47.0, requests-2.32.3, sqlite3-3.40.1, urllib3-2.2.3, websockets-13.1
[debug] Proxy map: {}
Extracting cookies from firefox
[debug] Extracting cookies from: "~\AppData\Roaming\librewolf\Profiles\xxxxxxx.dev-edition-default\cookies.sqlite"
Extracted 999 cookies from firefox
[debug] Request Handlers: urllib, requests, websockets, curl_cffi
[debug] Loaded 1838 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-master-builds/releases/latest
Latest version: master@2024.11.12.233022 from yt-dlp/yt-dlp-master-builds
yt-dlp is up to date (master@2024.11.12.233022 from yt-dlp/yt-dlp-master-builds)
[youtube] Extracting URL: https://www.youtube.com/watch?v=Aof3f58xw9E
[youtube] Aof3f58xw9E: Downloading webpage
[debug] [youtube] Extracted SAPISID cookie
[youtube] Aof3f58xw9E: Downloading ios player API JSON
[youtube] Aof3f58xw9E: Downloading mweb player API JSON
[debug] Loading youtube-nsig.28f14d97 from cache
[debug] [youtube] Decrypted nsig gqLWROCUczLyTOS3 => l3yGrdwFXf8puw
[debug] Loading youtube-nsig.28f14d97 from cache
[debug] [youtube] Decrypted nsig gUeoonMlfDxUFgpx => p-XWlgArpR2A-g
[youtube] Aof3f58xw9E: Downloading m3u8 information
[youtube] Aof3f58xw9E: Marking watched
[youtube] Aof3f58xw9E: Marking fully watched
[debug] Sort order given by extractor: quality, res, fps, hdr:12, source, vcodec, channels, acodec, lang, proto
[debug] Formats sorted by: hasvid, ie_pref, quality, res, fps, hdr:12(7), source, vcodec, channels, acodec, lang, proto, size, br, asr, vext, aext, hasaud, id
[debug] Default format spec: bestvideo*+bestaudio/best
[info] Aof3f58xw9E: Downloading 1 format(s): 401+251
```
| account-needed,site-bug,triage,site:youtube | low | Critical |
2,656,977,440 | vscode | [html] False error of inline Javascript in HTML | <!-- ⚠️⚠️ 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. -->
Version: 1.95.2 (user setup)
Commit: e8653663e8840adaf45af01eab5c627a5af81807
Date: 2024-11-07T11:07:22.054Z
Electron: 32.2.1
ElectronBuildId: 10427718
Chromium: 128.0.6613.186
Node.js: 20.18.0
V8: 12.8.374.38-electron.0
OS: Windows_NT x64 10.0.26100
Steps to Reproduce:

1. you will get a false error `')' expected.` from a working code with a regex starting with `<!--`.
```HTML
<script>
let a = "abcdefg";
a = a.replace(/<!--/g, "");
</script>
```
Depending on where and how you use these regex, the false error could be
`')' expected.`, `Expression expected.`, and `Argument expression expected.`.
And I believe there are likely to be more of them.
| bug,html | low | Critical |
2,657,006,268 | flutter | Find a way to profile Java memory use in CI | We have a lot of tests that fail with some form of "Java heap space" error, e.g.
https://github.com/flutter/flutter/issues/157640
We've tried a couple of things,
https://github.com/flutter/flutter/pull/146275
https://github.com/flutter/flutter/pull/143085,
etc, but haven't had much luck.
It will be hard to make progress without more information. We could perhaps try to look at the log dump (the flag I added doesn't print it on failure it seems, but rather saves it to a file), or perhaps look in to a tool to try to evaluate how Java's memory usage is growing between steps (maybe https://github.com/patric-r/jvmtop?) to try to answer:
1. Are there particular steps which cause spikes?
2. Does the memory usage constantly grow over time?
3. Why do some runs fail and others succeed - is the memory usage meaningfully different from one run of the same test to the next? | tool,c: proposal,perf: memory,team-tool | low | Critical |
2,657,037,011 | flutter | Autosubmit merged a PR with many failed presubmits | https://github.com/flutter/flutter/pull/158880/checks

| team-infra,P2,triaged-infra | low | Critical |
2,657,069,488 | ui | [bug]: `SidebarGroupLabel` `transition-[margin,opa]` should be `transition-[margin,opacity]` | ### Describe the bug
I'm fairly new to TailwindCSS, so I believe this is a bug, but may be wrong.
It seems that `SidebarGroupLabel`'s `className` should use `transition-[margin,opacity]` instead of `transition-[margin,opa]`
`default`:
https://github.com/shadcn-ui/ui/blob/805ed4120a6a8ae6f6e9714cbd776e18eeba92c7/apps/www/registry/default/ui/sidebar.tsx#L431-L449
`new-york`:
https://github.com/shadcn-ui/ui/blob/805ed4120a6a8ae6f6e9714cbd776e18eeba92c7/apps/www/registry/new-york/ui/sidebar.tsx#L431-L449
Docs:
- https://tailwindcss.com/docs/transition-property
### Affected component/components
`SidebarGroupLabel`
### How to reproduce
1. Look at the `classNames`
2. Recognise that the shorthand `opa` isn't valid for a `transition` on `opacity`
### Codesandbox/StackBlitz link
_No response_
### Logs
_No response_
### System Info
```bash
N/A
```
### Before submitting
- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues | bug | low | Critical |
2,657,085,145 | rust | `std::arch::wasm::unreachable()` is stable but does not compile | I tried to build this code with `cargo build --target=wasm32-unknown-unknown`:
```rust
pub fn force_wasm_trap() {
std::arch::wasm::unreachable();
}
```
I expected to see this happen: compile succeeds, generates a function containing the wasm "unreachable" instruction, which is what [the documentation says it does](https://doc.rust-lang.org/core/arch/wasm/fn.unreachable.html).
Instead, this happened:
```plaintext
error[E0658]: use of unstable library feature 'simd_wasm64'
--> src/lib.rs:2:5
|
2 | std::arch::wasm::unreachable();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: see issue #90599 <https://github.com/rust-lang/rust/issues/90599> for more information
For more information about this error, try `rustc --explain E0658`.
```
I don't understand what happened: the documentation says this has been stable since rust 1.37.0, and I don't think there's any reason why the webassembly "unreachable" instruction would be tied to the unstable "simd_wasm64" feature.
I also tried with and without `#[no_std]` and using both `core::arch` and `std::arch`: all fail the same way.
### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->
`rustc --version --verbose`:
```
rustc 1.82.0 (f6e511eec 2024-10-15)
binary: rustc
commit-hash: f6e511eec7342f59a25f7c0534f1dbea00d01b14
commit-date: 2024-10-15
host: x86_64-unknown-linux-gnu
release: 1.82.0
LLVM version: 19.1.1
```
The same error happens with `1.83.0-beta.5` and `nightly-2024-11-12`.
| A-diagnostics,A-stability,O-wasm,D-papercut,D-imprecise-spans | low | Critical |
2,657,087,545 | pytorch | Get the forward/backward of a Dynamo function | ### 🚀 The feature, motivation and pitch
Pitch: Get the forward/backward of a Dynamo function
We (PyTorch/XLA) would like to get a symbolic graph representation (e.g. FX graph) of the forward and backward pass of a torch function, in order to implement a scan operator similar to `jax.lax.scan`. The forward pass returns the output and intermediate activations. The backward pass takes in intermediate activations and gradients w.r.t the output and returns gradients w.r.t the input. The forward of a `scan(fn, ...)` is built using the forward of `fn`, and the backward of a `scan(fn, ...)` is built using the backward of `fn`.
There are a few ways to get a symbolic representation. Since Dynamo has support for higher order operators such as `torch.utils.checkpoint` [1], we would like to explore getting the forward/backward of a `fn` using Dynamo.
I tried a bunch of ways of getting that information without changing PyTorch, and hit challenges. They are documented in this notebook: [2].
[1]: https://dev-discuss.pytorch.org/t/higher-order-operators-2023-10/1565
[2]: https://colab.research.google.com/drive/1qDGY3xPO5JWFJ3jeUHFMD1AnmksDHOOk?usp=sharing
### Alternatives
An alternative to using Dynamo is to use the symbolic tracing facilities in `functorch`. For example, we could use `functorch.compile.aot_function` to get the forward/backward of a `fn`. In our own testing, that works nicely for simple cases involve pure torch numerical operations, but it either errors or ignores `torch.utils.checkpoint` entirely.
### Additional context
_No response_
cc @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @amjames @zou3519 @ydwu4 @bdhirsh @yf225 @ezyang | feature,triaged,oncall: pt2,module: dynamo,module: higher order operators,module: pt2-dispatcher | low | Critical |
2,657,159,760 | vscode | Allow `fetch` for Data URIs such as WASM on the web | <!-- ⚠️⚠️ 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. -->
As a: web developer using VS Code for the Web,
I want to: be able to fetch and use WebAssembly (WASM) modules from Data URIs,
so that: I can pack my WASM (Rust Python etc) code into extensions LSPs and libraries without a `context.extensionUri`
----
This would allow webpack to provide reliable interop between desktop and web WASM. It would also avoid the many (semi-valid) hacks that exist, such as `CopyWebpackPlugin`, bloated Uint8Array babel loaders, and no errors caused by base64 not playing nicely with wasm characters | feature-request,web | low | Critical |
2,657,161,258 | godot | Godot export release doesn't pack enough data from C# | ### Tested versions
Godot 4.4.dev4.mono
### System information
Ubuntu 24.04
### Issue description
I'm exporting a project using Docker, which invokes Godot through the terminal with the following command:
```bash
godot.4.4.dev4.mono "path-to-my-project.godot" --export-release "Headless" --headless --quit
```
However, when I run the app, it doesn't behave as expected
### Steps to reproduce
**Reproduce via UI:**
1. Open the MRP project and create the export folder.
2. Export the project with the "Export All" -> "Release" option.
- Alternatively, click "Export Project..." and uncheck the "Export with Debug" option.
**Reproduce via command line:**
Run the following command:
```bash
./Godot_v4.4-dev_mono_linux.x86_64 "/home/ubuntu/GodotProjects/azheir/azheir/project.godot" --headless --export-release Headless --quit
```
### Minimal reproduction project (MRP)
[azheir.zip](https://github.com/user-attachments/files/17776222/azheir.zip)
To verify if the project export was successful, simply run the executable. It should print **Hello world** on startup.
| topic:dotnet,topic:export | low | Critical |
2,657,180,685 | react-native | Error compiling Metro iOS XCode 14.2 | ### Description
Hi everyone, I'm having this problem while compiling the App iOS with Xcode 14.2 on simulator
<img width="320" alt="Schermata 2024-11-14 alle 01 17 27" src="https://github.com/user-attachments/assets/22299156-fe1c-40cf-800c-2948a97a79b8">
I tried to check possible solutions, but I can't figure out how to solve this problem!
**node: v20.18**
**node-modules:**
_package.json_
{
"name": "App",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-brands-svg-icons": "^6.6.0",
"@fortawesome/free-regular-svg-icons": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-native-fontawesome": "^0.3.2",
"@react-native-async-storage/async-storage": "^2.0.0",
"@react-native-firebase/app": "^20.5.0",
"@react-native-firebase/messaging": "^20.5.0",
"@react-native-masked-view/masked-view": "^0.3.1",
"@react-native-picker/picker": "^2.8.1",
"@react-navigation/bottom-tabs": "^6.6.1",
"@react-navigation/core": "^6.4.17",
"@react-navigation/native": "^6.1.18",
"@react-navigation/stack": "^6.4.1",
"axios": "^1.7.7",
"expo-modules-core": "^1.12.24",
"hermes-engine": "^0.11.0",
"react": "18.2.0",
"react-native": "^0.72.3",
"react-native-bootsplash": "^6.1.3",
"react-native-gesture-handler": "^2.19.0",
"react-native-navigation": "^7.40.1",
"react-native-picker-select": "^9.3.1",
"react-native-reanimated": "^3.15.1",
"react-native-safe-area-context": "^4.10.9",
"react-native-screens": "^3.34.0",
"react-native-svg": "^15.6.0",
"react-navigation": "^5.0.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.75.2",
"@react-native/eslint-config": "0.75.2",
"@react-native/metro-config": "0.75.2",
"@react-native/typescript-config": "0.75.2",
"@types/react": "^18.0.24",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.2.1",
"eslint": "^8.19.0",
"jest": "^29.2.1",
"metro-react-native-babel-preset": "0.73.9",
"prettier": "^2.4.1",
"react-test-renderer": "18.2.0",
"typescript": "4.8.4"
},
"engines": {
"node": ">=18"
},
"packageManager": "yarn@1.22.22"
}
### Steps to reproduce
N/A
### React Native Version
0.72.3
### Output of `npx react-native info`
```text
System:
OS: macOS 12.7.6
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 624.72 MB / 16.00 GB
Shell:
version: 5.8.1
path: /bin/zsh
Binaries:
Node:
version: 20.18.0
path: ~/.nvm/versions/node/v20.18.0/bin/node
Yarn:
version: 1.22.22
path: ~/.nvm/versions/node/v20.18.0/bin/yarn
npm:
version: 10.8.2
path: ~/.nvm/versions/node/v20.18.0/bin/npm
Watchman: Not Found
Managers:
CocoaPods:
version: 1.16.2
path: /Users/edoardo/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 22.2
- iOS 16.2
- macOS 13.1
- tvOS 16.1
- watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Xcode:
version: 14.2/14C18
path: /usr/bin/xcodebuild
Languages:
Java: Not Found
Ruby:
version: 3.2.6
path: /Users/edoardo/.rbenv/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.17
wanted: ^0.72.3
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false
```
### Screenshots and Videos
_No response_ | Platform: iOS,Needs: Repro,Needs: Attention,Type: Unsupported Version | low | Critical |
2,657,214,804 | pytorch | Identical Formulas for BatchNorm, LayerNorm, InstanceNorm, GroupNorm | ### 📚 The doc issue
I have noticed that Batch Normalization (BN) and Layer Normalization (LN) are using the same formula in the docs:
- [BatchNorm1d](https://pytorch.org/docs/stable/generated/torch.nn.BatchNorm1d.html)
- [BatchNorm2d](https://pytorch.org/docs/stable/generated/torch.nn.BatchNorm2d.html)
- [BatchNorm3d](https://pytorch.org/docs/stable/generated/torch.nn.BatchNorm3d.html)
- [SyncBatchNorm](https://pytorch.org/docs/stable/generated/torch.nn.SyncBatchNorm.html)
- [LayerNorm](https://pytorch.org/docs/stable/generated/torch.nn.LayerNorm.html)
$$
y = \frac{x - \mathrm{E}[x]}{\sqrt{\mathrm{Var}[x] + \epsilon}} * \gamma + \beta
$$
What is not represented in the BN formula is that mean and variance are computed over the **mini-batch**.
Also, there are no indices specifying how it operates on individual elements of a vector or tensor.
### Suggest a potential alternative/fix
BN (without indices):
$$
y = \frac{x - \mathrm{E}\_{\text{batch}}[x]}{\sqrt{\mathrm{Var}\_{\text{batch}}[x] + \epsilon}} * \gamma + \beta
$$
As LaTeX code:
```latex
$$
y = \frac{x - \mathrm{E}_{\text{batch}}[x]}{\sqrt{\mathrm{Var}_{\text{batch}}[x] + \epsilon}} * \gamma + \beta
$$
``` | triaged,topic: docs | low | Minor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.