chakra-ui / panda

🐼 Universal, Type-Safe, CSS-in-JS Framework for Product Teams ⚡️
https://panda-css.com
MIT License
5.23k stars 236 forks source link

Styles not loading from 0.27.3 (likely Windows related) #2201

Closed MeanBoyCousin closed 9 months ago

MeanBoyCousin commented 9 months ago

Description

When upgrading to 0.27.3 or above, I expect that when booting my NextJS app the styles are applied. However, no styles seem to be applied.

JS Framework

NextJS 14

Panda CSS Version

0.27.3+

Operating System

Additional Information

diff --git a/node_modules/@pandacss/core/dist/index.js b/node_modules/@pandacss/core/dist/index.js
index cde18a1..88600ad 100644
--- a/node_modules/@pandacss/core/dist/index.js
+++ b/node_modules/@pandacss/core/dist/index.js
@@ -802,9 +802,9 @@ var ImportMap = class {
         return true;
       }
       const resolvedMod = resolveTsPath?.(result.mod);
-      const absMod = [this.context.config.cwd, mod].join("/");
-      if (resolvedMod?.includes(absMod)) {
-        result.importMapValue = resolvedMod;
+
+      if (resolvedMod?.includes(mod)) {
+        result.importMapValue = resolvedMod
         return true;
       }
     }

Reverting this specific change made in this PR fixes the issue for me and lets me upgrade to the latest version.

astahmer commented 9 months ago

are you using tsconfig path aliases ? can you use importMap as described here ?

MeanBoyCousin commented 9 months ago

Yeah, I did try this. Unless I was configuring it wrong, it didn't solve the problem. For the below setup, what is the configuration?

// tsconfig.json

"paths": {
  "@/*": ["./src/*"],
  "tv/*": ["./public/trading_view/*"],
}

I tried it as a comma-separated list of strings, an array and an object.

astahmer commented 9 months ago

if you are importing Panda stuff like import { css } from '@/styled-system/css' then the matching importMap is importMap: "@/styled-system"

MeanBoyCousin commented 9 months ago

Amazing, thank you very much. I clearly did not spend enough time reading that documentation!