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

web-types.json does not load for IntelliJ IDEA 2024.1 #82

Open
nemsjulie opened this issue May 3, 2024 · 3 comments
Open

web-types.json does not load for IntelliJ IDEA 2024.1 #82

nemsjulie opened this issue May 3, 2024 · 3 comments

Comments

@nemsjulie
Copy link

nemsjulie commented May 3, 2024

I'm currently working on a Vue 3 project that imports a package of Vue 3 components from node_modules. This package is released using npm and serves as a plugin library, enabling me to install the components as global components within my Vue 3 project as shown below.

Vue 3 project:

import {plugin} from 'privatecomponentsplugin''


const app = createApp(App)

app
.use(router)
.use(vuetify)
.use(store)
.use(plugin)

Components plugin:

export const plugin = {
    install: (app: App) => {
        Object.keys(Components).forEach(name => {
            app.component(name, Components[name])
        })
    }
}

The components plugin npm library package.json includes this:

"web-types": "./web-types.json"

and the web-types.json file exists in the same root as package.json which has been created by using vue-docgen-web-types version 0.1.8.

By doing so, the components that were imported into the Vue project were recognized in IntelliJ IDEA 2020(2020.2.4 and 2020.3.4), 2021(2021.1.3) and 2022(2022.1.4). However, it is not recognized in 2024.1. I've also tested in version 2023.1.6 and 2023.3.6 which do not work either but gives me this file problem Unknown html tag n-button-add.

I've also checked if the npm package has been excluded from the indexing, but the package is gray which indicates that it is not excluded.

Is this a bug on the newer versions of IntelliJ or do we need to do some more work for it to be recognizable? I find it kinda weird how vuetify components are still recognized though, so it could be that I've missed something that are needed for it to work in the newer IntelliJ versions.

@piotrtomiak
Copy link
Collaborator

@nemsjulie - could you please share small reproduction library? It's hard to say what may be wrong.

@dld-r00f
Copy link

dld-r00f commented May 9, 2024

I have same issue with PyCharm 2024.1.1 and vuetify.js web-types. It works with .vue files. And don't work with "Vue template" language injection or file type overriding to "Vue template". And still works if use Edit "Vue template" Fragment on the injection!

@nemsjulie
Copy link
Author

nemsjulie commented May 10, 2024

@piotrtomiak

Here's small reproduction libraries. I was not sure how to set this up as the other one ( Components plugin) is published on npm, and then installed using npm

App:
https://stackblitz.com/edit/vitejs-vite-g6psir?file=package.json
Plugin package:
https://stackblitz.com/edit/vitejs-vite-e7wfda?file=package.json

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

No branches or pull requests

3 participants