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

dart2js - Uncaught TypeError: Cannot read property 'Event' of null - using Dev Channel build #17119

Closed
DartBot opened this issue Feb 25, 2014 · 2 comments
Labels
closed-obsolete Closed as the reported issue is no longer relevant type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js

Comments

@DartBot
Copy link

DartBot commented Feb 25, 2014

This issue was originally filed by cor...@gmail.com


What steps will reproduce the problem?

Given the following HTML:

    <!doctype html>
    <html lang="en">
    <head>
        <script type="application/dart" src="main.dart"></script>
        <script type="text/javascript" src="dart.js"></script>
    
    </head>
    <body>
    
    <div class="top-menu">
        <!-- dynamic content here -->
    </div>
    
    </body>
    </html>

Given the following Dart code:

    import "dart:html";
    
    void main() {
    
        DivElement container = querySelector(".top-menu");
    
        container.appendHtml("Test");
    
    }

When compiling the Dart to JavaScript with the following command:

    dart2js --enable-checked-mode --analyze-all --enable-diagnostic-colors -o main.dart.js main.dart

What is the expected output? What do you see instead?

When I visit the HTML page using regular Chrome I get the following error in the output:

    Uncaught TypeError: Cannot read property 'Event' of null main.dart.js:8243
    finishClass main.dart.js:8243
    finishClass main.dart.js:8239
    Isolate.$finishClasses main.dart.js:8271
    (anonymous function) main.dart.js:7175
    (anonymous function)

A very strange HTTP-request is also performed, where the URI includes the local path to my sdk. See screen shot.

What version of the product are you using? On what operating system?

    Windows 8.1
    Dart VM version: 1.2.0-dev.5.15 (Mon Feb 24 01:59:24 2014) on "windows_ia32"

Please provide any additional information below.

Live problem:

https://dl.dropboxusercontent.com/u/8183146/temp/dart/problem2_dev_channel/index.html


Attachment:
error1.png (17.70 KB)

@floitschG
Copy link
Contributor

Added Area-Dart2JS, Triaged labels.

@floitschG
Copy link
Contributor

Without the "--analyze-all" flag the code works.
This seems to be a bad interaction between the analyze-all and the codegen.

@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js
Projects
None yet
Development

No branches or pull requests

4 participants