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

TS: Using the *** tag in runtime is not supported. #13

Closed
newash opened this issue May 27, 2019 · 16 comments · Fixed by #18
Closed

TS: Using the *** tag in runtime is not supported. #13

newash opened this issue May 27, 2019 · 16 comments · Fixed by #18
Labels
bug Something isn't working help wanted Extra attention is needed upstream
Milestone

Comments

@newash
Copy link

newash commented May 27, 2019

I believe this is related to #9.

I have Typescript, with [email protected].
If I use v1.1.1 of this plugin, everything works.
If I update to v1.1.2 I get:

WebpackError: Using the "css" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly.
  
  - css.js:4 css
    [lib]/[linaria]/lib/core/css.js:4:1
...

(in the config I have this plugin listed after the Typescript one, as instructed)

@silvenon
Copy link
Collaborator

silvenon commented May 27, 2019

Should be working in v1.1.3, please try again.

@newash
Copy link
Author

newash commented May 29, 2019

🎉 Thank you, it does!

@yurkoturskiy
Copy link

I've just updated everything and got the same error using v1.1.3. With v1.1.2 and v1.1.1, everything works fine. I don't use typescript. I rechecked on a blank project before posting and got the same error.

@silvenon
Copy link
Collaborator

Well, isn't hacking webpack configs fun… I'll check it out.

silvenon added a commit that referenced this issue May 31, 2019
While fixing loader applying to TS rule, I accidentally broke the logic
for applying it to JS rule. Now it should work for both.

Fixes #13.
@silvenon
Copy link
Collaborator

silvenon commented May 31, 2019

@guandjoy ok, both should now work in v1.1.4.

@yurkoturskiy
Copy link

@silvenon Thank you!

@yurkoturskiy
Copy link

Same error raises when I run:
gatsby build
That starts to happen after I've updated Gatsby. Same with all versions of your plugin. Develop mode works fine.

@silvenon silvenon reopened this Jul 1, 2019
@silvenon
Copy link
Collaborator

silvenon commented Jul 2, 2019

Hm, I wasn't able to reproduce the error. Which versions of Gatsby and gatsby-plugin-linaria are you using?

@cometkim
Copy link
Owner

cometkim commented Jul 3, 2019

@silvenon I think this is the same issue with #17

@cometkim
Copy link
Owner

cometkim commented Jul 4, 2019

This would be working after #18 merged.

@yurkoturskiy
Copy link

@silvenon here is the small repo with two branches https://github.com/guandjoy/gatsby-linaria-test
master - latest versions
prev - versions I used when wrote the comment.

But the result is the same. Now it raises the error in both develop and build cases.

@silvenon
Copy link
Collaborator

silvenon commented Jul 6, 2019

Published in v1.2.2 🚀

@JesseFarebro
Copy link

This issue has resurfaced now that Gatsby supports Typescript out of the box. The TS check doesn't evaluate properly anymore as the internal plugin doesn't seem to add the resolvers in the same way.

https://github.com/silvenon/gatsby-plugin-linaria/blob/e3a40aa7d650c5cde95b5cf27ce89f51f1bce7cb/src/gatsby-node.js#L7-L9

@cometkim
Copy link
Owner

cometkim commented May 8, 2020

Ah, I almost forgot about it. I will follow up on this issue again this weekend.

@silvenon silvenon reopened this May 11, 2020
@JM-Mendez
Copy link

JM-Mendez commented May 17, 2020

I fixed the TS check and got it to properly configure the loader when typescript was detected, and it still failed.

The only thing that worked was to manually install and add gatsby-plugin-typescript before gatsby-plugin-linaria to my config as per the original instructions 🤷

@cometkim
Copy link
Owner

https://github.com/gatsbyjs/gatsby/blob/e50407a235e5e168e875d8a8d701f59084204328/packages/gatsby/src/bootstrap/load-plugins/load.js#L260-L266

GatsbyJS is now supporting typescript plugin, but.. it pushes into the after of the user plugins. As a result, the linaria plugin runs before the typescript loader is attached.

If the user explicitly sets the typescript plugin above it will work, but I need to find a better way.

@cometkim cometkim added bug Something isn't working help wanted Extra attention is needed upstream labels May 23, 2020
@cometkim cometkim added this to the v3 milestone Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed upstream
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants