Conversation
98c39e5 to
c18217c
Compare
c18217c to
d458cb1
Compare
d458cb1 to
18930a0
Compare
fokkedekker
reviewed
Jun 24, 2024
| @@ -1,4 +1,4 @@ | |||
| import bindings from "bindings"; | |||
| const bindings = require("bindings"); | |||
There was a problem hiding this comment.
Isn't this the wrong way around? I keep getting that error and fixed it by changing it back to import bindings from "bindings";
Member
Author
There was a problem hiding this comment.
You're right, sorry! This PR was originally to fix the fact that the code was improperly using 'import' when it should have been using 'require'. Then we decided to move the whole thing to ESM and I forgot to revert that file.
There was a problem hiding this comment.
No worries! Glad it works now. Thanks for maintaining this repo.
This was referenced Jun 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EDIT: This PR now converts the entire project to ESM. I have tested npm install and it seems to be working for me on Linux. A quick scan of the build scripts doesn't reveal any imported calls that are made in only one branch, so I think it's safe.
Original PR message below.
Trying to import
@openzim/libzimintomwoffliner.It was building fine but I was getting this error when trying to run the JS:
When I tried a
test.tswith the following:I got:
Which led me to believe that upstream (this package) had the error.
As far as I understand, the
importkeyword can only be used in ESM and Typescript, so this does appear to be a bug.