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

A declaration file cannot be imported without 'import type' #293

Open
GreenmeisterDavid opened this issue Sep 23, 2024 · 2 comments
Open

Comments

@GreenmeisterDavid
Copy link

GreenmeisterDavid commented Sep 23, 2024

Describe the bug
Adding the NuxtHub module to the latest version of Nuxt (3.13.2) gives an error when combined with vue-tsc typechecking. Output error;

 ERROR        
 ERROR(vue-tsc)  A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file '/home/projects/github-tlv5io/node_modules/@nuxthub/core/dist/runtime/base/server/utils/hooks' instead?
 FILE  undefined:

undefined

[vue-tsc] Found 1 error. Watching for file changes.

Steps to reproduce
Reproduction on StackBlitz: https://stackblitz.com/edit/github-tlv5io

Steps to reproduce the behavior:

  1. Start new nuxt project
  2. Add the nuxthub module using npx nuxi module add hub
  3. Add typescript and vue-tsc dev deps
  4. Set typechecking in nuxt.config.ts;
  typescript: {
      typeCheck: true,
    },
  1. Run dev (npm run dev)

Expected behavior
No typescript errors.

@atinux
Copy link
Contributor

atinux commented Sep 24, 2024

This seems related directly to the module builder as Nitro generate a import script in .nuxt/types/nitro-imports.d.ts

CleanShot 2024-09-24 at 17 38 25

@zacwebb
Copy link
Contributor

zacwebb commented Oct 2, 2024

Same here on [email protected].

Downgrading to 3.13.1 resolves it for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants