
I'm having the following error in the console when I try to run my api written in node js.
Can you tell me which is the problem.
Importing is generally done at the top of your files and looks like this:
import User, {schema} from './model.js'
Exporting is generally done at the bottom of your files and looks like this:
module.exports = {User, schema}
And the specific reason why you get the error is because export is not used that way.
Here is a direct quote from Web Docs:
export DefaultExport from 'bar.js'; // Invalid
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With