Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get started with wechaty #3

Closed
xuyuji9000 opened this issue Oct 8, 2023 · 2 comments
Closed

Get started with wechaty #3

xuyuji9000 opened this issue Oct 8, 2023 · 2 comments

Comments

@xuyuji9000
Copy link
Owner

Using wechaty/getting-started to get started with Wechaty.

@xuyuji9000
Copy link
Owner Author

xuyuji9000 commented Oct 8, 2023

When run npm start under ./getting-started .

Meeting the following error message

> wechaty-getting-started@1.18.9 start
> cross-env NODE_OPTIONS="--no-warnings --loader=ts-node/esm" node examples/ding-dong-bot.ts

/Users/yogiman/Workspace/Cache/github/wechaty/getting-started/node_modules/ts-node/src/transpilers/swc.ts:262
      throw new Error(
            ^
Error: @swc/core threw an error when attempting to validate swc compiler options.
You may be using an old version of swc which does not support the options used by ts-node.
Try upgrading to the latest version of swc.
Error message from swc:
Failed to deserialize buffer as swc::config::Options
JSON: {"sourceMaps":true,"module":{"noInterop":false,"type":"es6","strictMode":true,"ignoreDynamic":false},"swcrc":false,"jsc":{"parser":{"syntax":"typescript","tsx":false,"decorators":true,"dynamicImport":true,"importAssertions":true},"target":"es2022","transform":{"decoratorMetadata":true,"legacyDecorator":true,"react":{"throwIfNamespace":false,"useBuiltins":false}},"keepClassNames":true,"experimental":{"keepImportAssertions":true}}}

Caused by:
    unknown field `noInterop`, expected `resolveFully` at line 1 column 433
    at createVariant (/Users/yogiman/Workspace/Cache/github/wechaty/getting-started/node_modules/ts-node/src/transpilers/swc.ts:262:13)
    at createSwcOptions (/Users/yogiman/Workspace/Cache/github/wechaty/getting-started/node_modules/ts-node/src/transpilers/swc.ts:211:25)
    at create (/Users/yogiman/Workspace/Cache/github/wechaty/getting-started/node_modules/ts-node/src/transpilers/swc.ts:56:41)
    at createTranspiler (/Users/yogiman/Workspace/Cache/github/wechaty/getting-started/node_modules/ts-node/src/index.ts:784:16)
    at createTranspileOnlyGetOutputFunction (/Users/yogiman/Workspace/Cache/github/wechaty/getting-started/node_modules/ts-node/src/index.ts:1341:28)
    at createFromPreloadedConfig (/Users/yogiman/Workspace/Cache/github/wechaty/getting-started/node_modules/ts-node/src/index.ts:1411:33)
    at create (/Users/yogiman/Workspace/Cache/github/wechaty/getting-started/node_modules/ts-node/src/index.ts:624:10)
    at register (/Users/yogiman/Workspace/Cache/github/wechaty/getting-started/node_modules/ts-node/src/index.ts:591:15)
    at Object.registerAndCreateEsmHooks (/Users/yogiman/Workspace/Cache/github/wechaty/getting-started/node_modules/ts-node/src/esm.ts:116:34)
    at file:///Users/yogiman/Workspace/Cache/github/wechaty/getting-started/node_modules/ts-node/esm.mjs:8:7

And a monkey patch was suggested.
TypeStrong/ts-node#2070 (comment)

And an already merged PR fix ( TypeStrong/ts-node#2062 ) was mentioned
TypeStrong/ts-node#2070 (comment)

@xuyuji9000
Copy link
Owner Author

de5eb64

Was able to do a simple ding dong feature with wechaty.

Moving this ticket to done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant