Skip to content

Issues with next.js 14, server actions, dev & production build #309

@kirkas

Description

@kirkas

The problem
Next.js server action is broken when you used a .babelrc file, see vercel/next.js#57966

How to reproduce
Steps to reproduce:

  1. Add NextJS (14.0.4)
  2. Add a async server action / mutation
  3. npm build will fail, npm dev will intermittently failed

Expected behavior
I was expecting stylex to work out of the box with next.js app router, but adding it to an existing project was basically impossible.

Note
Ideally adding stylex to next.js would not require a babelrc file, as the frameworks now uses swc as its default compiler, and adding a babelrc file will default to previous compiler and lead to inconsistent result

From an engineer experience, it would be nice to just add @stylexjs/nextjs-plugin, export my next.config with stylexPlugin and have dev / production build working out of the box.

I understand the project is in its infancy, appreciate the great work y'all been doing 🚀

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions