You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a babel config option to enable this or something? How do I get top level await to work for babel + node? (I am not talking about frontend/webpack here, strictly backend code).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello friends
Top level await is not working when using babel with node.
Here is my code, for example:
This produces the following error:
However, when I use node without babel I can run top level await just fine.
Here is the command I use to run babel + node:
babel-watch ./entries/server.js
The babel-watch package is here: https://github.com/kmagiera/babel-watch
Is there a babel config option to enable this or something? How do I get top level await to work for babel + node? (I am not talking about frontend/webpack here, strictly backend code).
My current babel.config.json:
Using latest version of babel & node.
Beta Was this translation helpful? Give feedback.
All reactions