Skip to content

Import attribute type: "text" does not work as expected. #8

Description

@sabberworm

If I do something like this:

import cssContents from "./file.css" with { type: "text" };

I expect cssContents to be the the string representation of the contents of file.css. Instead I get:

ERROR: [plugin: deno-loader] [unreachable] Not an ESM module.

I have tried debugging to see what actually causes this message but I find debugging within the deno module cache to be very confusing.

Interestingly, what I’m actually trying to do is the following:

import moduleDts from "./module.d.ts" with { type: "text" };

(yes, I am trying to load a .d.ts file as text, don’t ask me why…)

Which yields a slightly different error:

ERROR: [plugin: deno-loader] The import attribute type of "text" is unsupported.

Any idea what’s going on?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions