You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having some funky behaviour around auto-import suggestions only within vue templates, which leads me to believe it is a volar issue. The issue is that in the script section of a vue file (or other .ts files) importing a component that is exposed via an index file works correctly, while within the template block, the import suggestion is to import from the file directly.
Correct behaviour (within script block)
Incorrect behaviour (within template tag)
I'm unclear on what scenarios this occurs, but in my case specifically, the module @si/ui-lib is a shared component library within the monorepo, and is being used directly without being built first - meaning
my web app's package.json includes the dependency via pnpm workspace linking
"@si/ui-lib": "workspace:*",
and @si/ui-lib's package.json exports the ts files directly
"main": "src/index.ts",
"types": "src/index.ts",
the index file just re-exports the components, for example
export { default as CoolButton } from './components/CoolButton/CoolButton.vue';
I have tried many different iterations of tsconfig files using aliases, project references, etc... What I have now seems to work the best and be very simple, with the only issue being this auto-import in vue templates.
Let me know if you need a minimal repro and I'll set one up.
Cheers!
The text was updated successfully, but these errors were encountered:
The component/function autocomplete feature not work actualy.
I use Typescript with TakeOver with vue 3.2 on the latest version of vscode.
If there is no import of the library into the project, volar does not recognize the library. You have to import your component manually for the first time and then the auto-import will work as expected.
BUT if you remove all the imports to the lib you will have a error like this in the suggestions window :
I don't understand that volar can't analyze the dependencies in the node_modules to propose the autocompletion of the imports
Having some funky behaviour around auto-import suggestions only within vue templates, which leads me to believe it is a volar issue. The issue is that in the script section of a vue file (or other .ts files) importing a component that is exposed via an index file works correctly, while within the template block, the import suggestion is to import from the file directly.
Correct behaviour (within script block)
![Screen Shot 2022-07-25 at 8 51 27 AM](https://user-images.githubusercontent.com/1158956/181289094-1397e91b-e360-4a9f-89cc-cc6d09157567.png)
Incorrect behaviour (within template tag)
![Screen Shot 2022-07-25 at 8 51 51 AM](https://user-images.githubusercontent.com/1158956/181289147-ad590b3c-9dc4-446f-ab53-813d907981e5.png)
I'm unclear on what scenarios this occurs, but in my case specifically, the module
@si/ui-lib
is a shared component library within the monorepo, and is being used directly without being built first - meaningmy web app's package.json includes the dependency via pnpm workspace linking
and
@si/ui-lib
's package.json exports the ts files directlythe index file just re-exports the components, for example
I have tried many different iterations of tsconfig files using aliases, project references, etc... What I have now seems to work the best and be very simple, with the only issue being this auto-import in vue templates.
Let me know if you need a minimal repro and I'll set one up.
Cheers!
The text was updated successfully, but these errors were encountered: