Skip to content

Problem importing `@uiw/react-codemirror #710

@pieterbeulque

Description

@pieterbeulque

Cannot find module '@uiw/react-codemirror/esm/useCodeMirror' imported from @uiw/react-codemirror/esm/index.js

on a simple import CodeMirror from "@uiw/react-codemirror";.

This is a Remix project built with Vite 5. "type": "module" is set on my package.json.

This is the only package I have this issue with. Running on Node 22. On Node 20, I get Cannot use import statement outside a module.

This makes me think it has something to do with ESM / CJS / … module resolution going wrong, but I can't really debug it more than that.

If I do a dynamic import(), it works fine.

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