question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Currently compiler breaks when it encounters <script> tag:

ERROR in ./src/login/base/base.svelte
Module build failed (from ./node_modules/linaria/loader.js):
SyntaxError: /home/tony/Projects/auxilia/src/login/base/base.svelte: Unexpected token (1:0)

> 1 | <script>
    | ^
  2 |     import style from './styles';
  3 |     import Field from '../input/input.svelte';
  4 |     import { css } from 'linaria';

I suppose Vue would have very similar problem as compiler doesn’t recognize that javascript is contained within the <script> tag.

Now for those who might not be aware, Svelte is a compiler for web standard compliant vanilla javascript components. Which made me think that Linaria sould be such a perfect fit to go hand in hand.

It’s important to note that it actually does work, as I import generated class name, as the styles get compiled from separate file, but that beats the point of single-file-components.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
pbitkowskicommented, Jun 2, 2019

Hi Tony. Thanks for your request! I checked Svelte and it looks like a really good idea to support it.

2reactions
madhavarshneycommented, Apr 8, 2020

@jayu Here you go: https://github.com/madhavarshney/svelte-linaria-sample. Let me know what you think! I’ll open a PR to update the docs sometime this week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Svelte <3 TypeScript
It's been by far the most requested feature for a while, and it's finally here: Svelte officially supports TypeScript. We think it'll give...
Read more >
TypeScript support in Svelte - Learn web development
To add TypeScript support to an existing Svelte project, you can follow these instructions. Alternatively, you can download the setupTypeScript.
Read more >
svelte - npm
Pick an issue and help us out! To install and work on Svelte locally: git clone https://github.com/sveltejs/svelte.git cd svelte npm install.
Read more >
Add support for Svelte : WEB-27366 - YouTrack - JetBrains
Hence I want to suggest that Webstorm adds support for svelte.js idioms. Note from JetBrains. There's Svelte plugin available for WebStorm and other ......
Read more >
Svelte - Open Collective
Become a backer for $5.00 per month and support us. Starts at$5 USD / month. Contribute. Latest activity by. + 207. Recurring contribution....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found