Encountering an issue while attempting to import a .ts file in 'nuxt.config.ts' using the paths '@/' and '~/'. The error message reads: Cannot find module '~/path', Require stack: - nuxt.config.ts at Module._resolveFilename....
Here is a snippet of code from the nuxt.config.ts file
// this code does not work
import headConfig from '~/config/head/headConfig';
// import headConfig from '@/config/head/headConfig';
// this code works
// import headConfig from './config/head/headConfig';
export default defineNuxtConfig({
devtools: { enabled: false },
app: {
head: headConfig,
},
});
Check out the demo on StackBlitz
Nuxt Version: 3.8.2 | Node Version: 18.18.0 | NPM Version: 9.4.2