These are chat archives for canjs/canjs

May 2018
Viktor Busko
May 21 2018 08:06
@pYr0x regarding can-view-autorender it doesn't work with webpack:
here is tries to 'load' module
and inside it resolves to undefined:
Due to this everything fails here:
Uncaught (in promise) TypeError: Cannot read property 'async' of undefined
Viktor Busko
May 21 2018 08:21
Its seems... that it should be resolved to stache but not sure how it is expected to be resolved.
For example if I add here:
if (!engine) {
        engine = require('can-stache');
it works
Viktor Busko
May 21 2018 08:45
@justinbmeyer hey, could you check above. Is it valid case to rise a bug ? Maybe you know how to workaround this ?
It is in can3
Chasen Le Hara
May 21 2018 16:42
@Lighttree I think you’ll want to use can-view-autorender@3.1.4 instead of the latest version (master has a 5.x prerelease right now).
can-view-autorender 3.x uses can-util/js/import/import for that same code you pointed out:
So please feel free to file another one if those don’t cover the same issue, and we’d happily accept a PR that makes it work with webpack :D
Viktor Busko
May 21 2018 20:59
@chasenlehara Ok, thx. Regarding PR. My solution is quite straightforward, but I'm not sure that importing can-stache in can-view-autorender is correct there. Since there is abstract engine used. So maybe there is smarter way to fix this.
Chasen Le Hara
May 21 2018 21:09
Yeah, adding a direct dependency to can-stache would be wrong, the right way would be to fix can-util/js/import / can-module-import to work with webpack
I don’t know enough about webpack to point you in the right direction… but maybe just an import() statement would work?