I get an error when building with a project that uses PixiJS version 6.5.5

Hello. I am having trouble resolving a build error.

The error message is as follows

Assets] [build-script]Error: ‘parse’ is not exported by file:////node_modules/url/url.mjs?cjs=&original=.js, imported by file :////node_modules/@pixi/utils/dist/esm/utils.mjs
[Assets] excute-taskbuild-script failed!

This error occurs only in the build.
The preview in the editor works fine with no errors.

I installed PixiJS using npm.

Probably, PixiJS assumes TypeScript 5.0, while CocosCreator’s TypeScript is 4.1, so the error may be caused by not finding the necessary libraries.

Would it be possible to have Cocos’ TypeScript support be 5.0 or higher?

1 Like

For the time being, we have responded by lowering the PixiJS version to 6.3.2.

TypeScript upgrade often cause some issues in the engine build. We are not using tsc to compile, we are using browserify and rollup instead, so we must be very cautious to upgrade TS version, if there is no good reason, we tend to not do that

1 Like