IE 11 - Webpack js issue

UI Components for Vue
Post Reply
HuNtR_RSA
Posts: 4
Joined: 15 Jul 2019, 10:47

16 Jul 2019, 16:01

Hi.

I've got a dotnet vue project running at the moment, but I get the following JavaScript error as soon as I add a Primevue component (e.g. Button) using the Vue.component method: SCRIPT1003: Expected ':'
I have also tried using babel to try solve the issue, but to no avail.

I've written the 'import' code in 2 different manners:

Code: Select all

import Vue from 'vue';
Vue.component('Button', require('primevue/button'));
AND

Code: Select all

import Vue from 'vue';
 import Button from 'primevue/button';
 Vue.component('Button', Button);
 
The syntax error is as follows:

WITHOUT BABEL

Code: Select all

"SyntaxError: Expected ':'\n   at ./node_modules/vue-loader/lib/index.js?!./node_modules/primevue/components/button/Button.vue?vue&type=script&lang=js& (http://localhost:49754/dist/main.js?v=78BHWRkml25cYNi4l5kF3TU3R0AfWG3wRw-tGOAhbgM:4583:1)\n   at __webpack_require__ (http://localhost:49754/dist/main.js?v=78BHWRkml25cYNi4l5kF3TU3R0AfWG3wRw-tGOAhbgM:20:12)\n   at eval code (eval code:2:22)\n   at ./node_modules/primevue/components/button/Button.vue?vue&type=script&lang=js& (http://localhost:49754/dist/main.js?v=78BHWRkml25cYNi4l5kF3TU3R0AfWG3wRw-tGOAhbgM:4524:1)\n   at __webpack_require__ (http://localhost:49754/dist/main.js?v=78BHWRkml25cYNi4l5kF3TU3R0AfWG3wRw-tGOAhbgM:20:12)\n   at eval code (eval code:3:22)\n   at ./node_modules/primevue/components/button/Button.vue (http://localhost:49754/dist/main.js?v=78BHWRkml25cYNi4l5kF3TU3R0AfWG3wRw-tGOAhbgM:4512:1)\n   at __webpack_require__ (http://localhost:49754/dist/main.js?v=78BHWRkml25cYNi4l5kF3TU3R0AfWG3wRw-tGOAhbgM:20:12)\n   at eval code (eval code:2:1)\n   at ./node_modules/primevue/button.js (http://localhost:49754/dist/main.js?v=78BHWRkml25cYNi4l5kF3TU3R0AfWG3wRw-tGOAhbgM:4500:1)"
WITH BABEL

Code: Select all

"SyntaxError: Expected ':'\n   at ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js?!./node_modules/primevue/components/button/Button.vue?vue&type=script&lang=js& (http://localhost:49754/dist/main.js?v=k06griEtXUrIegoRA9jNzr-jJdKYGwmWxNGkHtd_zVk:372:1)\n   at __webpack_require__ (http://localhost:49754/dist/main.js?v=k06griEtXUrIegoRA9jNzr-jJdKYGwmWxNGkHtd_zVk:20:12)\n   at eval code (eval code:2:22)\n   at ./node_modules/primevue/components/button/Button.vue?vue&type=script&lang=js& (http://localhost:49754/dist/main.js?v=k06griEtXUrIegoRA9jNzr-jJdKYGwmWxNGkHtd_zVk:4536:1)\n   at __webpack_require__ (http://localhost:49754/dist/main.js?v=k06griEtXUrIegoRA9jNzr-jJdKYGwmWxNGkHtd_zVk:20:12)\n   at eval code (eval code:3:22)\n   at ./node_modules/primevue/components/button/Button.vue (http://localhost:49754/dist/main.js?v=k06griEtXUrIegoRA9jNzr-jJdKYGwmWxNGkHtd_zVk:4524:1)\n   at __webpack_require__ (http://localhost:49754/dist/main.js?v=k06griEtXUrIegoRA9jNzr-jJdKYGwmWxNGkHtd_zVk:20:12)\n   at eval code (eval code:3:1)\n   at ./node_modules/primevue/button.js (http://localhost:49754/dist/main.js?v=k06griEtXUrIegoRA9jNzr-jJdKYGwmWxNGkHtd_zVk:4512:1)"

Am I missing an IE 11 polyfill or does PrimeVue not support IE 11 (which I doubt)

Thanks for your help in advance..

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

28 Jul 2019, 15:59

Does it only happen with Button, can you try with another component? If it happens at build time, it should not be related to IE or polyfill.

HuNtR_RSA
Posts: 4
Joined: 15 Jul 2019, 10:47

27 Aug 2019, 08:49

cagatay.civici wrote:
28 Jul 2019, 15:59
Does it only happen with Button, can you try with another component? If it happens at build time, it should not be related to IE or polyfill.
Thanks for the reply, but I was able to figure it out..

It happened to be the way I set up my webpack..
I ended up setting up a new project using the Vue Cli3 and letting the "vue ui" manage my dependencies.. :)

Post Reply

Return to “PrimeVue”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest