⼩程序typescript模板编译出现错误解决⽅法
更新最新版的开发⼯具,重新新建模板
简单分析
旧版本的typescript模板会缺少⼀些⽂件,导致TS编译的时候缺少⽂件
出错问题
miniprogram/app.ts:8:5 - error TS2558: Expected 0 type arguments, but got 1.
8 App<IMyApp>({
~~~~~~
miniprogram/typings/wx.d.ts:119:12 - error TS7006: Parameter 'a' implicitly has an 'any' type.
119 matrix(a, b, c, d, tx, ty): IAnimation;
~
miniprogram/typings/wx.d.ts:119:15 - error TS7006: Parameter 'b' implicitly has an 'any' type.
119 matrix(a, b, c, d, tx, ty): IAnimation;
~
miniprogram/typings/wx.d.ts:119:18 - error TS7006: Parameter 'c' implicitly has an 'any' type.
119 matrix(a, b, c, d, tx, ty): IAnimation;
~
miniprogram/typings/wx.d.ts:119:21 - error TS7006: Parameter 'd' implicitly has an 'any' type.
119 matrix(a, b, c, d, tx, ty): IAnimation;
~
miniprogram/typings/wx.d.ts:119:24 - error TS7006: Parameter 'tx' implicitly has an 'any' type.
119 matrix(a, b, c, d, tx, ty): IAnimation;
~
~
miniprogram/typings/wx.d.ts:119:28 - error TS7006: Parameter 'ty' implicitly has an 'any' type.
119 matrix(a, b, c, d, tx, ty): IAnimation;
~~
miniprogram/typings/wx.d.ts:343:13 - error TS2451: Cannot redeclare block-scoped variable 'App'.
343 declare var App: AppConstructor;
四六级官网准考证打印入口官网~~~
typings/wx/lib.wx.app.d.ts:11:19
11 declare namespace App {
~~~
'App' was also declared here.
高中英语学习方法
typings/wx/lib.wx.app.d.ts:248:15
248 declare const App: App.AppConstructor
~~~
and here.
~~~~~~
typings/wx/lib.wx.app.d.ts:249:15
249 declare const getApp: App.GetApp
~~~~~~
'getApp' was also declared here.
miniprogram/typings/wx.d.ts:346:18 - error TS2451: Cannot redeclare block-scoped variable 'getCurrentPages'.
346 declare function getCurrentPages(): Page[];
~~~~~~~~~~~~~~~
typings/wx/lib.wx.page.d.ts:181:15
181 declare const getCurrentPages: Page.GetCurrentPages
~~~~~~~~~~~~~~~
'getCurrentPages' was also declared here.
miniprogram/typings/wx.d.ts:348:11 - error TS2451: Cannot redeclare block-scoped variable 'Page'.
348 interface Page {statement是什么意思
~~~~
typings/wx/lib.wx.page.d.ts:11:19
11 declare namespace Page {
~~~~
'Page' was also declared here.
typings/wx/lib.wx.page.d.ts:180:15
180 declare const Page: Page.PageConstructor
~~~~
and here.
miniprogram/typings/wx.d.ts:409:13 - error TS2451: Cannot redeclare block-scoped variable 'Page'.
409 declare var Page: PageConstructor;
~~~~
typings/wx/lib.wx.page.d.ts:11:19
11 declare namespace Page {
~~~~
'Page' was also declared here.
typings/wx/lib.wx.page.d.ts:180:15
180 declare const Page: Page.PageConstructor
~~~~
and here.
miniprogram/typings/wx.d.ts:411:13 - error TS2451: Cannot redeclare block-scoped variable 'wx'.
411 declare var wx: {
~~
typings/wx/lib.wx.api.d.ts:11:19
11 declare namespace wx {
~~
'wx' was also declared here.
typings/wx/lib.wx.api.d.ts:12756:15
12756 declare const wx: wx.Wx;
lie to me 第一季~~
and here.
typings/wx/lib.wx.api.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'wx'.
typings/wx/lib.wx.api.d.ts:12756:15 - error TS2451: Cannot redeclare block-scoped variable 'wx'.
12756 declare const wx: wx.Wx;
~~
miniprogram/typings/wx.d.ts:411:13
411 declare var wx: {
~
~
'wx' was also declared here.
typings/wx/lib.wx.api.d.ts:12756:22 - error TS2694: Namespace 'wx' has no exported member 'Wx'.
12756 declare const wx: wx.Wx;
~~
typings/wx/lib.wx.app.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'App'.
11 declare namespace App {
~~~
miniprogram/typings/wx.d.ts:343:13
343 declare var App: AppConstructor;
~~~
'App' was also declared here.
typings/wx/lib.wx.app.d.ts:248:15 - error TS2451: Cannot redeclare block-scoped variable 'App'.
248 declare const App: App.AppConstructor
~~~
miniprogram/typings/wx.d.ts:343:13
343 declare var App: AppConstructor;
~~~
'App' was also declared here.
typings/wx/lib.wx.app.d.ts:248:20 - error TS2503: Cannot find namespace 'App'.
248 declare const App: App.AppConstructor
~~~
typings/wx/lib.wx.app.d.ts:249:15 - error TS2451: Cannot redeclare block-scoped variable 'getApp'.
249 declare const getApp: App.GetApp
~~~~~~
miniprogram/typings/wx.d.ts:344:18
344 declare function getApp(): Application;
~~~~~~
'getApp' was also declared here.
typings/wx/lib.wx.app.d.ts:249:23 - error TS2503: Cannot find namespace 'App'.
249 declare const getApp: App.GetApp
~~~
typings/wx/lib.wx.page.d.ts:11:19 - error TS2451: Cannot redeclare block-scoped variable 'Page'.
miniprogram/typings/wx.d.ts:409:13
409 declare var Page: PageConstructor;
~~~~
and here.
typings/wx/lib.wx.page.d.ts:180:15 - error TS2451: Cannot redeclare block-scoped variable 'Page'.
皮肤美白的方法180 declare const Page: Page.PageConstructor
~~~~
miniprogram/typings/wx.d.ts:348:11
348 interface Page {
~~~~
'Page' was also declared here.
六年级下册英语期中试卷
miniprogram/typings/wx.d.ts:409:13
409 declare var Page: PageConstructor;
~~~~
and here.
typings/wx/lib.wx.page.d.ts:180:21 - error TS2702: 'Page' only refers to a type, but is being ud as a namespace here.
180 declare const Page: Page.PageConstructor
~~~~
typings/wx/lib.wx.page.d.ts:181:15 - error TS2451: Cannot redeclare block-scoped variable 'getCurrentPages'.
181 declare const getCurrentPages: Page.GetCurrentPages
~~~~~~~~~~~~~~~
miniprogram/typings/wx.d.ts:346:18
346 declare function getCurrentPages(): Page[];
~~~~~~~~~~~~~~~
'getCurrentPages' was also declared here.
sophie moon
typings/wx/lib.wx.page.d.ts:181:32 - error TS2702: 'Page' only refers to a type, but is being ud as a namespace here.
181 declare const getCurrentPages: Page.GetCurrentPages
elan
~~~~
Found 26 errors.
F:\html\es6>node ./node_modules/typescript/lib/tsc.js
miniprogram/typings/wx.d.ts:119:12 - error TS7006: Parameter 'a' implicitly has an 'any' type.
四级高频词组119 matrix(a, b, c, d, tx, ty): IAnimation;
~
miniprogram/typings/wx.d.ts:119:15 - error TS7006: Parameter 'b' implicitly has an 'any' type.
119 matrix(a, b, c, d, tx, ty): IAnimation;
~
miniprogram/typings/wx.d.ts:119:18 - error TS7006: Parameter 'c' implicitly has an 'any' type.
119 matrix(a, b, c, d, tx, ty): IAnimation;
~
~
miniprogram/typings/wx.d.ts:119:24 - error TS7006: Parameter 'tx' implicitly has an 'any' type.
119 matrix(a, b, c, d, tx, ty): IAnimation;
~~
miniprogram/typings/wx.d.ts:119:28 - error TS7006: Parameter 'ty' implicitly has an 'any' type.
119 matrix(a, b, c, d, tx, ty): IAnimation;
~~
miniprogram/typings/wx.d.ts:343:13 - error TS2451: Cannot redeclare block-scoped variable 'App'.
343 declare var App: AppConstructor;
~~~
typings/wx/lib.wx.app.d.ts:11:19
11 declare namespace App {
~~~
'App' was also declared here.
typings/wx/lib.wx.app.d.ts:248:15
248 declare const App: App.AppConstructoronce的用法
~~~
and here.
miniprogram/typings/wx.d.ts:344:18 - error TS2451: Cannot redeclare block-scoped variable 'getApp'.
344 declare function getApp(): Application;
~~~~~~
typings/wx/lib.wx.app.d.ts:249:15
249 declare const getApp: App.GetApp
~~~~~~
'getApp' was also declared here.
miniprogram/typings/wx.d.ts:346:18 - error TS2451: Cannot redeclare block-scoped variable 'getCurrentPages'.
346 declare function getCurrentPages(): Page[];
~~~~~~~~~~~~~~~
typings/wx/lib.wx.page.d.ts:181:15
181 declare const getCurrentPages: Page.GetCurrentPages
~~~~~~~~~~~~~~~
'getCurrentPages' was also declared here.
miniprogram/typings/wx.d.ts:348:11 - error TS2451: Cannot redeclare block-scoped variable 'Page'.
348 interface Page {
~~~~
typings/wx/lib.wx.page.d.ts:11:19
11 declare namespace Page {
~~~~
'Page' was also declared here.
typings/wx/lib.wx.page.d.ts:180:15
180 declare const Page: Page.PageConstructor
~~~~
and here.
miniprogram/typings/wx.d.ts:409:13 - error TS2451: Cannot redeclare block-scoped variable 'Page'.