Files
payload-billing/src/plugin/utils.ts
Bas van den Aakster d5a47a05b1 fix: resolve module import issues for Next.js/Turbopack compatibility
- Remove .js extensions from all TypeScript imports throughout codebase
- Update dev config to use testProvider instead of mollieProvider for testing
- Fix module resolution issues preventing development server startup
- Enable proper testing of billing plugin functionality with test provider

This resolves the "Module not found: Can't resolve" errors that were
preventing the development server from starting with Next.js/Turbopack.
All TypeScript imports now use extension-less imports as required.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-19 12:12:39 +02:00

16 lines
555 B
TypeScript

import type { CollectionConfig, CollectionSlug, Field } from 'payload'
import type { Id } from './types/index'
export type FieldsOverride = (args: { defaultFields: Field[] }) => Field[]
export const extractSlug =
(arg: string | Partial<CollectionConfig>) => (typeof arg === 'string' ? arg : arg.slug!) as CollectionSlug
/**
* Safely cast ID types for PayloadCMS operations
* This utility provides a typed way to handle the mismatch between our Id type and PayloadCMS expectations
*/
export function toPayloadId(id: Id): any {
return id as any
}