Skip to content
Advertisement

how to enable top level await in reactjs

I have installed craco using yarn add @craco/craco I have also replaced the scritps and have created a craco.config.js

JavaScript

but when I’m trying to use await at top level I’m still getting this error in my react app

JavaScript

Advertisement

Answer

In the craco docs, it says you need to add a configure block to handle any webpack configuration options

`

What happens if you change

JavaScript

to

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement