The self-encapsulated module can only use the commonjs method and cannot write the es method, otherwise an error will occur. The reasons are as follows. I have enabled the modle mode in package.json and I do not have noop.js locally. The current es method does not seem to be able to use require in the module. () of ES Module /storage/emulated/0/Android/data/com.test/files/debug/node_modules/core/index.js from /storage/emulated/0/Android/data/coco.magichands/files/debug /noop.js not supported.
index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
The self-encapsulated module can only use the commonjs method and cannot write the es method, otherwise an error will occur. The reasons are as follows. I have enabled the modle mode in package.json and I do not have noop.js locally. The current es method does not seem to be able to use require in the module. () of ES Module /storage/emulated/0/Android/data/com.test/files/debug/node_modules/core/index.js from /storage/emulated/0/Android/data/coco.magichands/files/debug /noop.js not supported. index.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.