-
-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: 奇怪的 bug,某些页面某些jit 类名转义失败 #556
Comments
在 taro 中,由于 tailwindcss class 是写在 js / jsx 里面的,这时候转化流程是,weapp-tailwindcss 会和 tailwindcss 进行通信,然后从它上下文里面,去取出 classname 进行转义,所以只有被 tailwindcss 提取到的 token 才会被转义。 所以需要保证你写的所有的 tailwindcss class ,都在 tailwind.config.js 的 content 选项包裹的范围内。 |
@sonofmagic content 已经确保是包围了的,它现在主要是只是某些 jit 变量突然解析不了,比如元素同时具有 px-[32px],py-[32px]这样的 jit css,然后 px-[32px]是成功转义的,但是 py-[32px]无法转义,如上面的图一样,就变成 py- 32px 这样,但是这个 bug 我暂时不知道怎么复现 |
了解,我先在我的 demo 里面复现一下这个问题,另外我想知道你的 taro 是 webpack5 还是 vite |
@sonofmagic webpack5,比较奇怪的是,a 页面是没问题的,b 页面有问题(普通分包),但两个页面都会有某些 jit 变量失效,确保不是动态变量,写死的 |
不知道能不能在这个 https://github.com/sonofmagic/weapp-tailwindcss/tree/main/demo/taro-app 复现 |
@sonofmagic 目前在这个项目暂时复现不出来,复现出来后我会在这 issue再次回复 |
@sonofmagic 这个问题我貌似跑一次weapp-tw patch 就没问题了,那是不是每次新增页码都得跑一次weapp-tw patch,或者运行项目的时候,前面先运行一次weapp-tw patch |
不是的,这个命令只需要放在你的 |
@sonofmagic 我之前也是按照文档去更新的,但目前解决方法是我手动跑一次weapp-tw patch就没问题了,但我不知道为什么这样可以解决到我的问题 |
@YeYbfwad 我也感觉非常奇怪,因为我这个 |
weapp-tailwindcss 版本
3.7.0
框架 & 小程序平台
taro react 编译到微信小程序
最小复现bug的代码仓库链接
No response
复现bug的步骤
遇到一个很奇怪的问题,某些页面下,jit 某些css会编译失败(比如 py 的 jit css编译错误,这个页面所有的 py-[xxx] jit css 都会编译错误),会编译成下面的样子,请问有什么方法可以排查是什么原因导致的,最小化仓库无法复现
taro版本:4.0.9
tailwindcss版本: 3.4.17
预期是什么?
正常编译
实际发生了什么?
类名编译错误
运行环境
其他附加信息
No response
The text was updated successfully, but these errors were encountered: