canjs 5.19.0 was just released and now comes with steal-stache. This post is meant to briefly explain what this means.
If you’ve been using canjs 5 and steal-stache in the past, you might have ran into problems on occassion where updating can
would result in “multiple versions of can-stache-bindings” (or other packages) errors.
After researching the problem we realized the issue was with the way package-lock.json
works. Basically what happens is that can
depends on exact versions of packages, but steal-stache does not. So when you update can it starts depending on a newer version of some package that what the package-lock.json
has for steal-stache.
So the result is that you import .stache
file and a JavaScript file that uses can
, they might have loaded different dependencies.
The fix, available in 5.19.0 is to include steal-stache
in canjs.
To prevent these errors from occuring in your app in the future, do the following:
npm update can
npm uninstall steal-stache
This gets you up to version 5.19.0 (or greater) of canjs, and removes the dependency on steal-stache.
Then, in your package.json, remove the following:
{
...
"steal": {
"plugins": ["steal-stache"]
}
}
And replace it with:
{
...
"steal": {
"plugins": ["can"]
}
}
can
is a steal plugin in that it contains steal-stache.