linaria icon indicating copy to clipboard operation
linaria copied to clipboard

esbuild setup throws runtime warning

Open gopeter opened this issue 3 years ago • 2 comments
trafficstars

I've created a CodeSandbox with the esbuild configuration mentioned in the docs, but I still get this warning: Using the "styled" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly. See https://github.com/callstack/linaria#setup.

Is there something wrong with this setup?

gopeter avatar Feb 08 '22 15:02 gopeter

Thought I ran into the same issue, but after looking at your example I realized that you simply ship code to the browser without removing the linaria function calls first. The esbuild config works, if you run npm run build, but in your case create-react-app is using webpack under the hood which in your example is not configured to handle linaria code.

dsod avatar Feb 15 '22 00:02 dsod

You're right, this issue is (more or less) a duplicate of #668

gopeter avatar Feb 15 '22 06:02 gopeter

Runtime mode is not supported (see #668). If you will use containers setup on CodeSandbox/Stackblitz, it will work like a charm 💎

Example: https://stackblitz.com/edit/stackblitz-starters-tq8mic?file=build.mjs

~/projects/stackblitz-starters-tq8mic 4s
❯ node build.mjs

layershifter avatar Oct 09 '23 19:10 layershifter