Dependency resolving problem with compiled byte code
See original GitHub issueHi, I tried the library with an app developed using the Nest.JS framework. Library converted the bundle.js into bytecode and code ran without any errors. NOTE: bundle.js was built following the bellow step 2.
However, I wanted to try with more advanced cases such as connecting to a database.
-
I did setup the application to use
sqlite3
along withTypeORM
. -
Compiled the application into a single bundle using
ncc
library, NTOE:ncc
library also copied thesqlite3
related node native module to the build folder successfully.
Now the library can run as a standalone file and tested and confirmed that I can do CURD operations with the database.
- After the successful test confirm I compiled the bundle.js with the
bytenode
and it could generate a compiled bytecode file.
When I run the code using bytenode ./build/bundle.jsc
it throws the error of not resolving the ORM Repository.
I could not find any resources/ configurations to solve this issue. Please help.
Resources: @nestjs/core: ^8.0.0 sqlite3: ^5.0.2 typeorm: ^0.2.37 @vercel/ncc: ^0.31.1 bytenode: ^1.3.3 typescript: ^4.3.5
Thank you very much
Issue Analytics
- State:
- Created 2 years ago
- Comments:17
Top GitHub Comments
I can reproduce your error now. However, I don’t even know how to approach the problem! There are many parts, each could potentially be the cause, and I have almost no experience with them.
I tried to google the error message. There are many people who had the same error but without bytenode. It was all related to nest configurations.
I believe that the way bytenode is wrapping your code inside this function
(function (exports, require, module, __filename, __dirname) { YOUR_CODE \n});
plays a role. Maybe it causes some implicit globals to be lost. Maybe you should explicitly export what the error message is complaining about.I’m sorry I could not help.
@AwesomeSam9523 Hi, No worries, I will try what you are suggesting here, But it was good to know this as well. Thank you very much for the info anyway. I am trying to run the code in NWJS 😃 Thank you very much once again