If you want to use import instead of require you need to add module
part to your package.json
"type":"module"
But don't forget you need to import with file extension.
import { ErrorMessage } from "../alerts.js"; // WORK
import { ErrorMessage } from "../alerts"; // WONT WORK!
Top comments (1)
Thanks man, you saved my life!