Skip to content

vue项目, vite打包报错 #25

Description

@huihui14569

报错信息如下
`$ vue-tsc --noEmit && vite build --config ./config/vite.config.prod.ts
node_modules/date-utils-2020/src/index.ts:91:5 - error TS2322: Type 'T & Date' is not assignable to type 'null'.

91 result = input
~~~~~~

node_modules/date-utils-2020/src/index.ts:97:5 - error TS2322: Type 'Date' is not assignable to type 'null'.

97 result = new Date(input)
~~~~~~

node_modules/date-utils-2020/src/index.ts:107:9 - error TS2322: Type 'Date' is not assignable to type 'null'.

107 result = new Date([str.substring(0, 4), str.substring(4, 6), str.substring(6, 8)].join('/'))
~~~~~~

node_modules/date-utils-2020/src/index.ts:111:9 - error TS2322: Type 'Date' is not assignable to type 'null'.

111 result = new Date([str.substring(0, 4), str.substring(4, 6), '01'].join('/'))
~~~~~~

node_modules/date-utils-2020/src/index.ts:115:9 - error TS2322: Type 'Date' is not assignable to type 'null'.

115 result = new Date(str + '/01/01')
~~~~~~

node_modules/date-utils-2020/src/index.ts:120:9 - error TS2322: Type 'Date' is not assignable to type 'null'.

120 result = new Date(parseInt(input))
~~~~~~

node_modules/date-utils-2020/src/index.ts:136:9 - error TS2322: Type 'Date' is not assignable to type 'null'.

136 result = new Date([RegExp.$1, RegExp.$2, RegExp.$3].join('/'))
~~~~~~

node_modules/date-utils-2020/src/index.ts:140:9 - error TS2322: Type 'Date' is not assignable to type 'null'.

140 result = new Date([RegExp.$1, RegExp.$2, '01'].join('/'))
~~~~~~

node_modules/date-utils-2020/src/index.ts:142:9 - error TS2322: Type 'Date' is not assignable to type 'null'.

142 result = new Date(str)
~~~~~~

node_modules/date-utils-2020/src/index.ts:146:34 - error TS2339: Property 'getFullYear' does not exist on type 'never'.

146 return result && !isNaN(result.getFullYear()) ? result : null
~~~~~~~~~~~

node_modules/zx-sml/libs/utils/src/dom.ts:69:22 - error TS2488: Type 'NodeListOf' must have a 'Symbol.iterator' method that returns an iterator.

69 el.append(...temp.childNodes)
~~~~~~~~~~~~~~~

Found 11 errors in 2 files.

Errors Files
10 node_modules/date-utils-2020/src/index.ts:91
1 node_modules/zx-sml/libs/utils/src/dom.ts:69
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions