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' #796

Closed
KiddoV opened this issue Apr 12, 2022 · 3 comments
Closed

Unexpected Token 'export' #796

KiddoV opened this issue Apr 12, 2022 · 3 comments

Comments

@KiddoV
Copy link

KiddoV commented Apr 12, 2022

I got this issue in console when using the CDN: mustache.js
Error in console:

Uncaught SyntaxError: Unexpected token 'export' (at mustache.js:764:1)

Spec:

  • OS: Windows 10
  • Browser: Webview2 (Edge)
  • MustacheJS: v4.2.0

Any idea why?
Thanks,

@KiddoV
Copy link
Author

KiddoV commented Apr 12, 2022

Possible duplicated on #786 !

@phillipj
Copy link
Collaborator

Hi!

Cloudflare does not use the npm package, but rather serves the source code as is from github.com. After we made the source code into EcmaScript syntax, serving that as is for browser which doesn't support EcmaScript modules yet, wont work.

You could try serving from another CDN which does in fact use the npm package instead, in an "intended use scenario" so to speak. From the README example: unpkg.com/mustache@latest, version pinning is also support by unpkg.com if you'd prefer that..

@KiddoV
Copy link
Author

KiddoV commented Apr 14, 2022

@phillipj Thanks this https://unpkg.com/mustache@4.2.0/mustache.js works for me!

@KiddoV KiddoV closed this as completed Apr 14, 2022
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