1

I am running the basic ipycanvas sample code

from ipywidgets import Image

sprite1 = Image.from_file("lena.jpeg")

canvas = Canvas(width=300, height=300)

canvas.fill_style = "#a9cafc"
canvas.fill_rect(0, 0, 300, 300)

canvas.draw_image(sprite1, 50, 50)

canvas

I get a javacript error in the chrome developer tool, I see the error Refused to execute script from 'http://localhost:8888/static/ipycanvas.js?v=20230418165310' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.

What could be wrong. I have been playing with ipycanvas and ipywidgets versions all day.

bhomass
  • 3,414
  • 8
  • 45
  • 75

1 Answers1

1

You're probably using Jupyter Lab, try Jupyter Notebook instead

endocringe
  • 137
  • 6
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 12 '23 at 17:51