Closed sadeghbarati closed 1 month ago
Thanks for detailed reproduction it helps a LOT. I will be back to it but probably not this week, if you had time to investigate down to jiti (hint: I guess it is esm resolve and mlly) that would accelerate fixing this issue.
BTW: As best practice, please consider explicitly naming your config after your tool (not generic names like components
or app
)
It looks like at
https://github.com/unjs/c12/blob/77a58bed371b96cc4940bc05ed46fdef77292fe0/src/loader.ts#L316
jiti needs to be told to only try to resolve files, not directories, right?
Confirmed on 1.11.2. https://github.com/unjs/c12/pull/188 fixed it.
Environment
Tested with node
v18.8.2
on Windows and node20.11.1
in macOS and nodev18.8.0
in StackBlitz@pi0 sorry for the tag, but we very much need this fix in
shadcn-vue
š related issue in shadcn-vue https://github.com/radix-vue/shadcn-vue/issues/387Reproduction
Describe the bug
Tested in
Windows 11 ā macOS ā StackBlitz ā
Looks like
c12
cannot resolve config when the name and config file are the same name as another directory likecomponents.json
in the root emptycomponents
directory (folder) in the rootAdditional context
I think it's related to Jiti
Logs