Skip to content

CJS needs explicit named exports, eg not export * in reflection.ts #1309

@jackfischer

Description

@jackfischer

Describe the bug
Very unclear when/how this problem emerged for us in our nextjs application but we're noticing the following error. Queries still succeed!

Reproduction
Running any querybuilder based query

 ⚠ [externals]/gel/dist/reflection/index.js
unexpected export *
export * used with module [externals]/gel/dist/reflection/index.js [external] (gel/dist/reflection/index.js, cjs) which is a CommonJS module with exports only available at runtime
List all export names manually (`export { a, b, c } from "...") or rewrite the module to ESM, to avoid the additional runtime code.`

Import trace:
  [externals]/gel/dist/reflection/index.js [external]
  ./dbschema/edgeql-js/index.ts [Route]
  ./utils/auth/authProviderHelpers.ts [Route]
  ./utils/ActivitiesData/sources/gitlab.ts [Route]
  ./pages/api/auth/[...nextauth].ts [Route]

Versions (please complete the following information):

  • OS:
  • EdgeDB version (e.g. 2.0): 6.10
  • EdgeDB CLI version (e.g. 2.0): 7.7.0
  • edgedb-js version (e.g. 0.20.10;): Generate 0.6.4, gel 2.1.1
  • Node/Deno version: v22.15.0.

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