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
Book Title: You Don't Know JS Yet: Scope & Closures - 2nd Edition
Chapter: Chapter 8: The Module Pattern
Section Title: Modern ES Modules (ESM)
Problem:
The statement export getName; doesn't work me with NodeJS 10.x and ESM module (node -r esm client.js), I'm getting "SyntaxError: Invalid or unexpected token".
I think the right syntax is export { getName };, see also MDN docs.
Or you can use an alternative suggested by IntelliSense in VScode:
const_getName=getName;export{_getNameasgetName};
The text was updated successfully, but these errors were encountered:
Edition: 2nd
Book Title: You Don't Know JS Yet: Scope & Closures - 2nd Edition
Chapter: Chapter 8: The Module Pattern
Section Title: Modern ES Modules (ESM)
Problem:
The statement
export getName;
doesn't work me with NodeJS 10.x and ESM module (node -r esm client.js
), I'm getting "SyntaxError: Invalid or unexpected token".I think the right syntax is
export { getName };
, see also MDN docs.Or you can use an alternative suggested by IntelliSense in VScode:
The text was updated successfully, but these errors were encountered: