Skip to content
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

fix(app): Fix Node 12 fs/promises error in AppDelegate Expo plugin #5591

Merged
merged 1 commit into from
Aug 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/app/plugin/src/ios/appDelegate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigPlugin, IOSConfig, withDangerousMod } from '@expo/config-plugins';
import fs from 'fs/promises';
import fs from 'fs';

const methodInvocationBlock = `[FIRApp configure];`;

Expand Down Expand Up @@ -31,7 +31,7 @@ export const withFirebaseAppDelegate: ConfigPlugin = config => {
'ios',
async config => {
const fileInfo = IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot);
let contents = await fs.readFile(fileInfo.path, 'utf-8');
let contents = await fs.promises.readFile(fileInfo.path, 'utf-8');
if (fileInfo.language === 'objc') {
contents = modifyObjcAppDelegate(contents);
} else {
Expand All @@ -40,7 +40,7 @@ export const withFirebaseAppDelegate: ConfigPlugin = config => {
`Cannot add Firebase code to AppDelegate of language "${fileInfo.language}"`,
);
}
await fs.writeFile(fileInfo.path, contents);
await fs.promises.writeFile(fileInfo.path, contents);

return config;
},
Expand Down