vue-flatpickr-component
vue-flatpickr-component copied to clipboard
SSR: failed to import component after upgrade to 11.0.4
I'm submitting a ... (check one with "x")
[x] Bug report => search github for a similar issue or PR before submitting
[ ] Feature request
[ ] Other, please describe
Tell about your platform
- flatPickr version : 4.6.13
- Vue.js version : 3.4
- Browser name and version : Chrome|Firefox|Edge x.x.x
- This package version : 11.0.4
Current behavior
After upgrade this package from 11.0.3 to 11.0.4 this error is thrown:
[vite] Error when evaluating SSR module /src/views/.../Index.vue: failed to import "vue-flatpickr-component"
|- ./node_modules/vue-flatpickr-component/dist/esm/index.js:1
import Component from './component';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (node:internal/modules/cjs/loader:1378:20)
Expected behavior
This package should work also for SSR environments (package vite-ssr).
Minimal reproduction of the problem with instructions
Please provide more information
Possible causing PR https://github.com/ankurk91/vue-flatpickr-component/pull/286
I can confirm this issue. It it present in 11.0.4 and 11.0.5. 11.0.3 is unaffected.
It is 100% caused by #286.
Another user posted feedback in https://github.com/ankurk91/vue-flatpickr-component/pull/286#issuecomment-1953855027.
We use this repo in atk4/ui. We can build our JS (using webpack) fine, but eslint is unhappy (when upgraded from 11.0.3 to 11.0.4/11.0.5):
> eslint --ext .js,.vue .
/__w/ui/ui/js/src/Service/vueService.js
86:96 error Unable to resolve path to module 'vue-flatpickr-component' import/no-unresolved
The repro code: https://github.com/atk4/ui/blob/b70a9200a79638da730cb2ce203a35407d2f3a70/js/src/Service/vueService.js#L86
Also facing the same issue.
i want a minimal reproduction of the issue
Downgrade to to 11.0.3 fixed for me as well
i want a minimal reproduction of the issue
Here are steps to reproduce:
- checkout https://github.com/atk4/ui.git
- cd
js/ - run
npm install - run
eslint . - run step 4 again with https://github.com/atk4/ui/blob/a40fb14c96/js/src/Service/vueService.js#L86 comment ignored and notice eslint cannot resolve the import in v11.0.4/11.0.5 (can be verified by downgrading to v11.0.3 and repeating steps 3 and 4)
I said minimal
Here is minimal repro https://github.com/atk4/ui/tree/ankurk91--vue-flatpickr-component--repro-295.
Repro steps are described in https://github.com/ankurk91/vue-flatpickr-component/issues/295#issuecomment-2695712407. In our case, the issue is present when running eslint, webpack can resolve the import fine.
Reverted changes and released v12