Skip to content
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

Unexpected token 'export' #133

Closed
timstrasser opened this issue Jun 28, 2021 · 4 comments
Closed

Unexpected token 'export' #133

timstrasser opened this issue Jun 28, 2021 · 4 comments

Comments

@timstrasser
Copy link

I just updated the '@simplewebauthn/browser' dependency in my NUXT project (from ^3.0.0 to ^3.1.0) and now the pages that require startAttestation from the @simplewebauthn/browser package no longer render.

I get the following error:
webpack:/external "@simplewebauthn/browser"
Missing stack framesJS
Object.@simplewebauthn/browser@1:

(https://prnt.sc/17aah2p)

I don't know how to further debug this error. Let me know if I can provide more information on this error.

@akanass
Copy link
Contributor

akanass commented Jun 28, 2021

@timstrasser Did you check the README because in the latest version, main version is in ES2018 and you have to transpile it by yourself with your bundle system if you want a lower browser support or in commonjs

export is from ESM code and you are not running ESM version if you have this error, so you have to transpile it to CJS with your bundler.

@timstrasser
Copy link
Author

timstrasser commented Jun 28, 2021

No, indeed I did not check the README. Thanks! Now it's working again!

@akanass
Copy link
Contributor

akanass commented Jun 28, 2021

@timstrasser as it's explained in the official documentation you can extend webpack config to transpile ESM to CJS by adding some plugin.

@timstrasser
Copy link
Author

Yes, I found it fox NUXT here (https://nuxtjs.org/docs/2.x/configuration-glossary/configuration-build#transpile). :)

Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants