Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 2, 2018. It is now read-only.
This repository was archived by the owner on Aug 2, 2018. It is now read-only.

importing a directory that does not contain an index.{ext} file gives a nondescriptive error #496

@ndhoule

Description

@ndhoule

Given the following directory structure:

lib
├── index.css
├── index.js
└── info-view
    └── index.js

If you import a directory (implying the existence of an index.{ext} file, e.g. index.css) that does not contain an index file:

// index.css
@import "./info-view";

body {
  width: 703px;
  margin: 0 auto;
}

You get the following error:

        using : babel
        using : myth
     building : lib/index.css
        using : compatibility
        using : stoj
    installed : [email protected]
        error : Error: EISDIR, read
    at Error (native)
    installed : [email protected]

I've only tried this with CSS, but I'm assuming it also happens for JavaScript files? Not sure. Would be nice to have a more descriptive error; perhaps when, as in this case, an import implies the presence of an index.{ext} file, the resolver should stat the file and throw an error if it doesn't exist?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions