diff --git a/FAQ.md b/FAQ.md index 0c12d72d1..2f1130ee9 100644 --- a/FAQ.md +++ b/FAQ.md @@ -63,6 +63,14 @@ Note that even though the workaround doesn't cause any weird side effects in bro For more context see this [issue](https://github.com/auth0-samples/auth0-react-samples/issues/145). + +## Why do I get `auth0_spa_js_1.default is not a function` when using Typescript? + +If you're hitting this issue, set `esModuleInterop: true` in your `tsconfig.json` file (inside `compilerOptions`). + +Due to how the type system works in Typescript, if one of your dependencies uses `allowSyntheticDefaultImports: true`, then all the consumers of that dependency must use `allowSyntheticDefaultImports: true` as well. This, of course, is not ideal and might break your app if you depend on this setting being `false`. The Typescript team added the `esModuleInterop` flag that helps in this scenario. + + ## Why do I get `auth0-spa-js must run on a secure origin`? Internally, the SDK uses [Web Cryptography API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) to create [SHA-256 digest](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest). @@ -78,4 +86,4 @@ In most browsers, secure origins are origins that match at least one of the foll (*, 127/8, *) (*, ::1/128, *) (file, *, —) -``` +``` \ No newline at end of file