question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property 'canCompile' of undefined

See original GitHub issue

Hey there, tried babelify and it didn’t work. Installed according to the readme instructions but something breaks, I have no idea why.

 alessio: /home/alessio/www/ftplrs git:master
→ npm install babelify @babel/core
npm WARN ftplrs@1.0.0 No description
npm WARN ftplrs@1.0.0 No repository field.

+ babelify@8.0.0
+ @babel/core@7.1.2
updated 2 packages in 1.388s

 alessio: /home/alessio/www/ftplrs git:master
→ npm i @babel/preset-env
npm WARN ftplrs@1.0.0 No description
npm WARN ftplrs@1.0.0 No repository field.

+ @babel/preset-env@7.1.0
updated 1 package in 3.672s

 alessio: /home/alessio/www/ftplrs git:master
→ browserify index.js -t [ babelify --presets [ @babel/preset-env ] ]
/home/alessio/www/ftplrs/node_modules/babelify/index.js:65
    if (!babel.util.canCompile(filename, extensions)) {
                    ^

TypeError: Cannot read property 'canCompile' of undefined
    at /home/alessio/www/ftplrs/node_modules/babelify/index.js:65:21
    at Babelify (/home/alessio/www/ftplrs/node_modules/babelify/index.js:10:36)
    at nr (/home/alessio/.nvm/versions/node/v8.9.2/lib/node_modules/browserify/node_modules/module-deps/index.js:311:23)
    at onfile (/home/alessio/.nvm/versions/node/v8.9.2/lib/node_modules/browserify/node_modules/resolve/lib/async.js:59:21)
    at onex (/home/alessio/.nvm/versions/node/v8.9.2/lib/node_modules/browserify/node_modules/resolve/lib/async.js:107:32)
    at /home/alessio/.nvm/versions/node/v8.9.2/lib/node_modules/browserify/node_modules/resolve/lib/async.js:10:20
    at FSReqWrap.oncomplete (fs.js:153:5)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
geanfrancovolpecommented, Aug 28, 2019

Thanks bro, my issue was install outdated packages that Typescipt Gulp Tutorial suggest to install. At the end, i was working with babelify@8, and babel ^7.5.5, and they aren’t compatible. So i’ve installed babelify@10 and everything worked well.

1reaction
federicomichelacommented, Oct 19, 2019

@geanfrancovolpe thank you so much for the solution! I was messing around from an hour already and nothing was working then I’ve updated to babelify@10 as you said and it worked! Cheers 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript babel "TypeError: Cannot read property 'bindings ...
This is caused by a mismatch of babel dependencies between 6 & 7. You currently seem to have both installed. Try removing babel-core ......
Read more >
Gsap + Typescript + Browserify + Babelify Compilation Not ...
It seems to be a babelify issue, that can't transform GSAP ... getting this error: "TypeError: Cannot read property 'arrayify' of undefined".
Read more >
Wasm / Shaun Lebron - Observable
NOTE: Modify the code by clicking the module names on the left. RuntimeError: Cannot read properties of undefined (reading 'ready'). viewof adderModule = ......
Read more >
sc-forks/solidity-coverage - Gitter
Event trace could not be read. Error: ENOENT: no such file or directory, open './allFiredEvents'. How can I fix this? Stef Heyenrath.
Read more >
@angular-architects/module-federation - npm
Set it to one of the following values to get a more streamlined ... Cannot read property 'ɵcmp' of undefined TypeError: Cannot read...
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