0

I'm using babel 5.8.34 with webpack for my personal project. Sourcemap is getting generated fine. Now when I try to evaluate a ES6 constructor function in browser console, it throws ReferenceError. The issue has been described here in the first answer. But the fix mentioned is for babel@6.x. How do I fix this for babel@5.x??

Community
  • 1
  • 1
neeraj080
  • 119
  • 6
  • Do you mean access in the console in general, or in the console when you've stopped at a `debugger` statement or breakpoint? Those could potentially be two separate problems. That said, upgrading to Babel 6 would be a good step, Babel 5 is quite old, and entirely unsupported, at this point. – loganfsmyth May 15 '17 at 15:34
  • When I have stopped at a breakpoint, I'm not able to evaluate ES6 code in console. – neeraj080 May 17 '17 at 04:07
  • Cool, then yeah, upgrading to Babel 6 and using the fix you posted would be one option, otherwise the fix would be to not assume that executing snippets in the console will work as you expect, and learn to work with the code that Babel outputs. – loganfsmyth May 17 '17 at 06:03

0 Answers0