Skip to content
New issue

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

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

Already on GitHub? # to your account

tailwindcss/lib/lib/defaultExtractor not found #942

Open
moshetanzer opened this issue Jan 19, 2025 · 6 comments
Open

tailwindcss/lib/lib/defaultExtractor not found #942

moshetanzer opened this issue Jan 19, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@moshetanzer
Copy link

Environment

Mac

Reproduction

Install nuxt ui on latest nuxt

Describe the bug

nuxt/ui#3139

Get error listed in issue on new install.

Additional context

No response

Logs

@moshetanzer moshetanzer added the bug Something isn't working label Jan 19, 2025
@ineshbose
Copy link
Collaborator

Could you share your nuxt.config and package.json please?

@ineshbose ineshbose changed the title Nuxt UI Broken tailwindcss/lib/lib/defaultExtractor not found Jan 19, 2025
@linesoft2
Copy link

Same question. My environment is Mac too.
nuxt.config:

// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  compatibilityDate: '2024-11-01',
  devtools: { enabled: true },
  modules: ['@nuxt/ui']
})

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"
  },
  "dependencies": {
    "@nuxt/ui": "2.21.0",
    "nuxt": "^3.15.2",
    "vue": "latest",
    "vue-router": "latest"
  },
  "packageManager": "pnpm@9.15.4+sha512.b2dc20e2fc72b3e18848459b37359a32064663e5627a51e4c74b2c29dd8e8e0491483c3abb40789cfd578bf362fb6ba8261b05f0387d76792ed6e23ea3b1b6a0"
}

@moshetanzer
Copy link
Author

Nothing to see installed only nuxt ui and added to modules on new project....

@linesoft2
Copy link

I resolved this issue by switching the package manager from pnpm to npm.

@shroomlife
Copy link

I use bun and have Nuxt3 and Nuxt UI 2 but not able to install Tailwindcss v4 without errors...

Tutorial used: https://tailwindcss.com/docs/installation/framework-guides/nuxt

Issue on install:

[nuxt:tailwindcss 16:39:08]  WARN  Failed to load config ./.nuxt/nuxtui-tailwind.config.mjs due to the error below. Skipping..
 Package subpath './lib/lib/defaultExtractor.js' is not defined by "exports" in C:\***\node_modules\tailwindcss\package.json

    at exportsNotFound (node:internal/modules/esm/resolve:314:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:661:9)
    at resolveExports (node:internal/modules/cjs/loader:653:36)
    at Function._findPath (node:internal/modules/cjs/loader:752:31)
    at Function._resolveFilename (node:internal/modules/cjs/loader:1395:27)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at jitiResolve (node_modules\jiti\dist\jiti.cjs:1:187220)
    at jitiRequire (node_modules\jiti\dist\jiti.cjs:1:189288)
    at import (node_modules\jiti\dist\jiti.cjs:1:199778)
    at C:/***/.nuxt/nuxtui-tailwind.config.mjs:2:31
    at eval_evalModule (node_modules\jiti\dist\jiti.cjs:1:196325)
    at node_modules\jiti\dist\jiti.cjs:1:194552
    at async Function.import (node_modules\jiti\dist\jiti.cjs:1:199772)
    at async resolveConfig (/C:/***/node_modules/c12/dist/shared/c12.B4fc1S0C.mjs:343:18)
    at async loadConfig (/C:/***/node_modules/c12/dist/shared/c12.B4fc1S0C.mjs:147:23)
    at async Promise.all (index 3)
    at async loadConfigs (/C:/***/node_modules/@nuxtjs/tailwindcss/dist/module.mjs:374:27)
    at async /C:/***/node_modules/@nuxtjs/tailwindcss/dist/module.mjs:420:9
    at async generateApp (/C:/***/node_modules/nuxt/dist/shared/nuxt.CrJjphBv.mjs:6168:5)
    at async _applyPromised (/C:/***/node_modules/perfect-debounce/dist/index.mjs:54:10)

Issue on nuxt dev:

ERROR  [unhandledRejection] Package subpath './resolveConfig' is not defined by "exports" in C:\***\node_modules\tailwindcss\package.json                                                                                                                                                             16:44:39  

    at exportsNotFound (node:internal/modules/esm/resolve:314:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:661:9)
    at resolveExports (node:internal/modules/cjs/loader:653:36)
    at Function._findPath (node:internal/modules/cjs/loader:752:31)
    at Function._resolveFilename (node:internal/modules/cjs/loader:1395:27)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object.<anonymous> (node_modules\tailwind-config-viewer\lib\tailwindConfigUtils.js:9:43)
    at Module._compile (node:internal/modules/cjs/loader:1739:14)
    at Object..js (node:internal/modules/cjs/loader:1904:10)
    at Module.load (node:internal/modules/cjs/loader:1473:32)

ℹ Restarting Nuxt due to error: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './resolveConfig' is not defined by "exports" in C:\***\node_modules\tailwindcss\package.json

My packages:

  "dependencies": {
    "@pinia/nuxt": "0.9.0",
    "@prisma/client": "6.3.0",
    "@tailwindcss/vite": "^4.0.3",
    "deep-email-validator": "0.1.21",
    "jsonwebtoken": "9.0.2",
    "moment": "2.30.1",
    "moment-timezone": "0.5.47",
    "pinia": "2.3.1",
    "resend": "4.1.1",
    "vue": "3.5.13",
    "yup": "1.6.1"
  },
  "devDependencies": {
    "@iconify-json/svg-spinners": "1.2.2",
    "@nuxt/eslint": "0.7.6",
    "@nuxt/ui": "2.21.0",
    "@types/jsonwebtoken": "9.0.8",
    "nuxt": "3.15.4",
    "nuxt-security": "2.1.5",
    "prisma": "6.3.0",
    "sass": "1.83.4",
    "tailwindcss": "^4.0.3",
    "typescript": "5.7.3"
  }

@ineshbose
Copy link
Collaborator

I use bun and have Nuxt3 and Nuxt UI 2 but not able to install Tailwindcss v4 without errors...

Tutorial used: https://tailwindcss.com/docs/installation/framework-guides/nuxt

Issue on install:

[nuxt:tailwindcss 16:39:08]  WARN  Failed to load config ./.nuxt/nuxtui-tailwind.config.mjs due to the error below. Skipping..
 Package subpath './lib/lib/defaultExtractor.js' is not defined by "exports" in C:\***\node_modules\tailwindcss\package.json

    at exportsNotFound (node:internal/modules/esm/resolve:314:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:661:9)
    at resolveExports (node:internal/modules/cjs/loader:653:36)
    at Function._findPath (node:internal/modules/cjs/loader:752:31)
    at Function._resolveFilename (node:internal/modules/cjs/loader:1395:27)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at jitiResolve (node_modules\jiti\dist\jiti.cjs:1:187220)
    at jitiRequire (node_modules\jiti\dist\jiti.cjs:1:189288)
    at import (node_modules\jiti\dist\jiti.cjs:1:199778)
    at C:/***/.nuxt/nuxtui-tailwind.config.mjs:2:31
    at eval_evalModule (node_modules\jiti\dist\jiti.cjs:1:196325)
    at node_modules\jiti\dist\jiti.cjs:1:194552
    at async Function.import (node_modules\jiti\dist\jiti.cjs:1:199772)
    at async resolveConfig (/C:/***/node_modules/c12/dist/shared/c12.B4fc1S0C.mjs:343:18)
    at async loadConfig (/C:/***/node_modules/c12/dist/shared/c12.B4fc1S0C.mjs:147:23)
    at async Promise.all (index 3)
    at async loadConfigs (/C:/***/node_modules/@nuxtjs/tailwindcss/dist/module.mjs:374:27)
    at async /C:/***/node_modules/@nuxtjs/tailwindcss/dist/module.mjs:420:9
    at async generateApp (/C:/***/node_modules/nuxt/dist/shared/nuxt.CrJjphBv.mjs:6168:5)
    at async _applyPromised (/C:/***/node_modules/perfect-debounce/dist/index.mjs:54:10)

Issue on nuxt dev:

ERROR  [unhandledRejection] Package subpath './resolveConfig' is not defined by "exports" in C:\***\node_modules\tailwindcss\package.json                                                                                                                                                             16:44:39  

    at exportsNotFound (node:internal/modules/esm/resolve:314:10)
    at packageExportsResolve (node:internal/modules/esm/resolve:661:9)
    at resolveExports (node:internal/modules/cjs/loader:653:36)
    at Function._findPath (node:internal/modules/cjs/loader:752:31)
    at Function._resolveFilename (node:internal/modules/cjs/loader:1395:27)
    at Function.resolve (node:internal/modules/helpers:145:19)
    at Object.<anonymous> (node_modules\tailwind-config-viewer\lib\tailwindConfigUtils.js:9:43)
    at Module._compile (node:internal/modules/cjs/loader:1739:14)
    at Object..js (node:internal/modules/cjs/loader:1904:10)
    at Module.load (node:internal/modules/cjs/loader:1473:32)

ℹ Restarting Nuxt due to error: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './resolveConfig' is not defined by "exports" in C:\***\node_modules\tailwindcss\package.json

My packages:

  "dependencies": {
    "@pinia/nuxt": "0.9.0",
    "@prisma/client": "6.3.0",
    "@tailwindcss/vite": "^4.0.3",
    "deep-email-validator": "0.1.21",
    "jsonwebtoken": "9.0.2",
    "moment": "2.30.1",
    "moment-timezone": "0.5.47",
    "pinia": "2.3.1",
    "resend": "4.1.1",
    "vue": "3.5.13",
    "yup": "1.6.1"
  },
  "devDependencies": {
    "@iconify-json/svg-spinners": "1.2.2",
    "@nuxt/eslint": "0.7.6",
    "@nuxt/ui": "2.21.0",
    "@types/jsonwebtoken": "9.0.8",
    "nuxt": "3.15.4",
    "nuxt-security": "2.1.5",
    "prisma": "6.3.0",
    "sass": "1.83.4",
    "tailwindcss": "^4.0.3",
    "typescript": "5.7.3"
  }

Nuxt UI 2 still depends on TailwindCSS 3 as it uses the exported extractor.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants