Skip to main content

PKU247: Invalid Tags Type

Error Message

[PKU247] [WiringType] '[name]' has invalid 'tags' property - must be an array of strings.

What Went Wrong

The tags property must be an array of strings, but you provided a different type (such as a string, number, or object).

How to Fix

Ensure tags is an array of strings:

Correct Usage

import { wireHTTP } from '@pikku/core/http'
import { pikkuFunc } from '#pikku'

wireHTTP({
method: 'post',
route: '/api/users',
tags: ['users', 'api'], // ✅ Array of strings
func: pikkuFunc(async () => {
// your logic
}),
})

Common Mistakes

// ❌ Wrong: Single string instead of array
wireHTTP({
method: 'post',
route: '/api/users',
tags: 'users', // Wrong!
func: myFunc,
})

// ❌ Wrong: Array with non-string values
wireHTTP({
method: 'post',
route: '/api/users',
tags: ['users', 123, true], // Wrong!
func: myFunc,
})

// ✅ Correct: Array of strings
wireHTTP({
method: 'post',
route: '/api/users',
tags: ['users', 'api', 'v1'], // Correct!
func: myFunc,
})

Why Tags Matter

Tags are used for:

  • Grouping related endpoints
  • Applying middleware to groups of routes
  • Applying permissions to tagged endpoints
  • Organizing API documentation