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

Build failed on iOS with 'dart:js' error #158

Closed
chyiiiiiiiiiiii opened this issue Nov 1, 2023 · 2 comments
Closed

Build failed on iOS with 'dart:js' error #158

chyiiiiiiiiiiii opened this issue Nov 1, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@chyiiiiiiiiiiii
Copy link

chyiiiiiiiiiiii commented Nov 1, 2023

Expected Behavior

Should run the app successfully.

Current Behavior

It appears the error about dart:js is not available.

Possible Solution

Steps to Reproduce

  1. Use newest version amplitude_flutter: ^3.16.0
  2. Run iOS

Environment

  • SDK Version: v3.16.0
  • Flutter Version: v3.13.6
  • Device: iPhone 15 Pro Simulator

iShot_2023-11-01_16 47 26

@chyiiiiiiiiiiii chyiiiiiiiiiiii added the bug Something isn't working label Nov 1, 2023
@Mercy811
Copy link
Contributor

Mercy811 commented Nov 1, 2023

Hi @chyiiiiiiiiiiii, thanks for choosing Amplitude.

The error message you're encountering suggests that the Dart library 'dart:js' is being used in your Flutter project, but it's not available on the iOS platform. This is because 'dart:js' is a library intended for web development and is not supported in Flutter applications that target iOS or Android. To resolve this issue, you'll need to identify where 'dart:js' is being used in your project.

I confirm that Amplitude Flutter SDK is not using 'dart:js" and I can run the example project on my local.

I would suggest to check if it's using elsewhere in your project. Hope this helps.

image

@Mercy811 Mercy811 closed this as completed Nov 1, 2023
@jagged91
Copy link

FYI, I had the same issue until I realized that VSCode automatically imported the JS version of the library when I added the init function. Just in case others see the same issue.

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

3 participants