Redis没有在nextjs中使用XState

Redis没有在nextjs中使用XState,redis,xstate,Redis,Xstate,我是新来的。所以我试图在redis中缓存我的authData。但我有一些错误。这是我的机器 export const authMachine = createMachine<authMachine>({ // blah blah blah }); 这也不行。 顺便说一句,我正在控制台上记录getRedisData()的值。它得到了我需要的价值。但它无法分配它。我不知道为什么。 这就是错误: Error: connect ECONNREFUSED 127.0.0.1:80

我是新来的。所以我试图在redis中缓存我的authData。但我有一些错误。这是我的机器

export const authMachine = createMachine<authMachine>({
    // blah blah blah
});
这也不行。 顺便说一句,我正在控制台上记录getRedisData()的值。它得到了我需要的价值。但它无法分配它。我不知道为什么。 这就是错误:

Error: connect ECONNREFUSED 127.0.0.1:80
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1128:16)

有人能帮我吗?

这对吗?:
export const authMachine=authMachine()?authMachine:…
是否正确?:
导出常量authMachine=authMachine()?authMachine:…
const data: any = getRedisData();
const [current, send] = useMachine(authMachine, {
    state: data;
});
Error: connect ECONNREFUSED 127.0.0.1:80
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1128:16)