Skip to content

Add dayjs-nuxt to nuxt.config.ts modules, then typescript not working #48

Description

@boss006133

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

export default defineNuxtConfig({
  compatibilityDate: "2024-04-03",
  devtools: { enabled: true },
  modules: ["dayjs-nuxt"],
  imports: {
    dirs: ["constants/others"],
  },
  typescript: {
    typeCheck: true,
  },
})

image

and make the typescript not working

image

package.json

{
  "name": "nuxt-app",
  "private": true,
  "type": "module",
  "scripts": {
    "build": "nuxt build",
    "dev": "nuxt dev",
    "generate": "nuxt generate",
    "preview": "nuxt preview",
    "postinstall": "nuxt prepare"
  },
  "devDependencies": {
    "@nuxt/devtools": "latest",
    "dayjs-nuxt": "^2.1.9",
    "sass": "1.77.6",
    "sass-loader": "^13.3.2",
    "typescript": "^5.5.4",
    "vue-tsc": "^2.0.29"
  },
  "dependencies": {
    "nuxt": "^3.12.4",
    "nuxt-viewport": "^2.1.5",
    "vue": "latest"
  }
}

If I remove "dayjs-nuxt" from nuxt.config.ts modules, then typescript intellisense works fine

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions