Maska v 2.1.1 not compatible with vue 2 ?
raphaelnoguier opened this issue · comments
Raphael Noguier commented
Hello !
I try to update my vue 2 (nuxt 2.15) project from maska 1.5.1 to 2.1.1, but i have this error :
I use it like suggested in the doc :
Any idea @beholdr ?
Thanks 🙂
Raphael Noguier commented
Okay i managed to resolve this issue, if this could help someone :
I had to update my nuxt.config.js build object to :
build: {
transpile: ['maska']
}
Resolved by looking at this issue : nuxt/nuxt#9223 (comment)
Thanks !
derHodrig commented
This is also the solution to
Module parse failed: Unexpected token (21:129) friendly-errors 14:32:49
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| } else
| s.tokens = O;
> Array.isArray(s.mask) && (s.mask.length > 1 ? s.mask = [...s.mask].sort((e, a) => e.length - a.length) : s.mask = s.mask[0] ?? ""), s.mask === "" && (s.mask = null), this.opts = s;
| }
| masked(t) {
Anatoly Kopyl commented
For anyone still using vue-cli, this is solved by setting
// vue.config.js
module.exports = {
transpileDependencies: [
'maska'
]
}