Skip to content
This repository has been archived by the owner on Jan 31, 2022. It is now read-only.

support for pnpm and pnpx #8

Open
seyaobey opened this issue Feb 5, 2021 · 4 comments
Open

support for pnpm and pnpx #8

seyaobey opened this issue Feb 5, 2021 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@seyaobey
Copy link

seyaobey commented Feb 5, 2021

I'm wondering whether this (excellent) plugin supports also pnpm

I have created a nx workspace with pnpm, pnpx as packages manager following this announcement stating nx supports pnpm.

But after I've started metro bundler, with pnpx nx start <app-name> I get this error:

Error: ENOENT: no such file or directory, open 'fs.js'
    at Object.openSync (fs.js:465:3)
    at Object.readFileSync (fs.js:368:35)

Even if I use npx nx start <app-name>

Thanks for the great work!

@JacopoPatroclo
Copy link
Owner

JacopoPatroclo commented Feb 5, 2021

This project is not maintained by the nx team so the package currently don't have support for pnpm. I'll use this issue to track the development of this feature.

Unfortunately I'm the only maintainer and during this period I've no time to dedicate to this project. If someone wants to give me a hand on this it will be very much appreciated.

@seyaobey
Copy link
Author

seyaobey commented Feb 5, 2021

@JacopoPatroclo thanks for reply. I'll just be patient. (I'm far from having the skills to overtake this project, but I'll try to have a look).

@JacopoPatroclo JacopoPatroclo added enhancement New feature or request help wanted Extra attention is needed labels Feb 5, 2021
@leggomuhgreggo
Copy link

leggomuhgreggo commented Feb 20, 2021

For anyone who is interested, I wanted to share some findings/context from my investigation.

Context

If you find yourself in this repo, it's probably fairly evident that getting RN / Expo projects to work within a monorepo is uniquely challenging. Generally, this stems from module resolution API disparity between node packagers and the metro bundler. (But also, shoutout to unexpected caching issues -- the next most encumbering issue with RN/Expo dev)

Packaging with pnpm

The module resolution issues are particularly challenging when using pnpm, because metro doesn't currently play nicely with symlinked node_modules. This issue has gotten some attention over in the pnpm repo and, with thanks to vjpr, there's a working example of how to adapt the metro config to support pnpm symlinks

Possible course of action

This repo includes a withNxMetro plugin, which could be adapted (or perhaps more sensibly branched?) to support the pnpm module resolution features from the pnpm-expo-helper's rn-cli-config

I would love to work on this but pnpm support isn't an immediate priority for my project -- but I hope this helpful in advancing the topic.

And big ole thanks to Jacopo for this repo -- made some very cool things possible in my world 🙏

@violabg
Copy link

violabg commented Feb 21, 2021

I'm getting the same error when using yarn nx start

Error: ENOENT: no such file or directory, open 'fs.js'
    at Object.openSync (fs.js:465:3)
    at Object.readFileSync (fs.js:368:35)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants