Hi everyone - I hope this is the right channel for...
# typescript
m
Hi everyone - I hope this is the right channel for this question but I’m using javascript, not typescript and it looks like es6 is not supported? Any suggestions on how to enable es6 in a js project?
l
I think that's based on the version of node.js you're using? If you're using node12 (before 12.10) or earlier, it won't work. But that's not a Pulumi restriction.
By default, Pulumi uses es2016, which (iirc) is a superset of es6? I'm not sure, I'm a bit of a js newbie...
m
Hmm I’m using node v14.17.4 so it should be possible to use import?
I’ll play around with it a bit more - thanks!
l
If the only problem is that you can't use import, check your packages.json. Maybe you have
"module": "common"
instead of
"modules": "esnext"
(or any value that includes es6).