When I only have one machine ts file like below,
// switch.machine.ts
import { Machine } from "@xstate/compiled"
interface Context {}
type Event = { type: "toggle" }
export default Machine<Context, Event, "basicSwitch">({
context: {},
initial: "active",
states: {
active: {
on: {
toggle: {
target: "inactive",
},
},
},
inactive: {
on: {
toggle: {
target: "active",
},
},
},
},
})
using send on react side works as expected. It shows the mismatching event name, and it autocompletes.

However, if I create another machine ts file, then it generates for the new one fine, but then send error message and autocompletion get disappeared.

send signature when works
const send: (event: SingleOrArray<Event<Event>> | SCXML.Event<Event>, payload?: EventData) => State<Context, Event, unknown, {
...;
}>
send signature when doesn't
const send: (event: SCXML.Event<EventObject> | SingleOrArray<Event<EventObject>>, payload?: EventData) => State<Context, EventObject, unknown, {
...;
}>