Skip to content

image-url does not work in command-line pyret #1831

@schanzer

Description

@schanzer

The following code...

include image
image-url("https://bootstrapworld.org/images/icon.png")

Generates the following error...

The run ended in error:
Abstraction breaking: Uncaught JavaScript error:
TypeError: rawImage.setAttribute is not a function
    at Pause.resumer (/Users/schanzer/Documents/Bootstrap/Development/curriculum/lessons/Data-Science/advanced-visualizations/langs/en-us/authoring/.pyret/generate-pyret-images.jarr:185164:20)
    at Immediate.iter [as _onImmediate] (/Users/schanzer/Documents/Bootstrap/Development/curriculum/lessons/Data-Science/advanced-visualizations/langs/en-us/authoring/.pyret/generate-pyret-images.jarr:163689:41)
    at process.processImmediate (node:internal/timers:505:21)Stack trace:
TypeError: rawImage.setAttribute is not a function
    at Pause.resumer (/Users/schanzer/Documents/Bootstrap/Development/curriculum/lessons/Data-Science/advanced-visualizations/langs/en-us/authoring/.pyret/generate-pyret-images.jarr:185164:20)
    at Immediate.iter [as _onImmediate] (/Users/schanzer/Documents/Bootstrap/Development/curriculum/lessons/Data-Science/advanced-visualizations/langs/en-us/authoring/.pyret/generate-pyret-images.jarr:163689:41)
    at process.processImmediate (node:internal/timers:505:21)

If I had to guess, it's that this line is getting some facsimile of a DOM ImageElement that's designed to work on node. setAttribute is definitely a method of browser objects, so it wouldn't surprise me if it's not properly implemented in node-canvas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions