nuxt / content

The file-based CMS for your Nuxt application, powered by Markdown and Vue components.
https://content.nuxt.com
MIT License
3.08k stars 624 forks source link

failed import from '#build/*' #2594

Closed RomanRadaykinFrontend closed 3 months ago

RomanRadaykinFrontend commented 6 months ago

Environment

Reproduction

I don't think I need a replay, it just seems like I'm missing something.

Describe the bug

Снимок экрана 2024-03-25 в 13 26 38


TS2792: Cannot find module '#build/services/generated/auth'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?

At the same time, the imports are all correct, I can get into each folder along this path. When importing '../../../*' everything works ok. How do I make an auto-import to a custom folder? Or at least remove the error above.

Additional context

tsconfig { "extends": "./.nuxt/tsconfig.json", "moduleResolution":"node", }

nuxt.config.ts export const sharedConfig = { devtools: { enabled: true }, rootDir: __dirname, modules: ['@element-plus/nuxt', '@pinia/nuxt'], elementPlus: { importStyle: 'scss', themes: ['dark'], }, plugins: ['plugins/ofetch', 'plugins/store'], pinia: { storesDirs: ['./sharedStore/'], }, // IT IS NOT WORK imports: { dirs: ['services'], }, vite: { css: { preprocessorOptions: { scss: { additionalData: ` @use "../../assets/styles/typography.scss" as ; @use "../../assets/styles/index.scss" as ; @use "../../assets/styles/themes.scss" as ; @use "../../assets/styles/elements-rewrite.scss" as ; @use "../../assets/styles/elements-colors.scss" as ; @use "../../assets/styles/fonts.scss" as *; `, }, }, }, }, }

Logs

ERROR  Pre-transform error: Failed to resolve import "#build/services/generated/auth" from "../../sharedStore/auth.ts". Does the file exist?
farnabaz commented 3 months ago

This is not related to content module. Try creating a simple reproduction using https://nuxt.new/c/v3 and create issue in https://github.com/nuxt/nuxt if issue persists.