Skip to content

Improve error when default-importing from a module that export *s from a module with a default export #37092

Closed
@bluelovers

Description

@bluelovers

TypeScript Version: 3.7.x-dev.201xxxxx

Search Terms:

Code

https://github.com/bluelovers/ws-react/blob/master/packages/react-use-localstorage/index.ts

export * from './core/v4';
//import createStorageHook from './core/v4';
//export default createStorageHook

//console.log(exports.default)
import createStorageHook from './src/core';

Expected behavior:

know "src/core" has default import

Actual behavior:

Error:(2, 8) TS1192: Module '"src/core"' has no default export.

Playground Link:

Related Issues:

#37090

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: Error MessagesThe issue relates to error messagingExperience EnhancementNoncontroversial enhancementsFixedA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions