Closed knuthaug closed 1 year ago
Additional testing
'@popeindustries/lit-html/vendor/directives/unsafe-html.js
works well, while
'@popeindustries/lit-html/directives/unsafe-html.js
Does not. Is there som specific config needed in our project to make this work?
Interesting. This seems to works correctly in Node/dvlp/esbuild, but not yet in TypeScript. The fix has been merged (https://github.com/microsoft/TypeScript/pull/49644), but evidently not yet released. I guess the only option is to manually add each export
Correction: TypeScript can't resolve aliases via exports
(./directives.js
=> ./vendor/directives.js
), so need to create modules that alias to vendor module.
same problem with lit-html-server
, have problems with typings resolve in TypeScript:
Cannot find module '@popeindustries/lit-html-server' or its corresponding type declarations.ts(2307)
Thanks @pumano, I'll look into that too.
We are experiencing an issue with using
@popeindustries/lit@1.0.4
as a "proxy" for exports from@popeindustries/lit-html
.gives the error
Checking the file
node_modules/@popeindustries/lit/directives/unsafe-html.js
it containsThis file path points to nothing in the package
@popeindustries/lit-html
on disc innode_modules
.@popeindustries/lit-html
hassrc
andvendor
directories (andsrc/vendor
) which containsdirectives
. The export map of@popeindustries/lit-html
listsdirectives
aswhich seem to point to the right place. So why can't the typescript compiler resolve this import? Using the import directly from
lit-html
gives the same error, while pointing directly to e.g. thevendor
directoryworks as intended. This leads me to think that our project can't read/understand the exports map correctly, but shouldn't node 18.9 and typescript 4.8.3 be able to do that? On closer inspection it seems that it might be the wildcard export map that isn't understood, because addition of e.g
Seems to work well.
node version: 18.9.0 typescript version: 4.8.3