Skip to content
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

XWind: Cannot read property 'theme' of undefined for nextjs 11 #31

Open
GZLiew opened this issue Aug 19, 2021 · 8 comments
Open

XWind: Cannot read property 'theme' of undefined for nextjs 11 #31

GZLiew opened this issue Aug 19, 2021 · 8 comments

Comments

@GZLiew
Copy link

GZLiew commented Aug 19, 2021

Reproducible demo: https://github.com/vercel/next.js/tree/canary/examples/with-tailwindcss-emotion

Hi when I tried Xwind with the latest version of NextJs I got the error

Cannot read property 'theme' of undefined

@tigwyk
Copy link

tigwyk commented Sep 18, 2021

I'm encountering the same issue while trying to deploy this microservices example auction site: https://github.com/JarrodMalkovic/auction-website

Specifically the front-end module fails to render the homepage with:
[frontend] MacroError: /app/src/pages/_app.tsx: TypeError: xwind/macro - Cannot read property 'theme' of undefined

@IngoVals
Copy link

IngoVals commented Oct 1, 2021

Downgrading Tailwind to 2.1.4 worked for me. So there must be something introduced between 2.1.4 and 2.2.16 that is breaking.

@movahedan
Copy link

Downgrading Tailwind to 2.1.4 worked for me. So there must be something introduced between 2.1.4 and 2.2.16 that is breaking.

Thanks, man! I tried everything and no good thing happened, this one solved my issue.

@ramcics
Copy link

ramcics commented Aug 15, 2022

I'm encountering the same issue while trying to deploy this microservices example auction site: https://github.com/JarrodMalkovic/auction-website

Specifically the front-end module fails to render the homepage with: [frontend] MacroError: /app/src/pages/_app.tsx: TypeError: xwind/macro - Cannot read property 'theme' of undefined

@IngoVals do you have any suggestion for this error ? I tried to upgrade and downgrade the version of Tailwind library and I had the same error.

@numyalai
Copy link

@ramcics did you find a good solution for this ?

@jatolentino
Copy link

@numyalai @ramcics @tigwyk did u guys find a solution for that error in the frontend side?

@ramcics
Copy link

ramcics commented May 6, 2024

Yes, finally I added this block of code the tsconfig.json:
"baseUrl": "packages/", "paths": { "jsx": ["jsx/jsx.jsx"], "tjs": ["tjs/tjs.js"], "tscript": ["tscript/tscript.js"], "tsx": ["tsx/tsx.tsx"], },
and upgraded the ts-node version library to 2.0.0.
In some modules, you need to clean npm cache and delete the node_modules.

@jatolentino
Copy link

@ramcics I tested with the changes you mentioned and it works! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants