Skip to content

ESM: Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory importΒ #1966

@krutoo

Description

@krutoo

πŸ› Bug report

Current Behavior

When type: module in package.json, trying to import Either like this is failing:

import * as E from 'fp-ts/Either'

Expected behavior

Think this is should works according to docs

Reproducible example

Suggested solution(s)

Adding exports field to package.json with all possible paths to import from package

Additional context

Your environment

Which versions of fp-ts are affected by this issue? Did this work in previous versions of fp-ts?

Software Version(s)
fp-ts
TypeScript

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions