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

Unable to compile for Web #42

Closed
shaheermirzacs opened this issue Apr 4, 2020 · 3 comments · Fixed by #44
Closed

Unable to compile for Web #42

shaheermirzacs opened this issue Apr 4, 2020 · 3 comments · Fixed by #44

Comments

@shaheermirzacs
Copy link

Hi! Thank you so much for this library!

I'm using Flutter 1.15.17 on the beta channel to build web apps. Once I do import 'package:spotify/spotify.dart', I'm introduced to a compiler error

Compiler message:
../../../../.pub-cache/hosted/pub.dartlang.org/spotify-0.3.0/lib/src/spotify_mock.dart:26:20: Error: Too few positional arguments: 2 required, 1 given.
    var file = File('test/data/$partialPath.json');
                   ^
Failed to compile application.

From delving into the code, I'm seeing that if the app is a web app the package imports dart:html, but the File constructor in html takes two arguments instead of the one given

factory File(List<Object> fileBits, String fileName, [Map options])

I could be doing something wrong, so any insight would be very helpful

Thank you again!

@shaheermirzacs
Copy link
Author

So I removed the test directory and spotify_mock.dart while also commenting out the dependency in spotify.dart. It works for web now! The issue lies with the test.

@LeviHassel
Copy link
Collaborator

Hi @thelostmachine, thanks for all of the details on the issue!

Could you try using the branch for #44 and see if that fixes the problem for you?

@shaheermirzacs
Copy link
Author

Ah sorry for the late reply @LeviHassel
It works beautifully now! Thank you so much!

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

Successfully merging a pull request may close this issue.

2 participants