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

159
Views
Error: 'HelloWorld' is defined but never used

App.vue file

<template lang="pug">
div
  hello-world
</template>
<script setup lang="ts">
import HelloWorld from "./components/HelloWorld.vue";
</script>

HelloWorld.vue file

<template lang="pug">
div
  h1 {{ msg }}
</template>

<script setup lang="ts">
import { ref } from "vue";

const msg = ref<string>("Hello World!!!");
</script>

What is the issue and how to fix it? Getting this issue when using typescript, composition API, and pug templating together in vue3. And the concern is how to import a component using composition API and use that in pug template?

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

0

I'm pretty sure the issue comes from preinstalling typescript. Removing typescript as the script language should do the trick then:

<script setup>

instead of

<script setup lang="ts">

If you don't want to remove it then try to figure out how typescript-components need to look different from plain js ones. Sorry I don't know much about Typescript, all I know is that it changes how the components work because they rely more on Typescript now instead of javascript. But I would guess that there's information on the vue 3 documentation about working with typescript.

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!