Skip to content

Natiwind styles using pnpm do not work. Tailwind does #268

Closed

Description

@francois-pasquier

Describe the bug
Hey,

Following this issue: nativewind/nativewind#1428

This one is new because I believe it's different as I moved on with pnpm

I am having issues having nativewind styles being applied in a monorepo.

Basically, working on mobile or on next, if I set a color in a packages/app component, it won’t work.

It DOES work if I use this color directly inside of next or native

Tailwind works properly though!

My understanding is that nativewind does not watch properly the directories outside so tailwind can’t extract the required classes

Here is the repro:

You can either pnpm web or pnpm native to see the issue

Reproduction
https://github.com/francois-pasquier/nativewind-monorepo

Expected behavior
Styles should be applied

Activity

  1. DoctorDerek commented on Jul 9, 2025

    @DoctorDerek

    Yeah AFAIK pnpm has never worked with RN let alone Nativewind.

    I think the Solito starter is now outdated for use with Nativewind (or requires version locking to previous version, I'm not sure).

    But it's a useful reference because 1) it uses Yarn for the monorepo (with nodeLinker: node-modules being mandatory) and 2) it's a working example of RN with Nativewind.

    Any updates?

    @hknakn It's just a suggestion, but a more helpful post would be about your own experiences, such as:

    "I couldn't get Nativewind working with pnpm either. My version numbers are Tailwind _, Expo _, RN _, Nativewind _, and PNPM _. Has anyone else seen this issue or have any recommendations?"

    Maybe my most recent article would be helpful in clarifying the various RN Expo Nativewind issues that are inevitable in this development environment. Cheers! https://medium.com/react-in-the-real-world/react-native-isnt-perfect-but-i-still-recommend-it-here-s-why-9f9b2ce0911b?sk=07dcd1305bf7dd4b9695178e7ead5c87

  2. DoctorDerek commented on Jul 9, 2025

    @DoctorDerek

    Solito / Nativewind starter code: https://github.com/nandorojo/solito/tree/master/example-monorepos/with-tailwind
    Solito / Nativewind starter docs: https://solito.dev/tailwind
    Most recent update about Nativewind in Solito repo: nandorojo/solito#448
    That post links to: https://github.com/SantiMNV/solito-nativewind-v4-app-router

  3. DoctorDerek commented on Jul 9, 2025

    @DoctorDerek

    Also unclosed PR nandorojo/solito#506 may indicate how to use Nativewind 4.

    Again I must stress that unless you read in recent Expo docs that PNPM actually works with Expo + RN, then I would abandon it in favor of either a Yarn monorepo or separate apps.

  4. francois-pasquier commented on Jul 11, 2025

    @francois-pasquier
    Author

    I read all of this.

    Expo does work with pnpm

    I come from a yarn monorepo. I had issues with it, pnpm worked fine.

    The only thing I miss now is a working nativewind install.

    Can the maintainers chime in?

  5. a-eid commented on Jul 18, 2025

    @a-eid

    it's not working for me either.

  6. a-eid commented on Jul 18, 2025

    @a-eid

    @DoctorDerek pnpm works fine with expo... it has been working for us for years.

  7. DoctorDerek commented on Jul 18, 2025

    @DoctorDerek
  8. dannyhw commented on Jul 23, 2025

    @dannyhw

    @francois-pasquier
    Image

    you just need to change the content array to actually reference the relative path not the node_modules

    /** @type {import('tailwindcss').Config} */
    module.exports = {
      content: [
        '../../packages/app/components/TestComponentNative.tsx',
        '../../packages/app/features/home/HomeScreen.tsx',
        './components/**/*.{js,ts,tsx}',
      ],
    
      presets: [require('nativewind/preset')],
      theme: {
        extend: {},
      },
      plugins: [],
    };
    

    note that the web file causes it to crash thats why I specified the paths directly instead of regex

    also your nextjs app is not configured to use nativewind so thats why that doesn't work there

  9. chakrihacker commented on Aug 15, 2025

    @chakrihacker

    if you are using bun workspaces try adding this in your metro.config.js

    config.resolver.disableHierarchicalLookup = true;
  10. EgorPopovPP commented on Aug 26, 2025

    @EgorPopovPP

    +1

  11. danstepanov commented on Oct 15, 2025

    @danstepanov
    Member

    @francois-pasquier were you able to implement Danny's suggestion?

  12. francois-pasquier commented on Oct 15, 2025

    @francois-pasquier
    Author

    Well, listing all the components is tedious imo

    It can get quite large as well…

  13. dannyhw commented on Oct 15, 2025

    @dannyhw

    @francois-pasquier the point is to make the regex match the path more correctly, not to specify each one manually

    like ../../packages/app/features/**/*.{js,ts,tsx}

  14. francois-pasquier commented on Oct 15, 2025

    @francois-pasquier
    Author

    Last time I checked doing it this way for packages resulted in a crash

  15. moved this to Todo in Roadmapon Mar 26, 2026
  16. danstepanov commented on Apr 15, 2026

    @danstepanov
    Member

    Closing as stale — no reproduction provided. pnpm compatibility issues are typically resolved via hoisting configuration. If still relevant, please open a new issue with a repro.

  17. moved this from Todo to Done in Roadmapon Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions