Vuepic / vue-datepicker

Datepicker component for Vue 3
https://vue3datepicker.com
MIT License
1.47k stars 146 forks source link

How to solve this problem #856

Closed DObett closed 5 months ago

DObett commented 5 months ago

Describe the bug This is an error message npm run serve will show this error how to solve I hope to receive an answer. Thank you very much No relevant solutions found on the Internet in the profile

demo3@0.1.0 serve

vue-cli-service serve

INFO Starting development server... 98% after emitting CopyPlugin

ERROR Failed to compile with 1 error 10:12:23 error in ./node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js

Module parse failed: Unexpected token (770:108) 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 | return e(); | throw new Error(tn.prop("range"));

}, On = (e) => Array.isArray(e) ? Jt(e[0]) && (e[1] ? Jt(e[1]) : !0) : e ? Jt(e) : !1, xr = (e, t) => Te(t ?? B(), { | hours: +e.hours || 0, | minutes: +e.minutes || 0,

@ ./src/main.js 7:0-51 10:31-44 @ multi (webpack)-dev-server/client?http://localhost:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js image

this is packagejson

image

DObett commented 5 months ago

Possible version incompatibility caused by change "@vuepic/vue-datepicker": "^7.4.1", then npm run serve is ok
and vue.config.js add transpileDependencies: [ ‘@vuepic/vue-datepicker’, // 没有多余的空格,并且正确指定了包名 // … 其他可能需要转译的依赖 ], Otherwise, this error will still be reported image