I'm using import { isValid, format, parse, subHours, differenceInHours } from 'date-fns';
in one of the .js
file.
In test, I imported the file correctly and tests passed, but when starting server I see issue -
[error] - Error initializing server ../utils.js
(function (exports, require, module, __filename, __dirname) { import { isValid, format, parse, subHours, differenceInHours } from 'date-fns';
SyntaxError: Unexpected token import
at createScript (vm.js:74:10)
Do you see any mistake in way I should import?