Skip to content

Next 13/14 App Router Issue #1230

Open
Open
@headline-design

Description

@headline-design

Describe the bug

So this is an issue and solution we have encountered with Vanilla Extract and App Router - Next13/14. Everything looks fine in development, but as soon as you go to build the application, styles are no longer applied correctly. The classnames are set correctly but the specificity is all screwed up. Basically, what appears to be happening is that the Next build system is placing the wrong styles at the top of the stack. After quite a bit of digging, what we discovered was that the issue could be resolved by removing the reset/default style for the Box element. Anyone working with a design system and encounters this problem can try the remove reset solution. It's more of a temp solution, but it fixed the issue. We tried this with at least a dozen different configurations of versions for vanilla extract and next. This is specificaly an issue on app router, no such issues on pages router.

Reproduction

n/a.

System Info

vanilla-extract
next 13/14

Used Package Manager

yarn

Logs

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    nextjsIssue related to NextJS

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions