본문 바로가기
에러 해결방법

[에러] flutter_tts_web.dart:3:8: Error: Dart library 'dart:js_interop' is notavailable on this platform.

by 개발짜 2025. 2. 10.

tts 라이브러리를 추가하고 다시 실행하는 데 빌드가 안된다... flutter clean 도 해보고 pod 파일도 다시 삭제했다가 빌드해보지만 여전히 오류가 나면서 실행은 되지 않는다. 

 

문제

flutter_tts_web.dart:3:8: Error: Dart library 'dart:js_interop' is not available on this platform.

flutter_tts_web 이 import 되어있어서 발생하는 오류라고 한다.

 

해결 방법

 

flutter_tts 를 대신 사용하는 것을 권장한다고한다. tts_web 부분을 지우고 빌드하자마자 거짓말같이 실행이 되었다.

나는 정말 억울했다.. flutter web 버전은 지원하지 않기 때문에 tts_web 을 사용할 이유가 없었고 직접 import 를 한 기억도 없어서 import 되어있는 부분은 확인하지 않았다. 이거 때문에 이유도 모르는 채 몇시간을 허비했다...^^

 

https://github.com/dart-lang/sdk/issues/54222

 

flutter_tts-3.8.5/lib/flutter_tts_web.dart:3:8: Error: Dart library 'dart:js' is not available on this platform. · Issue #54222

/C:/Users/pc/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_tts-3.8.5/lib/flutter_tts_web.dart:3:8: Error: Dart library 'dart:js' is not available on this platform. import 'dart:js' as js; ^ Contex...

github.com

 

댓글