Cannot read property 'exports' of undefined
See original GitHub issueHi,
first of all, thanks for this awesome project.
A few days ago everything worked fine for me. Now if i npm start my project, the console tells me that some method of highlight.js ->
.... module.exports = function(hljs) { var CPP = hljs.getLanguage('cpp').exports; .....
seems to have following problem “Cannot read property ‘exports’ of undefined”. Could it be that it has to do with Babel 6 features for export -> https://github.com/webpack/webpack/issues/706? I tried to fix this myself, but failed until now. Maybe you can tell me whats this about? Would be awesome. Thanks!
EDIT: Possible solution http://stackoverflow.com/questions/33505992/babel-6-changes-how-it-exports-default https://www.npmjs.com/package/babel-plugin-add-module-exports
kind regards, defuex
Issue Analytics
- State:
- Created 7 years ago
- Comments:11
here is the offending line of code, https://github.com/isagalaev/highlight.js/compare/9.3.0...9.4.0#diff-b4721ca0cfdcb6627474ae5357615f51R9 , still not sure why it causes this issue.
@DeFuex It seems to be an issue with
highlight.js@9.4.0
, I haven’t pinpointed the exact cause yet but moving to a hard dep on9.3.0
fixed the issue. I published2.0.4
as a stopgap while I investigate further. Thanks again for bringing this to my attention!