dotland
dotland copied to clipboard
deno.land/x can't resolve jsxImportSource
In nano_jsx I would like to import the jsx-runtime
like so:
{
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "https://deno.land/x/nano_jsx"
}
}
But on deno run
, this failes to resolve error: Module not found "https://deno.land/x/nano_jsx/jsx-runtime"
. Even though there is an index.ts
file inside that directory and it contains the jsx-runtime.
It would be nice if deno.land/x would be able to resolve index.js and index.ts files from inside a jsx-runtime directory.
Just create a file named https://deno.land/x/nano_jsx/jsx-runtime
. Deno should default extension-less files to .js
What if the file jsx-runtime
is written in typescript?
You reexport the ts file from the js file.
Is there a working example?
I don't know if it works on deno.land/x but loading it from github fails:
error: Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported.
Specifier: https://raw.githubusercontent.com/nanojsx/nano/jsx-runtime-deno/deno_lib/jsx-runtime
Probably because the content-type is text/plain?
Is this somehow solvable without the use of an import map?