Closed thihathit closed 1 year ago
Hi @thihathit, thank you for the kind words, and thank you for reporting!
Does the problem disappear if xoid is imported from 'xoid'
and not 'xoid/esm'
?
In the first major version, I'm planning to change imports such that:
"main": "index.js",
"module": "index.esm.js"
I believe it will fix the same problem for some environments.
Sadly xoid
is also affected
The 1.0.0-beta.0 release addresses this issue. There's only one index.d.ts
file and therefore the same problem shouldn't occur anymore, so I'm closing this issue.
yes, it's working on beta. thank you.
First of all, thank you for the library with it's simple API, super awesome work!
How did this happen?
It happens when the consuming project uses
pnpm
& tries to generate.d.ts
files via eithertsup
(usestsc
under the hood) ortsc
.Example
Workaround
The workaround is to define type, at least once per file where
create
is used.IMO, this only happens on libraries with some sort of shared module structure,
xoid/etc...
. So I'm not sure on which one's end,tsc
,pnpm
orxoid
. Another similar issue is withnuxt
's sub-modules.Might also related to this
tsc
issue: #42873