auth0 / auth0.js

Auth0 headless browser sdk
MIT License
988 stars 492 forks source link

"Compilation failed: Cannot use import statement outside a module" #1409

Closed kberesfo closed 7 months ago

kberesfo commented 7 months ago

Checklist

Description

I am not 100% sure this is the right repo but im experiencing the issue with both react sdk and pure js. i have created a minimal reproduceable example provided below. I get the error in my auth0 logs and on the console of the browser. im not sure how to fix this.

Reproduction

<!DOCTYPE html />

Additional context

I have two stacks that both started experiencing the issue at the same time. both are different os, node versions, and sdks. One of my stacks is react the other is pure js. this has become a blocker for me. I get stuck in a loop of failed to auth and the above error

auth0-js version

2.0&1.12

Which browsers have you tested in?

Chrome, Firefox, Other

frederikprijck commented 7 months ago

This is the wrong repository.

The correct repository is https://github.com/auth0/auth0-spa-js.

Additionally, this code is wrong:

auth0.createAuth0Client({ domain: '', clientId: '', audience: '' })

and needs to be:

auth0.createAuth0Client({ domain: '', clientId: '', authorizationParams: { audience: '' } })

But that isnt going to solve the error you mentioned.

Given the error comes from the server-side, this isn't an error originating from the SDK. I recommend disabling all actions on Auth0 and try again.