# Compilation failed: Cannot use import statement outside a module

**URL:** <https://community.auth0.com/t/compilation-failed-cannot-use-import-statement-outside-a-module/127143>\
**Category:** Get Help\
**Tags:** application, sso\
**Created:** [February 12, 2024, 8:14pm UTC](https://community.auth0.com/t/compilation-failed-cannot-use-import-statement-outside-a-module/127143 "2024-02-12T20:14:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ASpaceBere](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aspacebere/32/51194_2.png) [@ASpaceBere](https://community.auth0.com/u/ASpaceBere)\
**Post date:** [February 12, 2024, 8:14pm UTC](https://community.auth0.com/t/compilation-failed-cannot-use-import-statement-outside-a-module/127143/1 "2024-02-12T20:14:24Z")

</div>

I am having an issue with auth0 returning giving me a login error of “Cannot use import statement outside a module”.

For context im getting this error on both a react stack and a pure js stack. It seems to be related to the auth0 SDKs but i can’t seem to find a work around or anyone really talking about it. I haven’t made any major changes to the auth structure in the last two weeks, however when i went to run some tests on the app i am able to login but i get stuck in a loop of access denied and the above error.

Has anyone else encountered this or found a solution?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 13, 2024, 1:40am UTC](https://community.auth0.com/t/compilation-failed-cannot-use-import-statement-outside-a-module/127143/3 "2024-02-13T01:40:25Z")

</div>

Hey there @ASpaceBere welcome to the community!

Thanks for the detailed description - The only time I’ve seen this come up is due to one’s Node/NPM environment:

> <https://stackoverflow.com/questions/58211880/uncaught-syntaxerror-cannot-use-import-statement-outside-a-module-when-import>

---

<div class="post-metadata">

**Author:** ![ASpaceBere](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/aspacebere/32/51194_2.png) [@ASpaceBere](https://community.auth0.com/u/ASpaceBere)\
**Post date:** [February 13, 2024, 2:37am UTC](https://community.auth0.com/t/compilation-failed-cannot-use-import-statement-outside-a-module/127143/4 "2024-02-13T02:37:01Z")

</div>

ok, so i found a solution to this. basically the flow actions caused the problem.

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [February 13, 2024, 10:56pm UTC](https://community.auth0.com/t/compilation-failed-cannot-use-import-statement-outside-a-module/127143/5 "2024-02-13T22:56:16Z")

</div>

Ah, gotcha! Thanks for clarifying and glad you got this sorted 🙏

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 27, 2024, 10:56pm UTC](https://community.auth0.com/t/compilation-failed-cannot-use-import-statement-outside-a-module/127143/6 "2024-02-27T22:56:16Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
