You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason I'm looking at this is because sometimes, when I run import { languages } from 'prismjs', I got languages as undefined. And when I print out module.exports, it gives me undefined:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to understand this piece of code:
here: https://github.com/PrismJS/prism/blob/master/prism.js#L1209
The reason I'm looking at this is because sometimes, when I run
import { languages } from 'prismjs'
, I gotlanguages
as undefined. And when I print outmodule.exports
, it gives me undefined:It's weird though that
exports
seems to exist in module, but it stillmodule.exports
is undefined.Can someone help understand why the check is needed ? And why can sometimes the
module.exports
be undefined ?Thanks
Beta Was this translation helpful? Give feedback.
All reactions