babel / duo-babel

Duo plugin for Babel
15 stars 14 forks source link

Unable to access callee of strict mode function #3

Closed chrisbuttery closed 9 years ago

chrisbuttery commented 9 years ago

Hi there, when using duo-babel to build my tests - in conjunction with the Chai ‘Expect’ assertion style - I get the following error:

TypeError: Unable to access callee of strict mode function

You can test it out in this example repo: https://github.com/chrisbuttery/duo-test-babel

By swapping out the build task in the Makefile you can see it only throws the error when using duo-babel.

chrisbuttery commented 9 years ago

As this is just a plugin for babel-core - I'm not sure if I should raise the issue over there?

sebmck commented 9 years ago

This is expected behaviour. ES6 modules have an implicit strict mode and in strict mode, as the error says, arguments.callee is unavailable. You can disable it although I'd highly discourage it for the reasons outlined on that page and it likely shadows another larger problem which is that you're probably transforming node_modules as chai shouldn't even be touched by Babel.