question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

tailwind-preset `cjs` build issue

See original GitHub issue

I noticed that the .cjs build output is missing the dividend default value on the ratios function. This causes the ratios to not get outputted (thus affecting the resolved default config) in a cjs environment.

let dividend = 1 IS in the source: https://github.com/tw-in-js/twind/blob/next/packages/preset-tailwind/src/defaultTheme.ts#L831

Versus the compiled cjs in the distributed npm package:

Screen Shot 2022-01-31 at 3 06 06 PM

I’m currently on @twind/preset-tailwind@1.0.0-next.30, but I don’t think this is specific to 30.

Just in case it’s relevant - ran into this while trying to use https://github.com/muhammadsammy/tailwindcss-classnames. Noticed that the x/y ratio classes were not present in the generated typings, and tracked it down to this missing default val on the ratios func.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sastancommented, Jan 31, 2022

made a mistake by adding a comment but not fixing the bug. will be fixed in 1.0.0-next.32

https://github.com/tw-in-js/twind/commit/916e7fb928e3e90703126792d704ad561bc1d01a

1reaction
sastancommented, Jan 31, 2022

Great catch! If I change it to var it works. All other for-loops seem to be ok.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Including presets: [] in tailwind.config.js causes build to fail ...
Thanks! The issue is the preset: [] line in your config file, if you remove that it will build successfully This has come...
Read more >
Configuration - Tailwind CSS
The presets section allows you to specify your own custom base configuration instead of using Tailwind's default base configuration. tailwind.config.js. module.
Read more >
Some Tailwind styles not working in production with Next.js
For some reason a few styles don't seem to be working in production build hosted on Netlify. This seems ...
Read more >
@twind/preset-tailwind - npm
The full Tailwind CSS v3 experience without any build step right in the browser or any other environment like Node.js, deno, workers, ....
Read more >
Tailwind CSS code completion doesn't work if package.json ...
I'm still encountering this issue on IntelliJ IDEA 2022.1 EAP (Ultimate Edition) Build #IU-221.4906.8, built on March 3, 2022. Judging by the trace...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found