Skip to content

plugin-graphql-codegen-client-preset breaks next.js directives #515

@cornedor

Description

@cornedor

Describe the bug
When I use a directive like "use client" or "use cache", the app no longer compiles with the following error message:

Error:   × The "use client" directive must be placed before other expressions. Move it to the top of the file to resolve this issue.
Error:   × The "use cache" directive must be at the top of the file.

It seems that code is injected before those directives.

URL to minimal reproduction

This is pretty straight forward to reproduce, if it is helpful I can create a reproduction repo.

Expected behavior

The app builds as expected.

Additional context

Add any other context about the problem here.

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