next-linaria icon indicating copy to clipboard operation
next-linaria copied to clipboard

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

Open bruno2ms opened this issue 1 year ago • 2 comments

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

bruno2ms avatar Dec 21 '22 17:12 bruno2ms

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.

SerekKiri avatar Dec 29 '22 09:12 SerekKiri

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.

AshConnolly avatar Oct 27 '23 11:10 AshConnolly