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

Type Error in Chrome. Please try the 1st EaselJS demo (flowers). It fails. Please help. #321

Closed
dynamic-solutions opened this issue May 24, 2013 · 15 comments

Comments

@dynamic-solutions
Copy link

Im aware of this issue as it happened in my project just recently. It seems to be based around the bitmap initialising.
To reproduce: Initialise a bitmap image and add it to stage. It will not display in Chrome. (The Type Error may show in console).

@gskinner
Copy link
Member

Can you provide more information? I am unable to reproduce this, and would expect it to be widely reported if it was a library issue (since almost every project uses Bitmap). I'm testing with Chrome 27.0.1453.93 OSX.

Thanks!

@dynamic-solutions
Copy link
Author

Here are my screen shots. My version was exaclty yours, but Chrome just gave an update to .94m. Still no change.
chrome_version
easel_flower_demo_blank.

The blank screen is what I get by simply trying the 1st demo.

And here is my project code that does not show a bitmap on the stage. Shapes work OK.

var img = new Image();
img.src = "Content/Images/XSpanShedsImages/Window.jpg";

        var bitmap = new createjs.Bitmap(img);
        stage.addChild(bitmap);

        bitmap.x = 190;
        bitmap.y = 110;

        stage.update();

Aaron

@sebastianderossi
Copy link

The issue is that your image hasn't been loaded, wait for the image to be loaded before you create your Bitmap.
For instance:

var img = new Image();
img.src = myurl.jpg;

img.onload = function () {
var bitmap = new createjs.Bitmap(this);
stage.addChild(bitmap);

    bitmap.x = 190;
    bitmap.y = 110;

    stage.update();

}

@gskinner
Copy link
Member

@dynamic-solutions - Sebastian is correct about the issue with your code. You are only updating the stage before the bitmap finishes loading, so it never shows up.

I'm at a loss to explain why the daisies demo doesn't work for you though. I'm unable to reproduce, and haven't seen any other reports of it. Could you also provide the full details of the error that is being generated in the console?

@dynamic-solutions
Copy link
Author

Thanks for the onload code snippet, sebastianderossi

Unfortunately the issue remains.

Please refer to issue #323. I do believe it is connected.

As requested: 1st here are screen shots of flower demo, and console error. 2nd is my code snippet and console error.

flowers_demo_error
flowers_demo_error_-_code_break

My snippet causing same error.

        var img = new Image();
        img.src = "Content/Images/XSpanShedsImages/Window.jpg";

        //img.onload = loadImg();

        img.onload = function () {
            debugger;

            //try 1 - No image, no error in console

// var bitmap = new createjs.Bitmap(this);
// stage.addChild(bitmap);
// bitmap.x = 100;
// bitmap.y = 110;

            //try 2 - No image Uncaught TypeError: Type Error
            var bitmap = new createjs.Bitmap(this);
            bitmap.alpha = 0.5;
            bitmap.off
            //dragging code
            var dragger = new createjs.Container();
            dragger.x = 100;
            dragger.y = 100; 
            dragger.addChild(bitmap);
            stage.addChild(dragger);

            stage.update();
        }

myproject_type_error
myproject_typeerror_source

And this has just started 5 days ago.

@sebastianderossi
Copy link

hmmm... seems strange. Like Grant said before can you give us more information, for instance
What type of OS are you running?
What does DrawShed.aspx look like?
What does "bitmap.off" do?
Is this "Content/Images/XSpanShedsImages/Window.jpg" a correct path to your image?
With the code I posted you shouldn't have any issue loading an image if the path to the image is correct.

Have a look at this, see if this runs for you.
http://jsfiddle.net/sebastian_derossi/MNwpC/

@rwolffgang
Copy link

We also saw this error popping up 5 days ago, only in Chrome 27. The code wasn't touched, and it was running flawlessly until then. Our code is still on EaselJS 5.0.

PDF print of errorception

@dynamic-solutions
Copy link
Author

Hi sebastianderossi,
My Chrome Version is 27.0.1453.94M. The operating systems being used are XP and Windows 7, both failing. I am in New Zealand, perhaps this is a region issue.
ignore the "bitmap.off", removing this does not help. (This is a shape property not used, just me being untidy)
It is a correct path. The http://jsfiddle.net/sebastian_derossi/MNwpC/ does not show images either.

I use jsfiddle also, it stopped working when I 1st reported this. (approx 8 days ago)

@gskinner
Copy link
Member

Definitely looks like this is something specific to the latest Chrome on Win7. Not occurring on OSX. We'll look into this, but if you are successful in fixing this or gather more info, please share.

@dynamic-solutions
Copy link
Author

More info,
In running the Easeljs Flower demo, please note the screen shots.

p_not_defined

imageoruri_not_defined

It appears the variables are undefined.
Hope this helps.

@gskinner
Copy link
Member

I've tested in the same version of Chrome (v 27.0.1453.94 m) in Windows 7, and both examples work for me (daisy example + JSFiddle example) with no problem.

The variables in the error message you posted are also very unusual. You can see that "p" is defined, and "imageOrUri" is a param. I have to assume there's some kind of parsing error occurring, but without being able to reproduce it, it is nearly impossible for me to narrow it down. Is it possible you have some extension(s) installed that are causing a conflict?

@dynamic-solutions
Copy link
Author

Removing extensions WORKED!!!
I have removed 3 extensions.
Not exactly sure of their names but here they are:

  1. Notifyer (ran in bkgnd, gives a message popup)
  2. XML Path Finder (ran in bkgnd, I believe it may have altered the bitmap paths, relatively)
  3. XML Reader (ran in bkgnd, not sure what ist did)

I never used these, and was only interested in what they could be used for. But I have had these extensions for over 12 months.

At any case this has worked.

Thank you very much gskinner, and all those helping me to resolved this.

@gskinner
Copy link
Member

Great to hear! Any chance you could isolate which extension is causing the issue (so we can report it)?

Sent from my mobile, please excuse typos & brevity.

On 2013-05-27, at 5:49 PM, Aaron notifications@github.com wrote:

Removing extensions WORKED!!!
I have removed 3 extensions.
Not exactly sure of their names but here they are:

  1. Notifyer (ran in bkgnd, gives a message popup)
  2. XML Path Finder (ran in bkgnd, I believe it may have altered the bitmap paths, relatively)
  3. XML Reader (ran in bkgnd, not sure what ist did)

I never used these, and was only interested in what they could be used for. But I have had these extensions for over 12 months.

At any case this has worked.

Thank you very much gskinner, and all those helping me to resolved this.


Reply to this email directly or view it on GitHub.

@dynamic-solutions
Copy link
Author

I have found the extension.

Extrension: "XV - XML Viewer"

xml_viewer_causes_issue

To reproduce,
Add the extension. Close, reopen Chrome, try Flower demo, Fails.
Remove extension. Close, reopen, try flower demo, Works.

I didnt setup the "XML Viewer" in any way, just added it.

Thanks

@gskinner
Copy link
Member

I've opened an issue with the extension's developer:
Samirla/xmlview#40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants