從我閱讀的內(nèi)容來(lái)看,導(dǎo)入這兩個(gè)庫(kù)似乎是解決 WebGL 錯(cuò)誤的方法,我遇到了一個(gè)錯(cuò)誤,似乎公認(rèn)的解決方案是這樣導(dǎo)入:import PIXI, { Graphics } from 'pixi.js-legacy';import PIXI from 'pixi.js';但是,這樣做會(huì)導(dǎo)致以下問(wèn)題:/x/y/FILE_PATH: Identifier 'PIXI' has already been declared (2:7)以及重復(fù)的標(biāo)識(shí)符: declare namespace PIXI { ~~~~~~~ node_modules/pixi.js/pixi.js.d.ts:4:1 4 declare namespace PIXI { ~~~~~~~ Conflicts are in this file.node_modules/pixi.js-legacy/pixi.js-legacy.d.ts:14:9 - error TS2323: Cannot redeclare exported variable 'VERSION'.14 var VERSION: string; ~~~~~~~node_modules/pixi.js-legacy/pixi.js-legacy.d.ts:3408:9 - error TS2323: Cannot redeclare exported variable 'defaultVertex'.3408 var defaultVertex: string; ~~~~~~~~~~~~~node_modules/pixi.js-legacy/pixi.js-legacy.d.ts:3414:9 - error TS2323: Cannot redeclare exported variable 'defaultFilterVertex'.3414 var defaultFilterVertex: string; ~~~~~~~~~~~~~~~~~~~node_modules/pixi.js-legacy/pixi.js-legacy.d.ts:11929:9 - error TS2323: Cannot redeclare exported variable 'GRAPHICS_CURVES'.11929 var GRAPHICS_CURVES: { ~~~~~~~~~~~~~~~node_modules/pixi.js-legacy/pixi.js-legacy.d.ts:13426:9 - error TS2323: Cannot redeclare exported variable 'PI_2'.13426 var PI_2: number; ~~~~node_modules/pixi.js-legacy/pixi.js-legacy.d.ts:13434:9 - error TS2323: Cannot redeclare exported variable 'RAD_TO_DEG'.13434 var RAD_TO_DEG: number; ~~~~~~~~~~node_modules/pixi.js-legacy/pixi.js-legacy.d.ts:13442:9 - error TS2323: Cannot redeclare exported variable 'DEG_TO_RAD'.13442 var DEG_TO_RAD: number; ~~~~~~~~~~我是否有任何選項(xiàng)可以在不刪除其中一個(gè)導(dǎo)入的情況下完成這項(xiàng)工作?
有兩個(gè)具有相同標(biāo)識(shí)符的導(dǎo)入打字稿
桃花長(zhǎng)相依
2023-01-06 11:29:27