Skip to content

ESM module resolution broken with Astro 7 (Rolldown bundler) #1498

Description

@juananxt

Description

graphql-request v7.4.0 fails to resolve graphql module with Astro 7 (Rolldown bundler).

Error

Cannot find package 'graphql' imported from /node_modules/graphql-request/build/legacy/helpers/analyzeDocument.js

Environment

  • graphql-request: v7.4.0
  • astro: v7.0.3
  • bundler: Rolldown
  • node: 22.20.0

Root Cause

Astro 7 uses Rolldown (strict ESM). Code in /build/legacy/ imports 'graphql' as bare module. Rolldown cannot resolve (not in valid ESM path).

Astro 5 (esbuild) resolvía automático. Astro 7 (Rolldown) es strict.

Workarounds Tried

  • Install graphql explicitly (it works, but dont want to instal graphQL)

Solution Needed

Update /build/legacy/ to use explicit ESM paths, or remove if legacy.

Blocks Astro 7 upgrade for projects using graphql-request.

LABELS:
bug, astro, esm

No activity

Activity on this issue will appear here.

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