The latest release of this package is simply not working with the recommendation to use moduleResolution: node16, and requires one to import packages using file extensions in Typescript. Moreover, even after those changes, I still get an error trying to start my astro project:
10:46:11 AM [vite] (ssr) Error when evaluating SSR module /home/smac89/dev/website/astro.config.ts: Failed to resolve entry for package "postcss-rename". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "postcss-rename" package
Plugin: vite:import-analysis
File: /home/smac89/dev/website/plugins/astro-css-renamer.ts:60:49
36 | if (typeof postcssCfg === "object") {
37 | postcssCfg.plugins ??= [];
38 | const classRename = (await import("postcss-rename")).default;
| ^
39 | postcssCfg.plugins.push(
40 | classRename({
at packageEntryFailure (file:///home/smac89/dev/website/node_modules/.pnpm/vite@6.4.1_@types+node@22.13.14_jiti@1.21.7_lightningcss@1.29.3_terser@5.39.0_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:16198:15)
at resolvePackageEntry (file:///home/smac89/dev/website/node_modules/.pnpm/vite@6.4.1_@types+node@22.13.14_jiti@1.21.7_lightningcss@1.29.3_terser@5.39.0_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:16193:5)
at tryNodeResolve (file:///home/smac89/dev/website/node_modules/.pnpm/vite@6.4.1_@types+node@22.13.14_jiti@1.21.7_lightningcss@1.29.3_terser@5.39.0_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:16060:18)
at ResolveIdContext.resolveId (file:///home/smac89/dev/website/node_modules/.pnpm/vite@6.4.1_@types+node@22.13.14_jiti@1.21.7_lightningcss@1.29.3_terser@5.39.0_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:15831:19)
at EnvironmentPluginContainer.resolveId (file:///home/smac89/dev/website/node_modules/.pnpm/vite@6.4.1_@types+node@22.13.14_jiti@1.21.7_lightningcss@1.29.3_terser@5.39.0_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:42242:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TransformPluginContext.resolve (file:///home/smac89/dev/website/node_modules/.pnpm/vite@6.4.1_@types+node@22.13.14_jiti@1.21.7_lightningcss@1.29.3_terser@5.39.0_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:42449:15)
at async normalizeUrl (file:///home/smac89/dev/website/node_modules/.pnpm/vite@6.4.1_@types+node@22.13.14_jiti@1.21.7_lightningcss@1.29.3_terser@5.39.0_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:40492:26)
at async file:///home/smac89/dev/website/node_modules/.pnpm/vite@6.4.1_@types+node@22.13.14_jiti@1.21.7_lightningcss@1.29.3_terser@5.39.0_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:40623:37
at async Promise.all (index 8)
[astro] Unable to load your Astro config
Failed to resolve entry for package "postcss-rename". The package may have incorrect main/module/exports specified in its package.json: No known conditions for "." specifier in "postcss-rename" package
Location:
/home/smac89/dev/website/plugins/astro-css-renamer.ts:60:49
Stack trace:
at packageEntryFailure (file:///home/smac89/dev/website/node_modules/.pnpm/vite@6.4.1_@types+node@22.13.14_jiti@1.21.7_lightningcss@1.29.3_terser@5.39.0_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:16198:15)
at tryNodeResolve (file:///home/smac89/dev/website/node_modules/.pnpm/vite@6.4.1_@types+node@22.13.14_jiti@1.21.7_lightningcss@1.29.3_terser@5.39.0_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:16060:18)
at EnvironmentPluginContainer.resolveId (file:///home/smac89/dev/website/node_modules/.pnpm/vite@6.4.1_@types+node@22.13.14_jiti@1.21.7_lightningcss@1.29.3_terser@5.39.0_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:42242:17)
at async TransformPluginContext.resolve (file:///home/smac89/dev/website/node_modules/.pnpm/vite@6.4.1_@types+node@22.13.14_jiti@1.21.7_lightningcss@1.29.3_terser@5.39.0_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:42449:15)
at async file:///home/smac89/dev/website/node_modules/.pnpm/vite@6.4.1_@types+node@22.13.14_jiti@1.21.7_lightningcss@1.29.3_terser@5.39.0_yaml@2.7.0/node_modules/vite/dist/node/chunks/dep-D4NMHUTW.js:40623:37
?ELIFECYCLE? Command failed with exit code 1.
Please consider supporting moduleResolution: "bundler", which is the recommended resolution method for Typescript.
Downgrading to 0.7.0 has been my current solution
The latest release of this package is simply not working with the recommendation to use
moduleResolution: node16, and requires one to import packages using file extensions in Typescript. Moreover, even after those changes, I still get an error trying to start my astro project:Please consider supporting
moduleResolution: "bundler", which is the recommended resolution method for Typescript.Downgrading to 0.7.0 has been my current solution