declare global {
var __turboModuleProxy: unknown | undefined;
}
const BULLET_POINT = "\n* ";
function messageWithSuggestions(
message: string,
suggestions: string[],
): string {
return message + BULLET_POINT + suggestions.join(BULLET_POINT);
}
export class ModuleNotFoundError extends Error {
constructor() {
if (global.__turboModuleProxy == null) {
const message =
"Failed to create a new RNFSTurbo instance: react-native-fs-turbo requires TurboModules, but the new architecture is not enabled!";
const suggestions: string[] = [];
const error = messageWithSuggestions(message, suggestions);
super(error);
return;
}
const message = "Failed to create a new RNFSTurbo instance.";
const suggestions: string[] = [];
const error = messageWithSuggestions(message, suggestions);
super(error);
}
}