Code Monkey home page Code Monkey logo

Comments (7)

ben-rogerson avatar ben-rogerson commented on May 18, 2024 1

Hey Vincent, thanks for looking into this and it's great you got to the bottom of it.
I think adding a value of 0 should be allowed so I'll add a fix for this 👍

Were you able to trigger the error consistently?

from twin.macro.

vincent-vieira avatar vincent-vieira commented on May 18, 2024 1

If I can help you testing your fix, don't hesitate to sollicitate me :)

from twin.macro.

ben-rogerson avatar ben-rogerson commented on May 18, 2024 1

This bug was fixed in v1.0.0 🎉

from twin.macro.

ben-rogerson avatar ben-rogerson commented on May 18, 2024

Great to hear you're enjoying twin! - Aside from the bug you've found anyway 😄

I haven't seen this specific bug before but I am aware of some caching issues, particularly in Gatsby.

I've made a codesandbox attempting to reproduce the issue but haven't succeeded yet.

Perhaps you could verify the tailwind.config.js is the same? Or if there's any other plugins that could be interfering.

Also another thought - is the error still showing after you do a gatsby build?

from twin.macro.

vincent-vieira avatar vincent-vieira commented on May 18, 2024

I debugged a little, and got the issue.

The inset config for zero value should be '0': '0', not '0': 0. Otherwise, the lookup here will fail as the '0' config value as a number, extracted from the classParts will be evaluated as a falsy value... And because the lookup fails, the resolve function returns an empty object triggering the error even if the class exists in the Tailwind configuration.

This was this dumb lol.

I'll let you close the issue if you don't think it is necessary to add any safeguard 😊

from twin.macro.

vincent-vieira avatar vincent-vieira commented on May 18, 2024

Apart from cache issues, yes !
Everytime I switch back from '0' or '0px' to 0 while clearing node_modules/.cache folder and restarting Gatsby server (due to config livereloading issues), the error comes back.

from twin.macro.

ben-rogerson avatar ben-rogerson commented on May 18, 2024

great, that'll help me out testing a fix - thanks so much for submitting the issue :)

from twin.macro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.