-
Notifications
You must be signed in to change notification settings - Fork 52
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
SyntaxError: Cannot use import statement outside a module #23
Comments
it's probably worth noting that this happens when running |
I'm getting the exact same thing, which is supposedly used to fix a uuid issue here https://github.com/uuidjs/uuid#getrandomvalues-not-supported |
I fixed this issue by creating a new file called export {};
declare let global: any;
global.crypto = {
getRandomValues: (array: any[]) =>
array.map(() => Math.floor(Math.random() * 256)),
}; Then in the original file where we are importing the uuid package: import './GetRandomValues';
import { v4 as uuidv4 } from 'uuid'; Found the fix here uuidjs/uuid#416 (comment) This doesn't solve the original issue with this library, but it's a workaround so that I'm not forced to encounter this bug when doing what's suggested in the uuid readme here https://github.com/uuidjs/uuid#getrandomvalues-not-supported |
@Joelasaur I would really not recommend using @a-eid The stack trace points to inside |
seems that this lib causes the following error
import typeof AccessibilityInfo from './Libraries/Components/AccessibilityInfo/AccessibilityInfo';
when commented out, the app works fine.
The text was updated successfully, but these errors were encountered: