Closed zzswang closed 5 years ago
@zzswang this is not an esm
issue. class properties are not yet fully supported by the current V8 version of node.js. they are very likely supported with the next major version of node.js v12.
in the meantime you have several options: you can use a transpiler, like Babel, or you can experiment starting node with harmony flags, e.g.
node --harmony-class-fields -r esm index.js
here is an overview of some flags: https://flaviocopes.com/node-runtime-v8-options/ use them at your own risk, as they are meant to be used to experiment, not recommended for production.
if you are interested, here is a list of supported language features in node.js by version: https://node.green/
@dnalborczyk
Thanks
esm: 3.2.17
yarn start:
nodemon -r esm src/index.js --watch src
it will run into syntax error with class properties.
the error:
file with calss properties