Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: flutter_svg integrations broken with vector_graphics_compiler #537

Closed
2 tasks done
Conrad33 opened this issue Jul 4, 2024 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@Conrad33
Copy link

Conrad33 commented Jul 4, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Version

5.6.0

Command type

build_runner (Default)

What happened?

Now that #530 is merged, there is support for asset transformation. However, when using vector_graphics_compiler the .svg() integrations throw an error at runtime due to failing to parse XML. It seems that flutter_gen expects the .svg files to not be compiled.

I opted to label this issue as a bug instead of a feature request because the error is only encountered at runtime, but feel free to change.

Relevant a pubspec.yaml.

flutter:
  assets:
    - path: assets/logo.svg
      transformers:
        - package: vector_graphics_compiler

Relevant log output

Error
dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 296:3  throw
packages/xml/src/xml_events/iterator.dart 43:9                               moveNext
packages/vector_graphics_compiler/src/svg/parser.dart 673:27                 _readSubtree
packages/vector_graphics_compiler/src/svg/parser.dart 764:19                 [_parseTree]
packages/vector_graphics_compiler/src/svg/parser.dart 799:5                  parse
packages/vector_graphics_compiler/vector_graphics_compiler.dart 76:16        parse
packages/vector_graphics_compiler/vector_graphics_compiler.dart 143:5        encodeSvg
packages/flutter_svg/src/loaders.dart 168:14                                 <fn>
packages/flutter_svg/src/utilities/compute.dart 12:38                        _testCompute
packages/flutter_svg/src/loaders.dart 154:21                                 <fn>
dart-sdk/lib/async/zone.dart 1661:54                                         runUnary
dart-sdk/lib/async/future_impl.dart 163:18                                   handleValue
dart-sdk/lib/async/future_impl.dart 847:44                                   handleValueCallback
dart-sdk/lib/async/future_impl.dart 876:13                                   _propagateToListeners
dart-sdk/lib/async/future_impl.dart 652:5                                    [_completeWithValue]
dart-sdk/lib/async/future_impl.dart 722:7                                    callback
dart-sdk/lib/async/schedule_microtask.dart 40:11                             _microtaskLoop
dart-sdk/lib/async/schedule_microtask.dart 49:5                              _startMicrotaskLoop
dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7           <fn>

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Conrad33 Conrad33 added the bug Something isn't working label Jul 4, 2024
@AlexV525
Copy link
Member

AlexV525 commented Jul 4, 2024

You'll need to use the raw path to combine with the transformer. The generated file knows nothing with the defined transformers.

@AlexV525 AlexV525 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants