Huuums / vscode-folder-templates

Create your own Component structure with a simple click.
MIT License
209 stars 32 forks source link

Module not found #130

Open lagroms opened 5 months ago

lagroms commented 5 months ago

When creating a React functional component and a SCSS file, an error appears as "module not found" for the SCSS file.

ezgif-3-7bbbae060b

My settings are the below

    "folderTemplates.structures": [
        {
            "name": "React Functional Component Template",
            "omitParentDirectory": true,
            "structure": [
                {
                    "fileName": "<FTName | capitalize>.jsx",
                    "template": "React Functional Component"
                },
                {
                    "fileName": "<FTName | capitalize>.module.scss",
                    "template": "SCSS Module"
                }
            ]
        }
    ],
    "folderTemplates.fileTemplates": {
        "React Functional Component": [
            "import styles from './<FTName | capitalize>.module.scss';",
            "",
            "const <FTName | capitalize> = () => {",
            "  return <div className={styles.container}><FTName | capitalize></div>;",
            "};",
            "",
            "export default <FTName | capitalize>"
        ],
        "SCSS Module": [".container {", "", "}"]
    },
Huuums commented 5 months ago

Hi @lagroms,

does the error persist for a created file after you reload VSCode? I'm not sure we're able to help here because the file is created as configured in the template.

The file seems to exist so I'm not sure why VSCode tells you it cannot find it.

Could you create a minimal repo that reproduces this error so we can take a look as to what might be happening?

Thanks