nuxtrdev / nuxtr-vscode

An extension offering commands and tools to make your experience with Nuxt more pleasant.
https://marketplace.visualstudio.com/items?itemName=Nuxtr.nuxtr-vscode
327 stars 13 forks source link

[Bug]: nuxtr installs modules as layers #116

Closed deicidem closed 7 months ago

deicidem commented 7 months ago

Environment

What went wrong?

When i install a new module from sidebar, it installs as layer: image

If i try to install one more module, i got an error:

is installed but we got an error in configuration, please make sure all modules are configured ![image](https://github.com/nuxtrdev/nuxtr-vscode/assets/39920617/26a25a97-b0d4-4d23-9cc8-93fd85ffbb27) ### How to reproduce it? 1. Create new nuxt project 2. Install module from sidebar 3. Install one more module from sidebar
deicidem commented 7 months ago

I think you have bug in the following code: src/utils/nuxt.ts

const isLayer = async (module: any) => {
    let modulePath = `${projectRootDirectory()}/node_modules/${module.npm}`;

    if (existsSync(modulePath)) {
        let nuxtConfigPath = `${modulePath}/nuxt.config.ts`;
        const result = pathExistsSync(nuxtConfigPath)
        console.log('result', result);
// always true !!!
        if (result !== undefined) {
            return true;
        } else {
            return false;
        }
    }
};