bendman / soy-loader

A webpack loader for Google Closure (soy) templates.
MIT License
5 stars 7 forks source link

Babel creates no working code, because babel using 'use strict' mode. #6

Open rodzewich opened 8 years ago

rodzewich commented 8 years ago
$ node ./build/server.js 
/home/rodzewich/Projects/obcomm/build/server.js:549
                 */HAS_JSCRIPT:'ScriptEngine'in this},/**
                                                ^

TypeError: Cannot use 'in' operator to search for 'ScriptEngine' in undefined
    at /home/rodzewich/Projects/obcomm/build/server.js:549:42
    at Object.<anonymous> (/home/rodzewich/Projects/obcomm/build/server.js:555:62)
    at __webpack_require__ (/home/rodzewich/Projects/obcomm/build/server.js:20:30)
    at Object._typeof (/home/rodzewich/Projects/obcomm/build/server.js:472:13)
    at __webpack_require__ (/home/rodzewich/Projects/obcomm/build/server.js:20:30)
    at Object.<anonymous> (/home/rodzewich/Projects/obcomm/build/server.js:49:16)
    at __webpack_require__ (/home/rodzewich/Projects/obcomm/build/server.js:20:30)
    at /home/rodzewich/Projects/obcomm/build/server.js:40:18
    at Object.<anonymous> (/home/rodzewich/Projects/obcomm/build/server.js:43:10)
    at Module._compile (module.js:541:32)
moimikey commented 7 years ago

@rodzewich are you still having this issue?

rodzewich commented 7 years ago

Off course, but I am fixed problem in the forked branch https://github.com/rodzewich/soy-loader.git . I want you to fix problem in your npm package like I am, please.

kayneb commented 7 years ago

We are using babel in our project, and haven't encountered this issue. From what I can tell from the diff, your branch simply adopts rodzewich-closure-templates over closure-templates. Surely the fix then belongs in closure-templates?

rodzewich commented 7 years ago

In new versions babel used "use strict" as default behavior and your provided module not working. I use babel@6.5.2.

rodzewich commented 7 years ago

Could you fix closure-templates module in code places where code incompatible with use strict mode. You can resolve this issue in forked branch like I am. And you can use forked branch in your module. In my opinion there is no other solution to support new versions of babel.

kayneb commented 7 years ago

If it's closure-templates that needs to be fixed, then you should create an issue over at https://github.com/google/closure-templates