-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
Environment
- Operating System: Windows_NT
- Node Version: v18.18.0
- Nuxt Version: 3.9.1
- CLI Version: 3.10.0
- Nitro Version: 2.8.1
- Package Manager: [email protected]
- Builder: -
- User Config: css, app, ssr, runtimeConfig, modules, imports, vite, nitro
- Runtime Modules: @pinia/[email protected], @nuxt/[email protected], @nuxtjs/[email protected]
- Build Modules: -
Reproduction
codesandbox.io/p/devbox/eloquent-chatelet-gdvcy3
Unfortunately, due to confidential elements of the project, providing a public repository is not possible.
However, I'll guide you on creating a simplified reproduction locally to demonstrate the import issue:
Project Structure:
Confirm that your project structure includes a module named "processus" with TypeScript files (e.g., store, components, etc.).
Module Setup:
On each module's root, the set of pages/components used for that module is defined using the example above.
TS Config:
After reviewing several issues more or less related to this topic, the following configuration was added to the tsconfig.json file.
Page index.vue
- Navigate to the modules/processus/index.vue file.
- Attempt to import the module with the statement import processus from '~/modules/processus/store/processus'; or import from "#imports" resource.
- Observe the aforementioned errors in the IDE.
Describe the bug
I am currently facing issues with importing TypeScript modules from specific pages within a local module in an extended Nuxt.js application composed of multiple modules.
When attempting to import specific modules from pages located in the "processus" module, I receive the following errors in my IntelliJ IDE and also in VSCode:
Vue: Cannot find module ~/modules/processus/store/processus or its corresponding type declarations.
Vue: Cannot find module #imports or its corresponding type declarations.
Additional context
If I try to import with the same path and alias from a Vue file in the "components" folder of my process module, everything works perfectly.
I also want to add that the code runs completely without any issues, and the builds are functional as well. It's just that my IDE consistently highlights these imports in red.
Logs
No response