Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
lopu8914yHoly shit the splitting up of compatibility between CommonJS and EJS modules is the most absolutely brain dead dumb fart moronic indecipherably stupid inept decision I've ever come across -
lopu8914yWell I read this and I kiiiiiind of understand better now
https://redfin.engineering/node-mod...
Seems like EJS is actually completely backwards compatible with CJS?
You just need to do
import cjsModule from './foo.cjs';
const {foo} = cjsModule;
for named CJS exports?
Turns out in my project the EJS module just didn't have a default export, was doing an export * from -
lopu8914yGod damnit my favourite process manager PM2 doesn't support ESM
Btw I've been calling it EJS, I think it's ESM -
Root772314y@lopu It’s been so long now and I no longer have a use for it. :<
I’ll probably rebuild it in another language when/if I need it. (Tagged and nested async logging library) -
Yes the terms are ESM and CJS
While the split seems insane at a glance there are blog posts from the npm foundation about how they came to the tough decision to do it, for example there are security issues with CJS
Related Rants

I used to fix my cable wires by tissue cardboard roll. Now, I will use this instead!
So close
HOW THE FUCK
DO I USE A NPM PACKAGE
THAT DOESN'T SUPPORT IMPORT X FROM PACKAGE
IN A TYPE:MODULE
REPO?
WHY THE FUCK CAN'T NODE JUST SUPPORT BOTH
WHAT IN THE FUCK
HOW DOES WEBPACK LET YOU USE BOTH?!
I CANNOT FIND A WORK AROUND FOR ERROR
SyntaxError: The requested module 'file-type' does not provide an export named 'default'
WHAT THE FUCK?
DO I NEED TO USE A DIFFERENT PACKAGE?
WHAT THE FUCK
rant
out
hair