Problem
tsconfig baseUrl bare imports (with no paths) are not resolved.
react.dev's tsconfig.json sets "baseUrl": "src" and imports modules bare, e.g. import {Page} from 'components/Layout/Page'. Next/SWC resolves these. Under vinext every page 500s at SSR:
Error: Cannot find module 'components/Layout/Page' imported from src/pages/[...markdownPath].js
code: 'ERR_MODULE_NOT_FOUND'
Root cause (from reading vinext source)
config/tsconfig-paths.ts only materializes aliases for compilerOptions.paths — a baseUrl-only project produces zero aliases.
config/next-config.ts only enables Vite's native resolve.tsconfigPaths when useNativeTsconfigPaths = isTypeScriptConfig && viteMajor >= 8. react.dev's config is next.config.js (not .ts), so it's disabled.
- Net: bare
baseUrl roots resolve nowhere.
Workaround used
Manual resolve.alias for the bare-imported roots (components, utils, hooks) → absolute src/<root>/.
Suggested fix
Honor compilerOptions.baseUrl (bare-root resolution, not just paths) for the app, regardless of whether next.config is .js or .ts.
Problem
tsconfig
baseUrlbare imports (with nopaths) are not resolved.react.dev's
tsconfig.jsonsets"baseUrl": "src"and imports modules bare, e.g.import {Page} from 'components/Layout/Page'. Next/SWC resolves these. Under vinext every page 500s at SSR:Root cause (from reading vinext source)
config/tsconfig-paths.tsonly materializes aliases forcompilerOptions.paths— abaseUrl-only project produces zero aliases.config/next-config.tsonly enables Vite's nativeresolve.tsconfigPathswhenuseNativeTsconfigPaths = isTypeScriptConfig && viteMajor >= 8. react.dev's config isnext.config.js(not.ts), so it's disabled.baseUrlroots resolve nowhere.Workaround used
Manual
resolve.aliasfor the bare-imported roots (components,utils,hooks) → absolutesrc/<root>/.Suggested fix
Honor
compilerOptions.baseUrl(bare-root resolution, not justpaths) for the app, regardless of whethernext.configis.jsor.ts.