Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

failed to resolve "extends":"./.nuxt/tsconfig.json" #25433

Open
baixiaoyu2997 opened this issue Jan 25, 2024 · 5 comments
Open

failed to resolve "extends":"./.nuxt/tsconfig.json" #25433

baixiaoyu2997 opened this issue Jan 25, 2024 · 5 comments

Comments

@baixiaoyu2997
Copy link
Contributor

baixiaoyu2997 commented Jan 25, 2024

Environment

  • Operating System: Linux
  • Node Version: v20.10.0
  • Nuxt Version: 3.9.3
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: pnpm@8.14.0
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

demo

Describe the bug

layer have tsconfig:

{
  // https://v3.nuxtjs.org/concepts/typescript
  "extends": "./.nuxt/tsconfig.json"
}

when i have error.vue file in layer, will show error:
image

Additional context

Original discussion here: #13367 (comment)

Logs

No response

@markthree
Copy link

markthree commented Jan 26, 2024

@manniL Please add prepare: "nuxt prepare" to packages/eorderbook-base/package.json

{
  "scripts": {
     "prepare": "nuxt prepare"
  }
}

Then re-execute the pnpm install command

This is what triggers the generation of .nuxt

Of course I think we can do better in that scene.

@baixiaoyu2997
Copy link
Contributor Author

@manniL Please add prepare: "nuxt prepare" to packages/eorderbook-base/package.json

{
  "scripts": {
     "prepare": "nuxt prepare"
  }
}

Then re-execute the pnpm install command

This is what triggers the generation of .nuxt

but when i delete error.vue this error disappeared and this error will not occur when using nuxt3.8.2. I don’t think run prepare everywhere is an elegant way to handle it.
image
image
you can see how annoying this is in a real use case

@markthree
Copy link

markthree commented Jan 26, 2024

I don’t think run prepare everywhere is an elegant way to handle it.

Yeah, that's what I thought.

Maybe there is a better way, looking forward to other people's solutions

@mklueh
Copy link

mklueh commented Feb 26, 2024

I'm facing the same issue out of the sudden despite running prepare before.

It happens with this component because of the script tag

<template>
  <header class="bg-white shadow-lg py-3">
    <div class="mx-auto max-w-screen-xl flex justify-between items-center px-4">
      <nuxt-link to="/">
        <BaseLogo />
      </nuxt-link>

      <nav class="hidden navbar md:flex justify-between font-bold flex-justify-end space-x-6 text-xl">
        <BaseNavigationLinks />
      </nav>

      <button>
        <i class="md:hidden btn drawer-button align-end text-5xl i-mdi-menu" />
      </button>

    </div>

    <BaseMegaMenu class="md:hidden" v-if="true" />
  </header>
</template>
<script lang="ts" setup>
import { ref } from "vue";

const open = ref(false);
</script>

When I remove the script it works.

In fact, it even works if I keep the script tag and just remove the content

import { ref } from "vue";

const open = ref(false);

image

The .nuxt/tsconfig.json file exists in my case

Edit: analyzed it further. The issue is caused by using lang="ts" in the script tag in my case.

Are we not supposed to explicitly use the lang attribute anymore and could we get a better error message if so?

@AlansCodeLog
Copy link

This is also happening to me if I just try to run nuxt prepare.... Have not had time to investigate if the script tag is the issue.

@danielroe danielroe removed the 3.x label Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants