Cannot read property 'exports' of undefined

See original GitHub issue

Hi,

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:closed
  • Created 7 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
conorhastingscommented, May 19, 2016

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.

1reaction
conorhastingscommented, May 19, 2016

@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 on 9.3.0 fixed the issue. I published 2.0.4 as a stopgap while I investigate further. Thanks again for bringing this to my attention!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'exports' of undefined · Issue #36983
TypeError : Cannot read property 'exports' of undefined at declareModuleMember (D:\github\TypeScript\built\local\tsc.js:30390:63) at ...
Read more >
cannot set property 'exports' of undefined
to work. But I'm getting an "undefined is not a function" for upload_file(). I tried combinations of module.exports = {...} ...
Read more >
Solved NFS ISO: Cannot read property 'Export' of undefined
Running the latest openSUSE Leap 15.4 as my IT Workstation to manage both my XCO-ng servers, etc,... and my NFS exports file look...
Read more >
cannot read properties of undefined (reading 'exports')
Firstly, the error means that whatever you're using .name on has a value of undefined. Typically this can happen if you're making an...
Read more >
Fix: “Cannot Read Property of Undefined” Error in JavaScript
To fix the “cannot read property of undefined” error, use the optional chaining operator on the variable before accessing a property.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found