Skip to content
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

Need help with the error #5

Open
lnguyen4 opened this issue Oct 26, 2024 · 2 comments
Open

Need help with the error #5

lnguyen4 opened this issue Oct 26, 2024 · 2 comments

Comments

@lnguyen4
Copy link

lnguyen4 commented Oct 26, 2024

Hi ,
Thank you for creating this package and I have been using it successfully to work with bibtex entry and editing for my personal paper collection on emacs.

Until today, I got this error when emacs tried to pull the entry for an Arxiv item. I believe it is something with node. I included the picture of the debug on emacs.
I am using endeavourOS ( an archlinux based OS) and usually i started the selfhost local sever by using the command

pm2 start index.js

Then I would proceed like normal on emacs with zotra.

Please guide me to ways to fix this

Thank you
emacs_zotra

EDIT: i looked around and was able to fix it.

Utils.IsRegExp and Utils.IsDate are deprecated API so change the code in the config.js respectively

parent instanceof RegExp

parent instanceof Date

@renbus
Copy link

renbus commented Nov 20, 2024

I just installed zotra-server and I got the same error. The tip from lnguyen4 seems to work (thanks a lot!).

At first, it wasn't very clear to me what I had to do exactly, in the end I got it to work by replacing, in the .../zotra-server/node-modules/config/lib/config.js file, the line 1217, } else if (Utils.isRegExp(parent)) {, by:

} else if (parent instanceof RegExp) {

And the line 1220, } else if (Utils.isDate(parent)) {, by:

} else if (parent instanceof Date) {

@mpedramfar
Copy link
Owner

It seems like the issue is from using deprecated node functions in the upstream repository.
Specifically, the functions you mentioned are deprecated in node 23:
https://nodejs.org/api/deprecations.html#DEP0055

The fact is that these functions are not used in this repo. Zotra server is a very thin wrapper around the Zotero translation server and these issues should be resolved there: zotero/translation-server#176

The easiest solution for now is to use node version <= 22, or alternatively use the fix suggested by @lnguyen4.
I'll keep this issue open so other users who get this error could see it.

@mpedramfar mpedramfar pinned this issue Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants