Skip to content

[Bug]: Tried replacing reference to class Spatie\LaravelData\Optional error #140

@khalidmaquilang

Description

@khalidmaquilang

What happened?

#[TypeScript]
class MonthlyRankedRecordData extends Data
{
    public function __construct(
        public string $id,
        public UserData|Optional $user,
        public int $year,
        public int $month,
        public int $rank_points,
        public RankTitleData|Optional $rankTitle,
    ) {}
}

Tried replacing reference to class Spatie\LaravelData\Optionalinclass App\Features\MonthlyRankedRecord\Data\MonthlyRankedRecordData but it was not found in the transformed types

Even adding #[TypeScriptOptional] doesn't work

How to reproduce the bug

Add Optional on your DTO

Package Version

3.0.3

PHP Version

8.4

Which operating systems does with happen with?

Windows

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions