Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

311
Views
Un componente solo puede tener un elemento <script> de nivel de instancia

Estoy tratando de incluir svelte material ui en mi aplicación sveltekit . me sale el error:

registro de errores esbelto

Aquí hay una muestra de mi código:

 <script context="module" lang="ts"> export const prerender = true; </script> <script lang="ts"> import Counter from '$lib/Counter.svelte'; </script> <script lang="ts"> import Button, { Label } from '@smui/button'; let clicked = 0; </script> <svelte:head> <title>Home</title> </svelte:head> <section> <h1> <div class="welcome"> <picture> <source srcset="svelte-welcome.webp" type="image/webp" /> <img src="svelte-welcome.png" alt="Welcome" /> </picture> </div> to your new<br />Svelte <Button variant="raised"> aaaaaaa </Button> </h1> <h2> try editing <strong>src/routes/index.svelte</strong> </h2> <Counter /> </section>

¿Qué esta pasando? ¿Qué me estoy perdiendo? Existe este hilo sobre el problema en github , pero parece que no lo encuentro útil. Sería feliz si alguien pudiera explicar exactamente lo que está sucediendo aquí. ¡Gracias!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Es porque tiene dos etiquetas de script en su componente. Debe tener solo uno.

 <script context="module" lang="ts"> export const prerender = true; </script> <script lang="ts"> import Counter from '$lib/Counter.svelte'; import Button, { Label } from '@smui/button'; let clicked = 0; </script> <svelte:head> <title>Home</title> </svelte:head> <section> <h1> <div class="welcome"> <picture> <source srcset="svelte-welcome.webp" type="image/webp" /> <img src="svelte-welcome.png" alt="Welcome" /> </picture> </div> to your new<br />Svelte <Button variant="raised"> aaaaaaa </Button> </h1> <h2> try editing <strong>src/routes/index.svelte</strong> </h2> <Counter /> </section>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!