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

275
Views
Declaring a global property in main file, When used that global property in vue (typescript) template giving syntax error (vscode)

I am using VueJs with typescript & vite. I have an icons file contents are following:

export const ICONS = {
    CLOCK: 'kbtmbyzy',
    CALENDAR: 'gphxrzct',
}

In my main.ts file. I have attached this as a global property, after importing it from the file.

app.config.globalProperties.ICONS = ICONS;

I have component:

<animated-icon :name="ICONS.CLOCK" />

enter image description here

Notice ICONS is highlighted and shows the follow error:

Property 'ICONS' does not exist on type '{ $: ComponentInternalInstance; $data: {}; $props: Partial<{}> & Omit<Readonly<ExtractPropTypes<{}>> & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>; ... 10 more ...; $watch(source: string | Function, cb: Function, options?: WatchOptions<...> | undefined): WatchStopHandle; } & ... 4 more ... & Co...'.ts(2339)

I am using vue3 composition api. It gives the error when I use composition api with setup in script tag: <script setup lang="ts"></script> However it doesn't gives the error when used export default:

export default {
  setup() {}
}
</script>

I want to use first method with setup in the script tag.

about 4 years ago · Juan Pablo Isaza
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!