Mistereo / next-linaria

Linaria support for Next.js
MIT License
93 stars 10 forks source link

Can't run NextJS + Typescript + Linaria + Yarn Workspaces #18

Open bruno2ms opened 1 year ago

bruno2ms commented 1 year ago

I've set an initial project for NextJS + Typescript + Linaria + Yarn Workspaces but when adding Linaria and next-linaria, my project doesn't work anymore and I get errors about the typescript types and stuff.

Does anyone know what can I do to solve this?

This is my minimal repo with the problem: https://github.com/bruno2ms/nextjs-linaria-yarn-workspaces

This is the error I'm getting (same error on console):

image
SerekKiri commented 1 year ago

Hey! 👋🏼 This is not a problem related to either linaria or next-linaria. You're importing typescript file to your project and it can't read it. You can compile it with tsc that you already have in your utils folder or use references in web/tsconfig.json.

AshConnolly commented 1 year ago

I'm getting the same exact issue. It only occurs when I change from export default nextConfig to export default withLinaria(nextConfig) the error doesn't occur using a different config wrapper like: export default WithNextMDX(nextConfig)

So I believe this is an issue with next-linaria, but might be wrong.