Open boss006133 opened 2 months ago
@boss006133 same issue for me, i just reverted to using dayjs package directly,
i created project/utils/dayjs.ts
:
import dayjs from 'dayjs'
import relativeTime from 'dayjs/plugin/relativeTime.js'
import utc from 'dayjs/plugin/utc'
import timezone from 'dayjs/plugin/timezone'
import isBetween from 'dayjs/plugin/isBetween'
import duration from 'dayjs/plugin/duration'
import 'dayjs/locale/ar'
dayjs.extend(relativeTime)
dayjs.extend(utc)
dayjs.extend(timezone)
dayjs.extend(isBetween)
dayjs.extend(duration)
export const $dayjs = dayjs
this will make $dayjs(...)
available in both template and script to use,
am sure this is not the best way to do it, but until this package is fixed this should do.
reproduction zip: test-typescript.zip
I just create a new nuxt3 app, and add only one module(dayjs-nuxt), then I auto import a const from nuxt.config.ts like the code below
nuxt.config.ts
and make the typescript not working
package.json
If I remove "dayjs-nuxt" from nuxt.config.ts modules, then typescript intellisense works fine