Can't resolve export default from 'xxxx' in index.js vscode when ctrl/cmd click imports

985 views Asked by At

When i'm cmd clicking on a import it can't go to the definition of the component if i use a unnamed default export. It works when I do a named export.

src/components/Component/Component.js

// When i cmd/ctrl click here it should go to OtherComponent.js but it doesn't work
import OtherComponent from 'components/OtherComponent';

const Component = () => null;

src/components/OtherComponent/index.js

export default from './OtherComponent';

/*
if I change it to this it works

import OtherComponent from './OtherComponent';

export default OtherComponent;
*/

src/components/OtherComponent/OtherComponent.js

const OtherComponent = () => null;

export default OtherComponent

My jsconfig

{
    "compilerOptions": {
        "baseUrl": ".",
        "allowSyntheticDefaultImports": false,
        "paths": {
            "*": ["src/*"]
        }
    }
}
0

There are 0 answers