question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dependency resolving problem with compiled byte code

See original GitHub issue

Hi, 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.

  1. I did setup the application to use sqlite3 along with TypeORM.

  2. Compiled the application into a single bundle using ncc library, NTOE: ncc library also copied the sqlite3 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.

  1. 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:open
  • Created 2 years ago
  • Comments:17

github_iconTop GitHub Comments

2reactions
OsamaAbbascommented, Oct 11, 2021

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.

1reaction
ishanudacommented, Feb 12, 2022

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dependency resolving problem with compiled byte code
Hi, I tried the library with an app developed using the Nest.JS framework. Library converted the bundle.js into bytecode and code ran without...
Read more >
Android: Dex cannot parse version 52 byte code
Error :Error converting bytecode to dex: Cause: Dex cannot parse version 52 byte code. This is caused by library dependencies that have been...
Read more >
Transforming dependency artifacts on resolution
It moves some selected classes of a JAR to a different package, rewriting the byte code of the moved classes and all classes...
Read more >
4. Dependency Management - Gradle Beyond the Basics [Book]
You may have worked with a build that constructed the compile classpath for your compile step by blindly grabbing all the JAR files...
Read more >
Dealing with Java linking problems - Spotify Engineering
Dependency Hell ; Your application is built via Maven, and uses library A and library X. · Boom, NoSuchMethodError! ; Library A is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found