DEV Community

Discussion on: How to use MJS files in Node.js?

Collapse
 
lyrod profile image
Lyrod • Edited

If you don't set the file extension (even for .js). Nodejs will report an error despit the .js file exists.

This is the standard, extension must always be set even for .js files. Usage of omitting extension comes from commonjs and is not standard