Skip to content

🚨 Cannot import recast-navigation-js in a project with "type": "module" #472

@repulsio

Description

@repulsio

If your project's package.json has "type": "module", you cannot import anything from recast-navigation-js.

import { init } from 'recast-navigation';

fails with Module '"recast-navigation"' has no exported member 'init'.ts(2305):
Image

For ESM modules, imports should end with .js. When I manually add .js, the compilation errors are resolved:
Image

@isaac-mason Sorry for the ping here. I think this is a serious blocker for ESM users. Thank you for all of your hard work on recast-navigation-js!

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