After upgrading Intellij to 2017.2, pub serve no longer finds all images, and claims some of them are cross session.

I am loading images into an image tag, and then using them to do canvas things.  In 2017.1 this was fine, but in 2017.2, it claims they are cross session scripting. " Failed to execute 'getImageData' on 'CanvasRenderingContext2D': The canvas has been tainted by cross-origin data."

I am using Dart and Dartium.  The images are hosted in the /images directory of the project.

0
4 comments

Might be related to redirection ( https://www.jetbrains.com/help/idea/running-and-debugging-dart-web-applications.html)

What image source do you use? Can see no issues when using

CanvasElement canvas = querySelector('canvas');
CanvasRenderingContext2D context = canvas.getContext('2d');
ImageElement image = new ImageElement(src: 'img/icon.png');
image.onLoad.listen((e) {
context.drawImageScaled(image, 0, 0, 55, 50);
});
0
Avatar
Permanently deleted user

My code is a multistage process. First it creates the ImageElement, and once it is loaded, it adds it to the DOM as a <img> tag that is hidden and with an ID that matches the image name (so I can reference it multiple times later).

When I want to draw, I get the image with

imageSelector(imageString)

The image is generally things like "images/Bodies/reg2.png"

0

please can you provide a sample project I can use to recreate the issue?

0
Avatar
Permanently deleted user

Attempting to provide a simple sample project failed to reproduce the issue, so it's likely some complicated mess of a problem. We did discover that putting all our files in a "web" directory and pulling the pubspec.yaml file up a directory fixed it, so at least we have a work around for now.

Our working assumption is that because it was using a different port number for every different subdirectory, it was treating them as cross session scripting.

0

Please sign in to leave a comment.