twin.macro: Invalid or unexpected token

Created on 20 Feb 2020  路  7Comments  路  Source: ben-rogerson/twin.macro

Hey Ben,

thank you for your work. I was really looking forward to get tailwind working with emotion :)

My code was working quiet ok with tailwind.macro, I moved on to twin.macro and now end up with:

header.js: twin.macro: Invalid or unexpected token Learn more: https://www.npmjs.com/package/twin.macro

As soon I import the macro this error happens, I dont have to actually call it.

Unfortunately the error message does not tell me a lot about what and where sth went wrong :(

Related PR with my migration commit: https://github.com/axe312ger/gatsby-mdx-suite/pull/28

Any ideas?

Thanks again,
Benedikt

All 7 comments

Hey Benedikt,
Many thanks for the bug report, I'll troubleshoot and get back to you 馃憤

I wasn't able to replicate the issue and I haven't seen that error anywhere during testing.

Alright, ill try to encapsulate a simple project that raises the same issue

Could replicate my project setup with twin, but I do not run into this error as well. It has to be something I dont cover in my test repo, maybe lerna. I'll dig deeper.

For now, this is working: 馃槏

https://github.com/axe312ger/gatsby-starter-theme-ui-emotion-tailwind

Thanks for your report, hopefully you can get it all sorted. Sweet starter you got there too 馃憣

Thanks, was just a test. Works fine except some issues with theme-ui -> tailwind config conversion. But we gonna fix this over there 馃挭

So far my second try to implement twin in my project does work seamlessly. I don't run into that bug anymore, even with lerna etc.

https://github.com/axe312ger/gatsby-mdx-suite/pull/49

For now I guess the original error might be related to some weird dependency hick-up as I tried to implement tailwind.macro in several different ways before and then switched to twin

ok I'll close this for now, feel free to reopen if you come across it again

Was this page helpful?
0 / 5 - 0 ratings

Related issues

laclance picture laclance  路  8Comments

lukasluecke picture lukasluecke  路  6Comments

abhijithvijayan picture abhijithvijayan  路  8Comments

DaneEveritt picture DaneEveritt  路  6Comments

tettoffensive picture tettoffensive  路  6Comments