Skip to content

Make imports work with moduleResolution: "node" #437

Closed
@pomber

Description

@pomber

On a new Next.js app, when you do import { remarkCodeHike, recmaCodeHike } from "codehike/mdx" typescript complains:

Cannot find module 'codehike/mdx' or its corresponding type declarations.
  There are types at 'node_modules/codehike/dist/mdx.d.ts', but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.ts(2307)

To fix it you need to change moduleResolution to bundler in the tsconfig.json. Would be nice to not have to do that.

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