-
-
Notifications
You must be signed in to change notification settings - Fork 5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
addImports
does not support .
in from
#23930
Comments
Trying to isolate where the issue comes from it appears to be a problem with unimport. However it looks like this should just be taking the |
Found it https://github.com/unjs/unimport/blob/7df98d0a6a7b53437514eb078c295dfc5ec86087/src/utils.ts#L121 This strips all extensions. Found a work around for now... use uppercase letters 😄 Changing my |
@GerryWilko great debugging! Could you raise an issue in unimport instead |
Yes sir! unjs/unimport#290 |
Thank you ❤️ Let's track there. |
Just a note for anyone that tries the workaround it may not be successful in CI as both my GitHub builds and Vercel builds fail to find |
Environment
Darwin
v18.16.1
3.6.2
2.5.2
pnpm@8.7.6
vite
runtimeConfig
,modules
,build
,auth
,i18n
,css
,postcss
,imports
nuxt-icon@0.5.0
,@nuxtjs/i18n@8.0.0-beta.13
,@pinia/nuxt@0.4.11
,@nuxt/devtools@0.6.7
,@formkit/nuxt@0.19.2
,@sidebase/nuxt-auth@0.6.0-beta.5
,@vueuse/nuxt@10.5.0
,@nuxt/ui@2.9.0
-
Reproduction
Add any import with a
.
in the from argument (here I'm usingchart.js
.Describe the bug
The generated
imports.d.ts
looks like this:Note the
.js
has been removed. I presume as there is something in the import generator that tries to exclude file extensions.I have tried a number of work arounds including escaping the
.
which lets me get the dot to come through but nothing quite worked.Adding a trailing
/
generates the import ok but then I get a Vite import error when running the application as there are no named exports of the package.Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: