Question
Can I use the import
keyword if my module is exported using module.exports
? Can I import a module using require()
if I export a module using default or named exports?
Answer
The two different syntaxes for modules module.exports/require()
and export/import
are not interchangeable and should not be used together.