Skip to content

Conversation

@cshaa
Copy link

@cshaa cshaa commented Nov 4, 2025

Attempting to use typedDocumentNode with SvelteKit, or any project that uses the verbatimModuleSyntax option, results in an error:

[plugin:vite:import-analysis] Failed to resolve entry for package "@graphql-typed-document-node/core".
The package may have incorrect main/module/exports specified in its package.json.

Simply adding type to the imports fixes the problem.

@cshaa
Copy link
Author

cshaa commented Nov 4, 2025

For anybody else facing this issue until this PR gets merged and released, there is a simple walkaround. You can either correct the generated code yourself, or use ts-autofix to do it for you:

// package.json
{
  "scripts": {
    "codegen": "zeus --td https://gitlab.com/api/graphql src/ && ts-autofix --fixes convertToTypeOnlyImport",
  }
}

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant