Skip to content

@graphql-codegen/client-preset-swc-plugin panics when used with Next v13 #9326

@kamilkisiela

Description

@kamilkisiela

Which packages are impacted by your issue?

@graphql-codegen/client-preset

Describe the bug

Next fails to build the app when @graphql-codegen/client-preset-swc-plugin is defined in experimental.swcPlugins.

This is the output:

info  - Creating an optimized production build ...[1]    47505 bus error  yarn build

Your Example Website or App

https://github.com/dotansimha/graphql-code-generator/tree/master/examples/react/nextjs-swr

Steps to Reproduce the Bug or Issue

  1. yarn build

Expected behavior

  1. yarn build
  2. happy Kamil

Screenshots or Videos

Screenshot 2023-04-20 at 16 25 23

Screen.Recording.2023-04-20.at.16.25.55.mov

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • NodeJS: v18.16.0 and v18.12.1
  • graphql version: 16.6.0
  • @graphql-codegen/cli: ^3.3.0
  • @graphql-codegen/client-preset: ^3.0.0
  • @graphql-codegen/schema-ast: 3.0.1
  • @graphql-codegen/client-preset-swc-plugin: 0.1.3

Codegen Config File

// eslint-disable-next-line import/no-extraneous-dependencies
import { CodegenConfig } from '@graphql-codegen/cli';

const config: CodegenConfig = {
  schema: 'https://swapi-graphql.netlify.app/.netlify/functions/index',
  documents: ['components/**/*.tsx', 'pages/**/*.tsx'],
  generates: {
    './gql/': {
      preset: 'client',
    },
  },
  hooks: { afterAllFileWrite: ['prettier --write'] },
};

export default config;

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions