-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Cannot find module 'fs/promises' #5584
Comments
Already fixed it. Problem was that I had node v12.14 installed, which does not seem to have the module More info: nodejs/node#35740. |
Interesting. I'm not sure that's a requirement that we have vs one that expo has, but one of us may be missing a minimum node version warning. I was under the impression react-native-firebase still worked on v12. You can ask |
I think this happened because I recklessly used
If we want to keep compatibility with Node 12, usage of |
Indeed that represents an unexpected breaking change. If you have a minute for repair I'm in there working on release stuff today and can release |
Opened a hotfix PR, but currently have no chance to test it locally now, but it should be ok Noticed that |
Merged! Thanks - will do a release today as I've just gotten the new AppCheck module finally ready. Fix will be in 12.5.0 |
Hi, I was just wondering if you knew when the fs/promises fix in 12.5.0 will be released. Thank you! |
Looking to release it today - got hung up on an unexpected CI failure which meant I wasn't confident to release it yesterday, but my workday just started so it might be a little while - keep an eye out |
Thanks so much for the release! It looks like it's resolved for the android package. Unfortunately, after updating I still receive the error about fs/promises. It looks like it might need to be changed for the iOS file as well when copying GoogleService-Info.plist Error: Cannot find module 'fs/promises'
|
🤦♂️ As a hotfix, please apply this patch (download, then unzip the The patch itself: diff --git a/node_modules/@react-native-firebase/app/plugin/build/ios/appDelegate.js b/node_modules/@react-native-firebase/app/plugin/build/ios/appDelegate.js
index ac79980..f9353fd 100644
--- a/node_modules/@react-native-firebase/app/plugin/build/ios/appDelegate.js
+++ b/node_modules/@react-native-firebase/app/plugin/build/ios/appDelegate.js
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
exports.withFirebaseAppDelegate = exports.modifyObjcAppDelegate = void 0;
const config_plugins_1 = require("@expo/config-plugins");
-const promises_1 = __importDefault(require("fs/promises"));
+const fs_1 = __importDefault(require("fs"));
const methodInvocationBlock = `[FIRApp configure];`;
function modifyObjcAppDelegate(contents) {
// Add import
@@ -27,7 +27,7 @@ const withFirebaseAppDelegate = config => {
'ios',
async (config) => {
const fileInfo = config_plugins_1.IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot);
- let contents = await promises_1.default.readFile(fileInfo.path, 'utf-8');
+ let contents = await fs_1.default.promises.readFile(fileInfo.path, 'utf-8');
if (fileInfo.language === 'objc') {
contents = modifyObjcAppDelegate(contents);
}
@@ -35,7 +35,7 @@ const withFirebaseAppDelegate = config => {
// TODO: Support Swift
throw new Error(`Cannot add Firebase code to AppDelegate of language "${fileInfo.language}"`);
}
- await promises_1.default.writeFile(fileInfo.path, contents);
+ await fs_1.default.promises.writeFile(fileInfo.path, contents);
return config;
},
]); I'll open another PR 🤦 |
I just merged that PR (thanks @barthap !) and I'm looking to do another release today (my day just started though...) so keep an eye out for 12.6.0 or 12.5.1 depending on whether I can get a new feature in or not... |
Thanks, @barthap and @mikehardy! |
Issue
When installing
@react-native-firebase/app
viaexpo install @react-native-firebase/app
, it throws the following error:Error: Cannot find module 'fs/promises'
Steps to reproduce:
expo init
(blank Typescript)expo install expo-dev-client
expo run:ios
(I did an intermediary test)expo install @react-native-firebase/app @react-native-firebase/messaging @react-native-firebase/auth @react-native-firebase/perf @react-native-firebase/crashlytics
Output:
Project Files
Expo default. Did not change them manually.
Javascript
package.json
:app.json
Environment
Click To Expand
**Node --version: **
v12.14.0
react-native info
output:react-native
is not installed.The text was updated successfully, but these errors were encountered: