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 on Flutter Web #242

Closed
marciovalim opened this issue Jul 15, 2021 · 17 comments
Closed

Bug on Flutter Web #242

marciovalim opened this issue Jul 15, 2021 · 17 comments
Labels
bug Something isn't working web

Comments

@marciovalim
Copy link

TypeError: result[$item] is not a function
at speech_to_text_web.SpeechToTextPlugin.new.[_onResult] (http://localhost:57473/packages/speech_to_text/speech_to_text_web.dart.lib.js:143:36)
at http://localhost:57473/packages/speech_to_text/speech_to_text_web.dart.lib.js:97:98
at Object._checkAndCall (http://localhost:57473/dart_sdk.js:5246:16)
at Object.dcall (http://localhost:57473/dart_sdk.js:5251:17)
at SpeechRecognition. (http://localhost:57473/dart_sdk.js:100646:100)

@phonghoang2k
Copy link

i've got the same issue, looking for help.

@marciovalim
Copy link
Author

@phonghoang2k if you find any answer, please tell me

@sowens-csd
Copy link
Contributor

Can you give me some details to help make this reproducible?

  • Plugin version
  • Browser type and version
  • Flutter version
  • OS (Windows, Mac, Android, iOS,Linux)
  • Is this reproducible in the example app?

@phonghoang2k
Copy link

Please check this issue. I got all when start listening.

@sowens-csd
Copy link
Contributor

Thanks, I've reproduced it, looking for a cause now.

@sowens-csd sowens-csd added bug Something isn't working web and removed waiting for response labels Jul 18, 2021
@sowens-csd
Copy link
Contributor

As far as I can tell something has gone wrong with the Flutter JS binding for the speech recognition API. This definitely used to work in previous Flutter versions. I just filed an issue with the Flutter team hoping they can give me some guidance. The issue is here flutter/flutter#86621. Feel free to upvote if this is causing you problems.

@sowens-csd
Copy link
Contributor

For those following along here the bug has been accepted by the initial review as a regression in Flutter, see the issue linked above. If you need Web support for speech recognition currently you'll need to stick with Flutter 2.0.6 or before. I'm hopeful that a patch to the 2.2.x series will fix the regression but I have no idea how quickly regressions are addressed.

@proddam
Copy link

proddam commented Jul 26, 2021

BTW https://github.com/csdcorp/speech_to_text/tree/main/multi_platform_example works with Flutter 2.2.3 in my Chrome web browser. But if I create a new flutter project and copy main.dart and speech_main.dart into the project and run, I got the same exception. @sowens-csd Have you tried the multi_platform_example with Flutter 2.2.3?

Here is my flutter doctor -v output:

[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-x64, locale en-KR)
    • Flutter version 2.2.3 at /Users/abcdef/Projects/flutter/flutter
    • Framework revision f4abaa0735 (4 weeks ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/abcdef/Library/Android/sdk
    • Platform android-30, build-tools 29.0.3
    • ANDROID_HOME = /Users/abcdef/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
    • Android Studio at /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 11.0.8+10-b944.6916264)

[✓] VS Code (version 1.58.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.24.0

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.107

• No issues found!

@sowens-csd
Copy link
Contributor

Thanks @proddam I'm not sure what's going on, I am pretty sure I had reproduced the failure in that app previously. However, I just tried it expecting to find that it fails and I am very surprised that it worked for me as well. The only difference I can think of right now is that multi_platform_example has a relative reference to the plugin while in a new project there is a reference to the release version on pub.dev. I'll try a dependency on the repo and see what happens there.

@marciovalim
Copy link
Author

@sowens-csd any update?

@tuanduy183
Copy link

tuanduy183 commented Aug 18, 2021

i encountered this bug at localhost. Then i deploy and bug is fixed :))

@marciovalim
Copy link
Author

For me it continues not working @tuanduy183

@edwinyoo44
Copy link

i encountered this bug at localhost. Then i deploy and bug is fixed :))

I just tried it once and nothing can be done. What is your version?

@k00na
Copy link

k00na commented Nov 10, 2021

Same probleme here, a fix would be very welcome :)

@sowens-csd
Copy link
Contributor

Sorry folks, the issue remains open on the Flutter issue list. They seem to have identified the exact commit that introduced the problem but I see nothing that would indicate that a fix is even available in a patch yet. That's pretty bad given that the issue was identified back in July and they agreed that it's a clear regression. Because Flutter has mapped all of the speech APIs for the web they have to be the ones that resolve it.

@sowens-csd
Copy link
Contributor

Finally some good news on this. The Flutter team has suggested a work around for the issue. I've just committed a possible fix. This is working in the example app on Chrome. If anyone else could try this fix out in other environments and in their owns apps that would be very helpful. Once we confirm this is working I'll push an update to pub.dev.

@sowens-csd
Copy link
Contributor

5.3.0 is now on pub.dev. I'm going to close this, mostly so I get a feeling of accomplishment. If anyone has issues with the web please open a new 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 web
Projects
None yet
Development

No branches or pull requests

7 participants