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: name «fetch» #571

Open
kmgdevelopment opened this issue May 29, 2022 · 2 comments
Open

Unexpected token: name «fetch» #571

kmgdevelopment opened this issue May 29, 2022 · 2 comments

Comments

@kmgdevelopment
Copy link

If I try to use fetch like so:

let response = await fetch('https://domain.tld');

Uglify throws this error:

Unexpected token: name «fetch», expected: punc «;». 

This old issue (#499) appears to be similar, but the solution is to use a grunt package that is currently marked as depreciated so ¯\_(ツ)_/¯

I'm using grunt-contrib-uglify version 5.2.1

@alexlamsl
Copy link
Contributor

sounds like you are using top-level await, which is now supported in version 5.2.2 when module: true is specified.

@chidubemOkafor
Copy link

sounds like you are using top-level await, which is now supported in version 5.2.2 when module: true is specified.

I think that's the problem

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

3 participants