toeverything / AFFiNE

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
https://affine.pro
Other
41.87k stars 2.73k forks source link

​Issue with Node backend startup: TypeError: Symbol.asyncDispose is not defined on Windows 10 with Node 20.x #7186

Closed 839900146 closed 4 months ago

839900146 commented 4 months ago

What happened?

Hello there,

I'm encountering an issue upon attempting to start the node backend after cloning this repository. Specifically, I'm met with the error message: Notably, I haven't made any modifications to the project files. My setup includes Windows 10 as the operating system, Node version 20.x, Yarn at version 4.2.2, and Rust is up-to-date with the latest release. I'm unsure about how to proceed in resolving this problem and would greatly appreciate guidance.TypeError: Symbol.asyncDispose is not defined.

Distribution version

Windows x64

What browsers are you seeing the problem on if you're using web version?

Chrome

Are you self-hosting?

Relevant log output

PS F:\affine> node -v 
v18.16.1
PS F:\affine> yarn -v
4.2.2
PS F:\affine> node -v
v18.16.1
PS F:\affine> yarn -v
4.2.2
PS F:\affine> rustc --version
rustc 1.78.0 (9b00956e5 2024-04-29)
PS F:\affine> cargo --version
cargo 1.78.0 (54d8815d0 2024-03-26)
PS F:\affine> yarn workspace @affine/server dev
[nodemon] 3.1.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: ts,json
[nodemon] starting `node --loader ts-node/esm.mjs --es-module-specifier-resolution=node ./src/index.ts`
(node:20216) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:20216) ExperimentalWarning: The Node.js specifier resolution flag is experimental. It could change or be removed at any time.
(node:20216) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.
(node:20216) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
[Nest] 20216  - 2024/06/10 01:30:46    WARN [MailerModule] MailerModule is not enabled because of the required configuration is not satisfied.
[Nest] 20216  - 2024/06/10 01:30:46    WARN [MailerModule] Unsatisfied configuration:
[Nest] 20216  - 2024/06/10 01:30:46    WARN [MailerModule]   AFFiNE.mailer.host
[Nest] 20216  - 2024/06/10 01:30:46    WARN [RedisModule] RedisModule is not enabled because of the required configuration is not satisfied.
[Nest] 20216  - 2024/06/10 01:30:46    WARN [RedisModule] Unsatisfied configuration:
[Nest] 20216  - 2024/06/10 01:30:46    WARN [RedisModule]   AFFiNE.plugins.redis.host
[Nest] 20216  - 2024/06/10 01:30:46     LOG [NestFactory] Starting Nest application... +127ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] PrismaModule dependencies initialized +53ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] WebSocketModule dependencies initialized +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] SyncModule dependencies initialized +0ms     
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] GqlModule dependencies initialized +0ms      
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] CacheModule dependencies initialized +7ms    
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] DiscoveryModule dependencies initialized +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] ConfigModule dependencies initialized +2ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] EventModule dependencies initialized +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] MutexModule dependencies initialized +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] MetricsModule dependencies initialized +0ms        
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] StorageProviderModule dependencies initialized +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] HelpersModule dependencies initialized +0ms        
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] EventEmitterModule dependencies initialized +1ms   
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] ScheduleModule dependencies initialized +0ms       
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] MailModule dependencies initialized +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] StorageModule dependencies initialized +0ms        
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] AppModule dependencies initialized +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] ServerConfigModule dependencies initialized +0ms   
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] ThrottlerModule dependencies initialized +0ms      
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] RateLimiterModule dependencies initialized +1ms    
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] GraphQLSchemaBuilderModule dependencies initialized +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] QuotaModule dependencies initialized +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] FeatureModule dependencies initialized +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] EventsModule dependencies initialized +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] DocModule dependencies initialized +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] UserModule dependencies initialized +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] OAuthModule dependencies initialized +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] PaymentModule dependencies initialized +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] GraphQLModule dependencies initialized +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] AuthModule dependencies initialized +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [InstanceLoader] WorkspaceModule dependencies initialized +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [WebSocketsController] EventsGateway subscribed to the "client-handshake-sync" message +15ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [WebSocketsController] EventsGateway subscribed to the "client-handshake-awareness" message +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [WebSocketsController] EventsGateway subscribed to the "client-leave-sync" message +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [WebSocketsController] EventsGateway subscribed to the "client-leave-awareness" message +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [WebSocketsController] EventsGateway subscribed to the "client-pre-sync" message +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [WebSocketsController] EventsGateway subscribed to the "client-update-v2" message +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [WebSocketsController] EventsGateway subscribed to the "doc-load-v2" message +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [WebSocketsController] EventsGateway subscribed to the "awareness-init" message +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [WebSocketsController] EventsGateway subscribed to the "awareness-update" message +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RoutesResolver] AppController {/}: +2ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/, GET} route +2ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RoutesResolver] AuthController {/api/auth}: +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/api/auth/sign-in, POST} route +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/api/auth/sign-out, GET} route +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/api/auth/magic-link, POST} route +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/api/auth/session, GET} route +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/api/auth/sessions, GET} route +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/api/auth/challenge, GET} route +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RoutesResolver] UserAvatarController {/api/avatars}: +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/api/avatars/:id, GET} route +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RoutesResolver] WorkspacesController {/api/workspaces}: +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/api/workspaces/:id/blobs/:name, GET} route +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/api/workspaces/:id/docs/:guid, GET} route +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/api/workspaces/:id/docs/:guid/histories/:timestamp, GET} route +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RoutesResolver] StripeWebhook {/api/stripe}: +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/api/stripe/webhook, POST} route +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RoutesResolver] OAuthController {/oauth}: +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/oauth/login, GET} route +0ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [RouterExplorer] Mapped {/oauth/callback, GET} route +1ms
[Nest] 20216  - 2024/06/10 01:30:46     LOG [DocManager] Use Database
[Nest] 20216  - 2024/06/10 01:30:46     LOG [DocManager] Automation started
[Nest] 20216  - 2024/06/10 01:30:46     LOG [GraphQLModule] Mapped {/graphql, POST} route +130ms
[Nest] 20216  - 2024/06/10 01:30:47     LOG [App:RuntimeConfig] Found runtime config changes, upgrading...
file:///F:/affine/packages/backend/server/src/fundamentals/config/runtime/service.ts:18
  key: K,
                                            ^
TypeError: Symbol.asyncDispose is not defined.
    at __addDisposableResource (file:///F:/affine/packages/backend/server/src/fundamentals/config/runtime/service.ts:18:45)
    at Runtime.upgradeDB (file:///F:/affine/packages/backend/server/src/fundamentals/config/runtime/service.ts:215:18)
    at async Runtime.onApplicationBootstrap (file:///F:/affine/packages/backend/server/src/fundamentals/config/runtime/service.ts:56:5)
    at async Promise.all (index 0)
    at async callModuleBootstrapHook (F:\affine\packages\backend\server\node_modules\@nestjs\core\hooks\on-app-bootstrap.hook.js:43:5)
    at async NestApplication.callBootstrapHook (F:\affine\packages\backend\server\node_modules\@nestjs\core\nest-application-context.js:243:13)
    at async NestApplication.init (F:\affine\packages\backend\server\node_modules\@nestjs\core\nest-application.js:102:9)
    at async NestApplication.listen (F:\affine\packages\backend\server\node_modules\@nestjs\core\nest-application.js:169:33)
    at async file:///F:/affine/packages/backend/server/src/index.ts:12:1
[nodemon] app crashed - waiting for file changes before starting...
^C
PS F:\affine>

Anything else?

image

affine-issue-bot[bot] commented 4 months ago

Issue Status: 🆕 *Untriaged

*🆕 Untriaged**

The team has not yet reviewed the issue. We usually do it within one business day. Docs: https://github.com/toeverything/AFFiNE/blob/canary/docs/issue-triaging.md

This is an automatic reply by the bot.

forehalo commented 4 months ago

you are using node v18.x, and Symbol.asyncDispose was added from v20.4.0