I am trying to deploy my Node.js ES6 modules-based application to Heroku, it works fine locally with npm start
and also when I run heroku local web
but unfortunately in the deployment it throws the error attached in the screenshot.
This is how my package.json
looks like.
{
"name": "",
"private": true,
"type": "module",
"engines": {
"node": "12.6.0"
},
"scripts": {
"start": "node --experimental-modules index.js",
},
"dependencies": {
...
},
"devDependencies": {
...
}
}
I have also tried by upgrading Node to 13.2.0 as suggested in this thread https://stackoverflow.com/a/59399717/5763627, but nothing changes with Heroku.