diff --git a/packages/apify/src/actor.ts b/packages/apify/src/actor.ts index bd4363b863..870a5977eb 100644 --- a/packages/apify/src/actor.ts +++ b/packages/apify/src/actor.ts @@ -534,6 +534,9 @@ export class Actor { options.exit ??= true; options.exitCode ??= EXIT_CODES.SUCCESS; options.timeoutSecs ??= 30; + + this._ensureActorInit('exit'); + const client = this.config.getStorageClient(); const events = this.config.getEventManager(); @@ -807,6 +810,8 @@ export class Actor { * @ignore */ async reboot(options: RebootOptions = {}): Promise { + this._ensureActorInit('reboot'); + if (!this.isAtHome()) { log.warning( 'Actor.reboot() is only supported when running on the Apify platform.', @@ -916,6 +921,8 @@ export class Actor { ow(statusMessage, ow.string); ow(isStatusMessageTerminal, ow.optional.boolean); + this._ensureActorInit('setStatusMessage'); + const loggedStatusMessage = `[Status message]: ${statusMessage}`; switch (level) { @@ -1523,6 +1530,8 @@ export class Actor { defaultValue = {} as State, options?: UseStateOptions, ) { + this._ensureActorInit('useState'); + const kvStore = await KeyValueStore.open(options?.keyValueStoreName, { config: options?.config || Configuration.getGlobalConfig(), });