Skip to content
This repository was archived by the owner on May 30, 2025. It is now read-only.
This repository was archived by the owner on May 30, 2025. It is now read-only.

Package doesn't work with Next.js because of invalid ESM #42

Description

@phoenixeliot

As far as I understand, ESM (at least in Next.js) doesn't support the "importing a folder implicitly means importing its index.js" feature. I get this error, when running the example project given in this very repo:

error - unhandledRejection: Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/private/tmp/crossmint-solana-auth/node_modules/@crossmint/solana-auth-base/lib/esm/handlers' is not supported resolving ES modules imported from /private/tmp/crossmint-solana-auth/node_modules/@crossmint/solana-auth-base/lib/esm/index.js

I can temporarily resolve this by deleting the esm folder from the node_modules for this package, forcing Next to use the cjs folder instead, but there is no good way to reproduce that programmatically.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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