Skip to content
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

Types not correctly imported #1

Open
sifferhans opened this issue Nov 7, 2023 · 6 comments · Fixed by unjs/nitro#1908 or unjs/unimport#303
Open

Types not correctly imported #1

sifferhans opened this issue Nov 7, 2023 · 6 comments · Fixed by unjs/nitro#1908 or unjs/unimport#303

Comments

@sifferhans
Copy link
Contributor

sifferhans commented Nov 7, 2023

It seems like the types generated in .nuxt/types/nitro-imports.d.ts imports from the wrong files.
The utilities (setUserSession, getUserSession etc.) are being imported from the .mjs files as seen in the screenshot below.

CleanShot 2023-11-07 at 13 52 19

This causes everything to be typed as any, as in this githubEventHandler example:

CleanShot 2023-11-07 at 13 55 07

I guess this might have something to do with the way the utils are imported here?

CleanShot 2023-11-07 at 13 56 22

@danielroe
Copy link
Collaborator

This seems like an issue in unimport rather than this module.

@danielroe
Copy link
Collaborator

added a workaround but we still need to address in unimport... (cc: @antfu)

@Gerbuuun
Copy link
Contributor

Gerbuuun commented Nov 9, 2023

What is the workaround? The server utilities have correct typings but the useUserSession composable does not.

@danielroe danielroe reopened this Nov 9, 2023
@migueloliveiradev
Copy link

Same problem

@kingyue737

This comment was marked as off-topic.

@productdevbook
Copy link

@antfu unjs/nitro#1908 dont fixed this issua :/ i will test nitro 2.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants