这是indexloc提供的服务,不要输入任何密码
Skip to content

Error building Nuxt client: Package import specifier "#build/nuxt.config.mjs" is not defined in package #1660

@rigtigeEmil

Description

@rigtigeEmil

Description

Running nuxt dev after changing from @hey-api/client-fetch to @hey-api/client-nuxt (and re-building the client) throws the following:

ERROR  [nuxt] [request error] [unhandled] [500] 
Package import specifier "#build/nuxt.config.mjs" is not defined in package
(..)\node_modules\.pnpm\nuxt@3.15.4_@libsql+client@0.14.0_@parcel+watcher@2.5.1_@types+node@22.13.0_better-sqlite3@11_2ct7njmhu3gpvfg3wk7372se64\node_modules\nuxt\package.json 
imported from 
(..)\node_modules\.pnpm\nuxt@3.15.4_@libsql+client@0.14.0_@parcel+watcher@2.5.1_@types+node@22.13.0_better-sqlite3@11_2ct7njmhu3gpvfg3wk7372se64\node_modules\nuxt\dist\app\nuxt.js

I tried replicating it with a small sample, but I wasn't able to. Mostly wondering if there's any clues to why this might be happening, or if I'm doing something wrong.

Perhaps the most likely cuplrit is that I'm running with combatibilityversion 4 (in nuxt.config.ts)(:

future: {
	compatibilityVersion: 4,
},
compatibilityDate: '2024-04-03',

openapi-ts.config.ts:

export default defineConfig({
	input: 'https://localhost:7015/openapi/v1.json',
	output: {
		lint: 'eslint',
		path: 'app/gilbert-api',
	},
	plugins: [
		'@hey-api/client-fetch',
		// '@hey-api/client-nuxt',
	],
});

Reproducible example or configuration

No response

OpenAPI specification (optional)

No response

System information (optional)

package.json:

  "dependencies": {
    "@nuxt/ui-pro": "https://pkg.pr.new/@nuxt/ui-pro@43945f6",
    "@nuxtjs/i18n": "^9.1.4",
    "@pinia/nuxt": "^0.9.0",
    "@tailwindcss/vite": "4.0.3",
    "nuxt": "^3.15.4",
    "pinia": "^2.3.1",
    "tailwindcss": "4.0.3",
    "vue": "^3.5.13",
    "vue-i18n": "^11.1.0",
    "vue-router": "4.5.0",
    "zod": "^3.24.1"
  },
  "devDependencies": {
    "@hey-api/client-fetch": "^0.7.3",
    "@hey-api/client-nuxt": "^0.1.3",
    "@hey-api/openapi-ts": "^0.63.2",
    "@iconify-json/lucide": "^1.2.25",
    "@nuxt/eslint": "^1.0.0",
    "@nuxt/test-utils": "^3.15.4",
    "@vue/test-utils": "^2.4.6",
    "cross-env": "^7.0.3",
    "eslint": "^9.19.0",
    "happy-dom": "^16.8.1",
    "playwright-core": "^1.50.1",
    "ts-to-zod": "^3.15.0",
    "typescript": "^5.7.3",
    "vitest": "^3.0.4"
  },

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🔥Something isn't workingneeds info ⏳Further information is required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions