-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lmdb webpack issue #241
Comments
Are you using webpack to run this in node or in the browser? lmdb is native binary module, written in C, so it can't run in the browser. If you are trying to run this in node, what is the failure or error? |
2023-06-14 04:35:31.419 [error] TypeError: Cannot read properties of undefined (reading 'Env') let yu = Rl( It's not being run in a browser, though vs code is an electron app. The code is a .NET language server that communicates with the vs code front end. Basically, when webpack packages up the lmdb code from lmdb, it's packaging up the native.js code. I've had to do raw-loaders for other types of files that should just be brought over untouched, and I'm not sure this is one of those. { Thank you, by the way for getting back to me! |
I added you to the repository https://github.com/bobbytreed/test-extension The out directory is there where you can find the native.js call out. Please excuse the hasty coding. I was just trying to throw something together. Thanks! |
@kriszyp Do you think you could look at this issue and provide some feedback? It looks like it might be possible to get the webpack issue resolved, but I think my knowledge of the two code bases is insufficient to resolve on my own. Maybe if you connected with Alexander |
It looks like the current issue is loading the name from the package.json. I am not sure why that wouldn't work in webpack, but this also seems like code that would be branching into modules for different architectures, and I don't know how that would work in webpack (are you creating distinct webpack bundles for each OS/arch?) |
I'm not, no. I'm using lmdb in a vs code extension as a super lightweight database to store auditing/inventory operations against opened repositories. Mainly I just need to package lmdb into the .vsix file. |
Are you only intending this to work on a single specific OS & architecture? Or does your bundling have a way to bundle multiple binaries? |
I don't do anything to bundle it for multiple OS architectures, but I know it is used on multiple OS architectures. VS Code publishing makes that pretty easy from what I've seen. Not much that I have to do different to have my extension work on Mac vs Windows etc. |
Wouldn't bundling be trivial for platform-agnostic code (JavaScript), but different for platform-specific code (C code like LMDB)? |
I understand the logic and it makes sense. I guess that none of the other packages that I've encountered have had a requirement like this. To your point, most have been JavaScript. |
I get same err so error is caused by packageName ,it is undefind @kriszyp |
I have updated the build check to tolerate an undefined/missing package.json. I am not sure if that will actually address the webpack issues. I would also mention that using the |
@kriszyp thanks, its work |
Good Morning/Evening
I'm using lmdb in a vs code extension, and I'm hitting an issue where webpack doesn't package up native.js
So I see this code in the extension.js file:
This fails after being packaged up. I know this might be a webpack issue, but I just figured you might no how to resolve this issue given your familiarity with the lmdb code which is AWESOME.
Sorry for any inconvenience.
Thank you!
The text was updated successfully, but these errors were encountered: