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

Different behavior in normal script and script setup while using namespace #179

Closed
Edge00 opened this issue May 13, 2021 · 5 comments
Closed

Comments

@Edge00
Copy link

Edge00 commented May 13, 2021

import a namespace works well in normal script. throws error in script setup

works well in normal script

image

throws error in script setup

image

@Edge00 Edge00 changed the title Cannot use namespace 'NGetApiV1ImageAll' as a value. Cannot use namespace as a value. May 13, 2021
@Edge00 Edge00 changed the title Cannot use namespace as a value. Different behavior in normal script and script setup May 13, 2021
@Edge00 Edge00 changed the title Different behavior in normal script and script setup Different behavior in normal script and script setup while using namespace May 13, 2021
@sheremet-va
Copy link

I read somewhere, that you have to use import type when importing types inside script setup. I think it's esbuild problem. But unfortunately Volar doesn't do that automatically.

@Edge00
Copy link
Author

Edge00 commented May 13, 2021

Thank you! import type solved this problem. i found this issue
BTW. I am using babel and there is no error in build process.

@Edge00 Edge00 closed this as completed May 13, 2021
@johnsoncodehk
Copy link
Member

Thank you! import type solved this problem. i found this issue
BTW. I am using babel and there is no error in build process.

It should throw error in runtime.

@johnsoncodehk johnsoncodehk added the question Further information is requested label May 13, 2021
@Edge00
Copy link
Author

Edge00 commented May 13, 2021

It should throw error in runtime.

@johnsoncodehk In my scenario runtime works well also. Only editor error.

@johnsoncodehk
Copy link
Member

Sorry for not noticing that this is namespace, it should be working, could you provide a repro case?

@johnsoncodehk johnsoncodehk reopened this May 18, 2021
@johnsoncodehk johnsoncodehk added need info and removed question Further information is requested labels May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants