snack icon indicating copy to clipboard operation
snack copied to clipboard

react-firebase-hooks fails to resolve on Snack

Open peterpme opened this issue 3 years ago • 1 comments

Summary

Adding react-firebase-hooks to a new Snack returns this error and making it unusable:

Failed to resolve dependency 'react-firebase-hooks@*' (Can't resolve '' in '/tmp/snackager/snackager/buildStatus/1/[email protected],android,web/package')

What platform(s) does this occur on?

Android, iOS, Web

SDK Version

40/41

Reproducible demo or steps to reproduce from a blank project

Add import "react-firebase-hooks" to a new Snack. No import necessary

https://snack.expo.io/@peterpme/20b3d4

peterpme avatar Apr 29 '21 15:04 peterpme

Hi @peterpme, sorry for the delay!

This package seems to have a node-heavy structure, and Snackager seems to not-like that. What happens in the module is that everything is split up into 4 different sub-modules. The module react-firebase-hooks contains 4 different modules, in each folder. They aren't independently submitted as a package, instead, they rely on package.json files within them.

The main problem that actually causes the error in Snackager is the invalid main field in the root package.json (pun intended). It points to ./dist/index.cjs.js, but that doesn't exist, causing Snackager to being unable to find the entry point and bundle from there.

Importing react-firebase-hooks/auth seems to work in Snackager, but because it requires react-firebase-hooks as peer dependency, it's blocked because of the main issue.

byCedric avatar Jun 01 '21 17:06 byCedric