You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Alternatively, below are the steps to recreate it locally with ease:
npx nuxi init -t module my-module
cd my-module
npm i --legacy-peer-deps
npm run dev:prepare
Create a file like ~/src/runtime/TemplatePage.vue with the following contents:
<template>
<div>hello {{ world }}</div>
</template>
<script lang="ts" setup>
import {
computed,
} from "#imports";
const world = computed( () => "world" );
</script>
The error will be immediately apparent.
Describe the bug
When creating a Nuxt module, Vue files in the runtime folder don't seem to pick up the TypeScript aliases generated by Nuxt. It errors with the following:
Cannot find module '#imports' or its corresponding type declarations.ts(2307)
For comparison, I cloned nuxt/content and added the same Vue file in that repo's runtime folder, which works as intended. I can't work out what the difference is that causes the issue in a fresh module.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Environment
Darwin
v18.16.1
3.6.5
2.5.2
[email protected]
vite
-
-
-
Reproduction
See here for a repro: https://github.com/dan-hammond/imports-types-repro
Alternatively, below are the steps to recreate it locally with ease:
Create a file like
~/src/runtime/TemplatePage.vue
with the following contents:The error will be immediately apparent.
Describe the bug
When creating a Nuxt module, Vue files in the runtime folder don't seem to pick up the TypeScript aliases generated by Nuxt. It errors with the following:
Cannot find module '#imports' or its corresponding type declarations.ts(2307)
For comparison, I cloned nuxt/content and added the same Vue file in that repo's runtime folder, which works as intended. I can't work out what the difference is that causes the issue in a fresh module.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: