Flutter -

67 views
Skip to first unread message

Heli Perera

unread,
May 23, 2020, 9:27:45 PM5/23/20
to Flutter Development (flutter-dev)
Need help... did anyone get a compiler error like this.."Compiler message: lib/main.dart:1:8: Error: Not found: 'dart:js' import 'dart:js';" and how to fix it?
Thanks !
Dart.js Error.JPG

Souvik Dutta

unread,
May 23, 2020, 10:55:48 PM5/23/20
to Heli Perera, Flutter Development (flutter-dev)

I think you are using stable channel so try to switch to beta channel. Open your terminal and run,

$ flutter channel beta

On Sun, 24 May, 2020, 6:57 am Heli Perera, <hemamali...@gmail.com> wrote:
Need help... did anyone get a compiler error like this.."Compiler message: lib/main.dart:1:8: Error: Not found: 'dart:js' import 'dart:js';" and how to fix it?
Thanks !

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/9245594f-9ed5-4210-ae3f-61531fe7b897%40googlegroups.com.

Heli Perera

unread,
May 24, 2020, 6:53:27 AM5/24/20
to Souvik Dutta, Flutter Development (flutter-dev)
  HI,

Thank you so much for your reply. I am new to flutter and using Android Studio, Could you please tell me how to do it in Android Studio? 

Souvik Dutta

unread,
May 24, 2020, 7:04:38 AM5/24/20
to Heli Perera, Flutter Development (flutter-dev)
There is a terminal tab at the bottom of the screen. Press on it and run flutter channel beta

Hassan Hammad

unread,
May 24, 2020, 9:15:15 AM5/24/20
to Heli Perera, Flutter Development (flutter-dev)
I dont think you need to switch the channel.
If i remember correctly i had this error too, and found out that i had an import that i wasnt aware of and wasnt using at all: "dart:js". I simply removed it and the error went away.

This might happen bcz of a typo, as Android studio automatically adds imports while you type your code. 

On Sun, 24 May 2020, 6:27 am Heli Perera, <hemamali...@gmail.com> wrote:
Need help... did anyone get a compiler error like this.."Compiler message: lib/main.dart:1:8: Error: Not found: 'dart:js' import 'dart:js';" and how to fix it?
Thanks !

--

Heli Perera

unread,
May 25, 2020, 8:46:46 PM5/25/20
to Hassan Hammad, Flutter Development (flutter-dev)
Thanks for the clarification. It worked ! 
Reply all
Reply to author
Forward
0 new messages