oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.31k stars 2.69k forks source link

Using with {type: text} returns an error #13663

Closed art-santos closed 3 weeks ago

art-santos commented 3 weeks ago

What version of Bun is running?

1.1.10+5102a9443

What platform is your computer?

MAC M2

What steps can reproduce the bug?

Start an app with bun as in (https://bun.sh/)

Copy the code for fetching and rendering an HTML local file in your app like in (https://bun.sh/guides/runtime/import-html)

What is the expected behavior?

with { type: "text" }; shouldn't return

Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'.ts(2823)

What do you see instead?

No response

Additional information

To solve it add to

tsconfig.ts

{ "compilerOptions": { "module": "preserve", } } or

{ "compilerOptions": { "module": "ESNext", } }

Jarred-Sumner commented 3 weeks ago

Unfortunately, it's not clear there's much we can do about this without help from TypeScript upstream.

Related issue: https://github.com/microsoft/TypeScript/issues/46135