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

ffi imported when compiling for web wasm #244

Open
flrnsbt opened this issue Jun 10, 2024 · 13 comments
Open

ffi imported when compiling for web wasm #244

flrnsbt opened this issue Jun 10, 2024 · 13 comments

Comments

@flrnsbt
Copy link

flrnsbt commented 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;

@flrnsbt flrnsbt changed the title ffi imported when compiling for web was ffi imported when compiling for web wasm Jun 10, 2024
@flrnsbt
Copy link
Author

flrnsbt commented Jun 10, 2024

Works well with javascript web

@tusharbhambere
Copy link

+1

@luckyhandler
Copy link

luckyhandler commented 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

@NotTsunami
Copy link

This is currently breaking our build pipeline as well, downgrading to 3.22.1 fixed it

@trunghieuvn
Copy link

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

@chandrabezzo
Copy link

chandrabezzo commented 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?

@Trung15010802
Copy link

any updates?

@nohli
Copy link

nohli commented 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

@Trung15010802
Copy link

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
image

@nohli
Copy link

nohli commented Jun 28, 2024

Neither works for me

image

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?

@Trung15010802
Copy link

Thank you for your support! I will open a issue in win32 package

@uldall
Copy link

uldall commented 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.

@nohli
Copy link

nohli commented Jul 18, 2024

This is fixed in the latest Flutter stable release 3.22.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants