After replacing Moment.js with date-fns using this guide from the antd documentation I get the next server error:
SyntaxError: Cannot use import statement outside a module
I've tried things like adding 'type': 'module'
to the package.json and putting 'module': 'commonjs'
in tsconfig.json and many other things but none seem to work.
Got it. The solution was to replace 'antd/es/...'
with 'antd/lib/...'
in the imports provided in the documentation and the error was gone.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.