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

JSDOM dependency is not compatible with node v14 #652

Closed
Hereward opened this issue Aug 10, 2023 · 7 comments · Fixed by #653
Closed

JSDOM dependency is not compatible with node v14 #652

Hereward opened this issue Aug 10, 2023 · 7 comments · Fixed by #653

Comments

@Hereward
Copy link

All versions of metascraper above v5 have a jsdom v22 dependency which is not compatible with Node v14, which is the highest version compatible with MeteorJS.

Is there some way we can install metascraper@5 with a lower version of JSDom?

The latest versions of jsdom require Node.js v16 or newer. (Versions of jsdom below v22 still work with previous Node.js versions, but are unsupported.)

@Kikobeats
Copy link
Member

Hello, consider to use pnpm overrides 🙂

@Hereward
Copy link
Author

Thanks for the feedback, I will try it.

@Hereward
Copy link
Author

pnpm looks like a good solution for local development, but deployment of MeteorJS apps requires a separate build process on the server using 3rd party tools and a docker image. As I understand, it would require a re-write of the "Meteor-up" code and a new docker image. This may be possible but looks like overkill to solve a single small issue.

I would be interested to hear of anyone who has an elegant solution for MeteorJS. Otherwise I'll have to wait until they support Node v16.

@Kikobeats
Copy link
Member

Noted node14 is a non-maintained version at this moment, it's kind of old

CleanShot 2023-08-12 at 09 12 54@2x

@Hereward
Copy link
Author

Thanks for your feedback. I wonder if you could help me with one small thing. I currrently have metascraper running on my server at 5ep.net, running Meteor on Node v14. The metascraper package version is ^5.29.8.

Everything is working fine there.

Recently I tried to upgrade to the latest metascraper release (v5.35). This is when I started getting various errors. I then tried to downgrade my installation but the problems persisted. In fact every release above v5 seems to fail now, which is weird, because I've been using these packages for years on Node installations <16.

I'm confused as to why the earlier packages have now also become incompatible. It seems to have something to do with the @Metascraper/helpers package which is installed automatically when any metascraper package is installed. @Metascraper/helpers always gets installed at the latest version even when installing lower versions of Metascraper. I've tried to install a lower version of this package too (@metascraper/helpers@5.14.12) which doesn't use jsdom. This installation works perfectly, but I get runtime errors when I require metascraper:

The "superCtor.prototype" property must be of type object. Received undefined

Any thoughts as to how to downgrade my install would be much appreciated. If I can't find a way to do this I will have to rip out metascraper completely and replace it with another scraping package.

@Kikobeats
Copy link
Member

Kikobeats commented Aug 12, 2023

Can you try to print the stack trace? It's hard to help without more details

@Hereward
Copy link
Author

Hereward commented Aug 12, 2023

UPDATE

I rebuilt the app against an older lock-file and package.json file and everything is working again.

I can now confirm that metascraper v5.29.8 is compatible with MeteorJS v2.x (which runs on Node v14). This version doesn't have jsdom as a dependency.

If you're using this package with Meteor 2.x you need to be careful of minor version upgrades.

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

Successfully merging a pull request may close this issue.

2 participants