Kode / kmake

Meta build system
Other
12 stars 14 forks source link

Require custom js scripts in kfile.js fails with missing internal module error. #58

Open Paolo-Oliverio opened 1 month ago

Paolo-Oliverio commented 1 month ago

what I tried kfile.js:

let c = require('./test.js');
c();

./test.js

module.exports = function() {
    console.log("test.js module executed");
};

error : TypeError: Missing internal module './test.js' at nativeModuleRequire (node:internal/bootstrap/loaders:340:19)

also tryed to require with absolute path

let path = require('path');
let c = require(path.resolve(__dirname, './test.js'));
c();

same error but with full path.