When trying to import like this:
import { port } from './config';
I am getting this error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/USER/PROJECT/src/config'
But when I try this import it works fine:
import { port } from './config.js';
Content of config.js:
export const port = 3000;
export const hostname = localhost;
"type" is set to "module" in my package.json, using Node.js v14.1.0
So, how can I use extension-less import?