Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile. Module parse failed: Unexpected token (470:30) #19

Closed
aljohn-ma opened this issue Jan 26, 2021 · 7 comments
Closed

Cannot compile. Module parse failed: Unexpected token (470:30) #19

aljohn-ma opened this issue Jan 26, 2021 · 7 comments
Labels
fixed Issue was closed because it was fixed

Comments

@aljohn-ma
Copy link

Failed to compile.

./node_modules/vue3-datepicker/dist/vue3-datepicker.esm.js 470:30
Module parse failed: Unexpected token (470:30)
You may need an appropriate loader to handle this file type.
| });
| const isEnabled = (target, lower, upper, disabledDates) => {

        if (disabledDates?.dates?.some(date => isSameDay(target, date)))

| return false;
| if (!lower && !upper)

@icehaunter
Copy link
Owner

Oh, good catch, I'll fix it ASAP

@aljohn-ma
Copy link
Author

Oh, good catch, I'll fix it ASAP

Nice!!! Thanks. I'll be waiting for the fix.

@pounard
Copy link

pounard commented Feb 2, 2021

Any news on this ? I get the same error, sadly.

@pounard
Copy link

pounard commented Feb 2, 2021

For information, I tried replacing the import using import Datepicker from 'vue3-datepicker/src/datepicker/Datepicker' directly and got this error:

ERROR in ./node_modules/vue3-datepicker/src/datepicker/Datepicker.vue?vue&type=script&lang=ts (./node_modules/vue-loader/dist??ref--5-0!./node_modules/vue3-datepicker/src/datepicker/Datepicker.vue?vue&type=script&lang=ts) 23:17
Module parse failed: Unexpected token (23:17)
File was processed with these loaders:
 * ./node_modules/vue-loader/dist/index.js
You may need an additional loader to handle the result of these loaders.
|      */
|     modelValue: {
>       type: Date as PropType<Date>,
|       required: false,
|     },
 @ ./node_modules/vue3-datepicker/src/datepicker/Datepicker.vue?vue&type=script&lang=ts 1:0-113 1:0-113 1:114-216 1:114-216
 @ ./node_modules/vue3-datepicker/src/datepicker/Datepicker.vue
 @ ./node_modules/babel-loader/lib??ref--6-0!./node_modules/ts-loader??ref--6-1!./node_modules/vue-loader/dist??ref--5-0!./assets/js/Shared/common/DatepickerApp.vue?vue&type=script&lang=ts
 @ ./assets/js/Shared/common/DatepickerApp.vue?vue&type=script&lang=ts
 @ ./assets/js/Shared/common/DatepickerApp.vue
 @ ./assets/js/Shared/common/datepicker.ts
 @ ./assets/js/app.gestion.ts

EDIT: This is due to the fact that my vue-loader wasn't configured to babelize stuff in node_modules for performance reasons, I worked around this another way, until the dist gets fixed.

@icehaunter
Copy link
Owner

Yeah, sorry, didn't have the time. I should be able to fix it within 24h from now. I'll reply here when it's done

@icehaunter
Copy link
Owner

Should be fixed and released as v0.2.3!

I've set TS compilation options to ES6. If someone thinks that's unreasonable, please voice your concerns. But if your requirements are more specific, you should be able to import the .vue component directly and transpile it as you need.

And sorry for the delay everyone, real life got in the way, as always 😄

@icehaunter icehaunter added the fixed Issue was closed because it was fixed label Feb 4, 2021
@pounard
Copy link

pounard commented Feb 4, 2021

Thank you very much !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed Issue was closed because it was fixed
Projects
None yet
Development

No branches or pull requests

3 participants