cocos / cocos-engine

Cocos simplifies game creation and distribution with Cocos Creator, a free, open-source, cross-platform game engine. Empowering millions of developers to create high-performance, engaging 2D/3D games and instant web entertainment.
https://www.cocos.com/en/creator
Other
5.49k stars 1.58k forks source link

When reporting "cannot import from directory", the relevant script path is not printed directly. #17217

Open smallmain opened 4 days ago

smallmain commented 4 days ago

Cocos Creator version

3.8.2

System information

MacOS

Issue description

RT.

For all script system errors, especially import errors, can the relevant script path be returned? Otherwise, it is very difficult to find the script where the error occurred, especially if the editor code is not open source and there is no way to break the point.

eg:

has-error.ts:

import { a } from ".. /extensions/xxx/dir";

error:

xxx error, file: assets/has-error.ts

If the script does not have a real path, you should return to the path of the temporary product in the library or print the script content directly, so that you can better find the original path.

Relevant error log output

No response

Steps to reproduce

.

Minimal reproduction project

No response