nerd
nerd copied to clipboard
Cannot require any modules
OS: Ubuntu 19.10 x86_64 Kernel: 5.3.0-53-generic NectarJS v0.6.1
I cannot compile my project because of "require error"s. It happens for every module I require in my script.
nectar ./index.js --verbose [*] Generating source file [!] Require error : fs
If I remove fs, it gives me something else (the next module).
Am I missing something ?
Hi @Teln0 ,
there is no fs module for the moment, there is an fs-std module with simple functions (readFileSync, writeFileSync ...)
We will add support for the standard node ecosystem soon
what about other modules like http ?
@Teln0 it is the same, i'm finishing the base of NectarJS, then, we will be able to add any module and platforms (libuv, node modules ...)
@Teln0 I started the njs-http module, you can check the http.js example
@Teln0 it is the same, i'm finishing the base of NectarJS, then, we will be able to add any module and platforms (libuv, node modules ...)
So basically, you have to port the standard library/base modules and then after that, most/all node modules should work? What kind of timeline are you looking at? I know they're never accurate. Just curious as I'd love to be able to compile a native version of gundb.
So basically, you have to port the standard library/base modules and then after that, most/all node modules should work?
-> basically yes, i just integrated libuv for node env
What kind of timeline are you looking at? I know they're never accurate. Just curious as I'd love to be able to compile a native version of gundb.
-> i think between 3 and 6 months it will be more usable with Node, so a more things will compile
Just found this project, and I think it's fantastic. Really looking forward to using it once it's more stable with Node. A preliminary compilation of console.log('Hello world')
came in at just 176KB vs over 40MB with other projects that bake in the entire nodejs run time, which is amazing!
Hi @josephschmitt ,
Thank you very much !
Arduino examples fits on Arduino nano with less than 10ko of rom, where NodeJS (or any other vm) will never fits
It would be nice actually to have a list of features supported and what is on road map, instead of keeping developers hitting the wall with all kinds of strange issues.
[*] Generating source file
[!] Warning : index file of module escape-string-regexp seems empty
/usr/local/Cellar/node/14.5.0/lib/node_modules/nectarjs/compiler/native/lib/genRequire.js:208
var _Ext = fileSource.split(".");
^
TypeError: Cannot read property 'split' of undefined
and it dies on just two lines of code:
const chalk = require('chalk');
console.log(chalk.blue('hello'));
Hi @skitsanos ,
Thank you for the feedback,
The full supported modules, right now, are the nectar_modules,
Before supportind nodejs modules, we are finishing to support ES3, after we will focus on the NodeJS env
The error you have right now is because one file of the module seems empty, or there is a bug, i will check it right now
@skitsanos Roadmap and doc are updated