question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

3.6.0 : warning compiled with 1 warning 4:12:23 pm warning in ./node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js "export 'default' (imported as 'yn') was not found in 'date-fns-tz'

See original GitHub issue

Describe the bug

After updating to version 3.6.0, datepicker makes my app fail to execute.

npm run serve display a warning in the terminal :

 WARNING  Compiled with 1 warning

 warning  in ./node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js

"export 'default' (imported as 'Yn') was not found in 'date-fns-tz'

When I try to start the app in the browser, console displays this error :

vue-datepicker.js?5141:218 Uncaught TypeError: Cannot destructure property 'utcToZonedTime' of 'date_fns_tz__WEBPACK_IMPORTED_MODULE_2__.default' as it is undefined.

Proposal, search for solution

Seems the problem is located in this file date-fns-tz src/VueDatePicker/components/composables/utils.ts :

Line 22 to 24

import dateFnsTz from 'date-fns-tz';

const { utcToZonedTime, zonedTimeToUtc } = dateFnsTz;

The import statement refer to a module which has no export default.

Import should probably be something like :

import { utcToZonedTime, zonedTimeToUtc } from 'date-fns-tz';

Temporary solution

Downgrading to 3.5.3 in my package.json

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Jasenkoocommented, Dec 6, 2022

The fix is published and should be good now, let me know if the issue still persists.

3reactions
Jasenkoocommented, Dec 6, 2022

Will publish a fix later today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting warnings for export 'default' (imported as 'mod ... - GitHub
My Fix: I moved all of my css to an actual css file instead of declaring it locally or scoped. This removed every...
Read more >
Export default was not found - Stack Overflow
"What am I doing wrong?" You are trying to import the default export of a module which does not have a default export....
Read more >
export 'link' (imported as 'link') was not found in 'react-router'
12 with Vue-Router 3.5.2. I am getting following error when I run command below: *npm run dev* WARNING in ./resources/js/components ...
Read more >
date-fns-tz - npm
ESM and CommonJS. As of v1.3.0 this library supports native ESM imports in Node.js. It is important to use the proper import path...
Read more >
Export and Import - The Modern JavaScript Tutorial
That's why there's no need for a semicolon at the end of export class and export function : export function sayHi(user) { alert(`Hello, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found