Closed sonygod closed 3 years ago
This is an issue in the externs themselves and I get the same error when I use them: if I make a new file named test.ts
that includes the wechat type definitions:
/// <reference types="wechat-miniprogram" />
And then do tsc test.ts
, I get
../../.npm-global/lib/node_modules/typescript/lib/lib.dom.d.ts:18958:13 - error TS2451: Cannot redeclare block-scoped variable 'console'.
18958 declare var console: Console;
~~~~~~~
node_modules/@types/wechat-miniprogram/lib.wx.api.d.ts:18650:15
18650 declare const console: WechatMiniprogram.Console
~~~~~~~
'console' was also declared here.
node_modules/@types/wechat-miniprogram/lib.wx.api.d.ts:18650:15 - error TS2451: Cannot redeclare block-scoped variable 'console'.
18650 declare const console: WechatMiniprogram.Console
~~~~~~~
../../.npm-global/lib/node_modules/typescript/lib/lib.dom.d.ts:18958:13
18958 declare var console: Console;
~~~~~~~
'console' was also declared here.
The good news is the conversion still works just fine and this is more of a warning from the typescript compiler. Nevertheless, if there are special ts config options that will resolve these error messages you can pass them in using --tsconfig
hi,@haxiomic ,this is only for auto-complete only, you can't run without a Wechat app environment.:)
The error I posted is a ts compiler-time/autocomplete error (haven’t tested runtime)
My screenshot show ide auto complete everything is OK use that file
On Fri, 8 Jan 2021, 21:25 George Corney, notifications@github.com wrote:
The error I posted is a ts compiler-time/autocomplete error (haven’t tested runtime)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/haxiomic/dts2hx/issues/80#issuecomment-756754186, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFWWIAFAYCSXFQ3X22H433SY4BTVANCNFSM4VYRY73Q .
dts2hx@0.15.3