Mokshit06/typewind

Arbitrary values don't work

guitheengineer opened this issue · 4 comments

Link to the code that reproduces this issue

https://stackblitz.com/edit/mokshit06-typewind-ckoigp?file=pages/index.tsx

To reproduce

Apply any arbitrary values (e.g tw.text_['20px']). It doesn't matter the order, any use of it is breaking the app with the error shown below.

Describe the Bug

Any attempt to use an arbitrary value is going to throw an error like the following:

error - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[3].oneOf[11].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[3].oneOf[11].use[2]!./styles/globals.css
TypeError: /home/projects/mokshit06-typewind-ckoigp/typewind.tsx: Cannot read properties of undefined (reading 'toString')
Import trace for requested module:
./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[3].oneOf[11].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[3].oneOf[11].use[2]!./styles/globals.css
./styles/globals.css

Expected Behavior

Should work as any other tw utility

Hi! Please use v0.0.4 for now, since the issue has been created by v0.0.5. Sorry for the inconvenience. Trying to fix it!

Hey @kavinvalli np, it's amazing how you guys built something this great in such a short amount of time!

Do you think it would be a great idea to add tests before going v1.0.0? It would prevent this from happening in the future.

Hey @kavinvalli np, it's amazing how you guys built something this great in such a short amount of time!

Do you think it would be a great idea to add tests before going v1.0.0? It would prevent this from happening in the future.

Yes @guilhermefront. We will add tests soon. Now that this happened, looks urgent to prevent this from happening again. Also df067fc should fix this now. Will release new version soon!

thankyou! and yep we're definitely adding tests for all these cases to typewind before v1.0.0