Skip to content

Uniwind Error - Failed to serialized javascript object #268

@smoores-dev

Description

@smoores-dev

What happened?

I am attempting to migrate an existing codebase from Nativewind to Uniwind. I followed the guide in the docs, upgraded to tailwindcss v4, etc etc. I also removed some calc()s that Uniwind didn't like (mixing 100% with px/rem). The branch is here, in case that's helpful: https://gitlab.com/storyteller-platform/storyteller/-/merge_requests/311/diffs. It's by no means a minimal repro, because I don't really have any way to narrow down which part of the codebase is causing issues.

Uniwind is reporting:

Uniwind Error - Failed to serialized javascript object

I tried patching the library to log the object that's failing to serialize, but it's gigantic, I assume it's defining all of the styles in the project, or something? So, ultimately not helpful for debugging haha.

I don't know how to narrow this down. I don't think I'm using any invalid class names, and I believe my global.css file is correct (it's fairly simple, anyway: https://gitlab.com/storyteller-platform/storyteller/-/blob/uniwind/mobile/global.css?ref_type=heads).

Any guidance on how to determine what is leading to this error? It seems to be preventing any tailwind styles from being applied to the app.

Steps to Reproduce

  1. Clone the Storyteller repo
  2. Install deps
  3. yarn workspace @storyteller-platform/mobile expo prebuild -p android (or ios)
  4. Build and run a dev client with Android Studio or XCode
  5. Start the metro server with yarn start:device
  6. See the error and no styles applied

Snack or Repository Link

https://gitlab.com/storyteller-platform/storyteller/-/tree/uniwind/mobile?ref_type=heads

Uniwind version

1.2.2

React Native Version

0.81.5

Platforms

Android, iOS

Expo

Yes

Additional information

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