Unexpected import statement in CJS module

在项目中加入了npm install jssm,然后就报了这个错,到底是个什么鬼啊

[Scene] Error: Error: Unexpected import statement in CJS module.

at @:2:8

at Object.execute (file:///D:/wza/project/GameHomeCocos/temp/programming/packer-driver/targets/editor/chunks/d9/data:text/javascript,%0A%2F%2F%20This%20module%20is%20auto-generated%20to%20report%20error%20emitted%20when%20try%20to%20load%20module%20file%3A%2F%2F%2FD%3A%2Fwza%2Fproject%2FGameHomeCocos%2Fnode_modules%2Fjssm%2Fdist%2Fes6%2Fjssm.js%20at%20runtime.%0Athrow%20new%20Error(%60Error%3A%20Unexpected%20import%20statement%20in%20CJS%20module.%0A%20%20at%20%40%3A2%3A8%60)%3B%0A%20%20%20%20%20%20%20%20:3:7)

at doExec (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:517:30)

at postOrderExec (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:508:21)

at D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:493:28

at Array.forEach ()

at postOrderExec (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:491:10)

at D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:493:28

at Array.forEach ()

at postOrderExec (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:491:10)

at D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:440:12

Error: [Scene] Error: Error: Unexpected import statement in CJS module.
at postOrderExec (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:508:21)

at D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:493:28

at Array.forEach ()

at postOrderExec (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:491:10)

at D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:493:28

at Array.forEach ()

at postOrderExec (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:491:10)

at D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:440:12

at Logger._logHandler (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\builtin\scene\dist\script\3d\manager\startup\log.ccc:1:318)

at Logger.record (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@base\electron-logger\lib\renderer.ccc:1:458)

at console.error (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@base\electron-logger\lib\renderer.ccc:1:1414)

at ScriptManager._handleImportException (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\builtin\scene\dist\script\3d\manager\scripts.ccc:1:5825)

at Executor.importExceptionHandler [as _importExceptionHandler] (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\builtin\scene\dist\script\3d\manager\scripts.ccc:1:3509)

at Executor._onModuleLoaded (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\src\executor\index.ts:312:22)

at SystemJS.onload (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\src\executor\index.ts:73:18)

at triggerOnload (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:270:10)

at doExec (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:538:7)

at postOrderExec (D:\CocosDashboard_1.2.2\resources.editors\Creator\3.6.0\resources\app.asar\node_modules@editor\lib-programming\static\executor\systemjs-bridge\out\index.js:508:21)

有没有官方的人员帮忙看看啊,在2.4.x使用正常,到3.6.0就报个奇葩的错误

类似的错误, 我也在等待解决方案 :sweat_smile:
是不是类加载的时候出现死循环递归函数呀

类似的错误

package.json 中添加属性 "type": "module"