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

flutter web : Another exception was thrown: Instance of 'minified:aM<void>' #47880

Closed
lyf571321556 opened this issue Dec 27, 2019 · 11 comments
Closed
Labels
c: crash Stack traces logged to the console d: stackoverflow Good question for Stack Overflow dependency: dart Dart team may need to help us platform-web Web applications specifically

Comments

@lyf571321556
Copy link

lyf571321556 commented Dec 27, 2019

dart code:

code sample
class _EditDialogState extends State<_EditDialog> {
  bool ready = false;
  html.IFrameElement _ifram;
  @override
  void didUpdateWidget(_EditTaskDecriptionDialog oldWidget) {
    // TODO: implement didUpdateWidget
    super.didUpdateWidget(oldWidget);
  }

  @override
  void dispose() {
    // TODO: implement dispose
    //更新成功之后关闭对话框
    _ifram.remove();
    html.window.removeEventListener("message", (event){
      print("remove message");
    });
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    _ifram = html.IFrameElement()
      ..width = ui.window.physicalSize.width.toString()
      ..height = ui.window.physicalSize.height.toString()
      ..src = './assets/assets/editor_package/editor.html'
      ..id = 'ckeditor'
      ..className = 'ckeditor'
      ..name = 'ckeditor'
      ..style.border = 'none';
    html.window.addEventListener('message', (event) {
      if (event is html.MessageEvent) {
        var data = json.decode(event.data.toString());
        print(data['event']);
        switch (data['event']) {
          case "onEditorRendered":
              String content = '{"event":"setEditorContent","param":"' +
                  Uri.encodeComponent("test") +
                  '"}';
              _ifram.contentWindow.postMessage(content, '*');
            break;
          case "onRequestResources":
            if (data['param'] != null) {
                String content = '{"event":"setResources","param":"' +
                    Uri.encodeComponent('test') +
                    '"}';
                _ifram.contentWindow.postMessage(content, '*');
            }
            break;
          case "onReceiveEditorContent":
              Navigator.of(context).pop();
            break;
          case "onEditorFocused":
            break;
          case "onContentReady":
            break;
          case "onContentRendered":
            ready = true;
            break;
        }
      }
    });

    ui.platformViewRegistry
        .registerViewFactory('editor-panel', (int viewId) => _ifram);

    return new Scaffold(
      appBar: new AppBar(
        title: const Text('view/edit'),
        actions: [
          new FlatButton(
              onPressed: () {
                print("windown3:");
                print(_ifram.contentWindow);
                if (ready && _ifram.contentWindow != null) {
                  _ifram.contentWindow.postMessage(
                      '{"event":"getEditorContentWithOutReturnValue","param":"save"}',
                      '*');
                }
              },
              child: new Text('Save',
                  style: Theme.of(context)
                      .textTheme
                      .subhead
                      .copyWith(color: Colors.white))),
        ],
      ),
      body: HtmlElementView(viewType: 'editor-panel'),
    );
  }
}

dart --> js:
    Z.TP.prototype = {
        $0: function() {
            P.c2("windown3:")
            var u = this.a
            P.c2(W.m0(u.e.contentWindow))
            if (u.d && W.m0(u.e.contentWindow) != null)
                J.Zn(W.m0(u.e.contentWindow), '{"event":"getEditorContentWithOutReturnValue","param":""}', "*")
        },
        $S: 0
    }

it occurs this error when i clicked 'FlatButton';

flutter version:

 🍎   ~  flutter doctor -v                              489  19:56:03 
[✓] Flutter (Channel master, v1.13.1-pre.79, on Mac OS X 10.13.6 17G8037, locale
    zh-Hans-CN)
    • Flutter version 1.13.1-pre.79 at /Users/admin/Library/flutter
    • Framework revision 81aa2710d2 (2 weeks ago), 2019-12-09 21:31:34 -0800
    • Engine revision 2805da9e5d
    • Dart version 2.7.0 (build 2.7.0-dev.2.1 8b8894648f)


[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/admin/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at:
      /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/bin/java
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
    • All Android licenses accepted.

[✗] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS
      development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch
    ✗ CocoaPods not installed.
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To install:
        sudo gem install cocoapods

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

[!] Android Studio (not installed)
    • Android Studio not found; download from
      https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/setup/#android-setup for detailed
      instructions).

[✓] IntelliJ IDEA Ultimate Edition (version 2018.3.4)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 39.0.1
    • Dart plugin version 183.6270

[✓] Connected device (2 available)
    • Chrome     • chrome     • web-javascript • Google Chrome 79.0.3945.88
    • Web Server • web-server • web-javascript • Flutter Tools

command-line arguments:
flutter run -d chrome --release --web-port=55140

@iapicca iapicca added d: stackoverflow Good question for Stack Overflow dependency: dart Dart team may need to help us e: web_html HTML rendering backend for Web c: crash Stack traces logged to the console platform-web Web applications specifically labels Dec 27, 2019
@synapp009
Copy link

synapp009 commented Dec 31, 2019

I'm having the same problem.
MaterialApp -> Scaffold -> AppBar(

actions: <Widget>[
          IconButton(
            onPressed: () {
              //do something
            },
            icon: Icon(Icons.library_add),
          ),]

Flutter 1.13.5 • channel dev • https://github.com/flutter/flutter.git Framework • revision 41a911099b (vor 12 Tagen) • 2019-12-19 13:48:02 -0800 Engine • revision 0f90e6546b Tools • Dart 2.8.0 (build 2.8.0-dev.0.0 aa6709974d)

Also getting this:

Could not load content for org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/js_primitives.dart : HTTP status code: 404

shortly after this:
TypeError: Cannot read property 'requestContent' of undefined

@yjbanov yjbanov added this to the Near-term Goals milestone Jan 3, 2020
@yjbanov yjbanov removed the e: web_html HTML rendering backend for Web label Jan 3, 2020
@mahmoudsalah37
Copy link

i have the same error
code
work well in debug mode but when deploy this bug occur

@ferhatb
Copy link
Contributor

ferhatb commented Jan 7, 2020

@mahmoudsalah37 : cloned and ran your app using flutter run -d chrome --release on master channel, was not able to repro. Can you please list steps to repro crash? (Tried +AddNew on top and it opened dialog fine)

@ferhatb ferhatb added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 7, 2020
@abcnow
Copy link

abcnow commented Jan 28, 2020

I'm having the same problem.
MaterialApp -> Scaffold -> AppBar(

actions: <Widget>[
          IconButton(
            onPressed: () {
              //do something
            },
            icon: Icon(Icons.library_add),
          ),]

Flutter 1.13.5 • channel dev • https://github.com/flutter/flutter.git Framework • revision 41a911099b (vor 12 Tagen) • 2019-12-19 13:48:02 -0800 Engine • revision 0f90e6546b Tools • Dart 2.8.0 (build 2.8.0-dev.0.0 aa6709974d)

Also getting this:

Could not load content for org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/js_primitives.dart : HTTP status code: 404

shortly after this:
TypeError: Cannot read property 'requestContent' of undefined

I am getting the same error on the web.. mobile app works perfectly.. run debug and no error comes up but when deployed the app on the web.. it is giving me this error:
Could not load content for org-dartlang-sdk:///sdk/lib/_internal/js_runtime/lib/js_primitives.dart : HTTP status code: 404
I click on one button to load content from the page.. it works the first time.. but then it freezes.. It doesn't allow me to click on any other button on the page.. so it is not loading content properly

@no-response
Copy link

no-response bot commented Jan 28, 2020

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

@iapicca
Copy link
Contributor

iapicca commented Feb 11, 2020

Could everyone who still has this problem please file a new issue with the exact descriptions what happens, logs and the output of 'flutter doctor -v' please.
All system setups can be slightly different so it's always better to open new issues and reference related issues.

@dnishimoto
Copy link

Could not load content for org-dartlang-sdk:///lib/_internal/js_runtime/lib/js_primitives.dart (HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME)

I am getting this error running chrome on windows 7 and it is halting my web page from loading. All code is running as https

@mwlopez
Copy link

mwlopez commented Nov 6, 2020

Hi everybody,
I've been the same problem, where the origin of this problem, in my case, were Expanded Controls in flutter web, when I tried use multiple expanded controls, for instance

Column: (
Children: [
Text('Hello'),
Expanded(child: BodyContainer()),
]
)

in BodyContainer():

Row: (
Children: [
Expanded(child: Text('hello container'),),
],
)

I guess multiple inheritance with expanded controls are the main problem, from my point of view it's sound logic.

@pedromassangocode pedromassangocode removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 20, 2020
@mahdismall9
Copy link

the issue when occurs use expanded or flexible in project when it solve you remove it and set height or width on your Widget

@colbymaloy
Copy link

colbymaloy commented Dec 3, 2020

I was just getting this error - after running it on iOS simulator i got a more understandable error. Turns out i was trying to modify a list while still in a for loop iteration. after fixing that, its running just fine

@github-actions
Copy link

github-actions bot commented Aug 9, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console d: stackoverflow Good question for Stack Overflow dependency: dart Dart team may need to help us platform-web Web applications specifically
Projects
None yet
Development

No branches or pull requests