veliovgroup / spiderable-middleware

🤖 Prerendering for JavaScript powered websites. Great solution for PWAs (Progressive Web Apps), SPAs (Single Page Applications), and other websites based on top of front-end JavaScript frameworks
https://www.npmjs.com/package/spiderable-middleware
BSD 3-Clause "New" or "Revised" License
38 stars 4 forks source link

Invalid argument on Meteor 2.5-beta #13

Closed StorytellerCZ closed 2 years ago

StorytellerCZ commented 3 years ago

I'm getting the following error on Galaxy when running on Meteor 2.5 beta, which crashes the container:

t3y2m
2021-10-07 08:05:25+02:00TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received function onStreamEnd
t3y2m
2021-10-07 08:05:25+02:00 at Function.from (buffer.js:330:9)
t3y2m
2021-10-07 08:05:25+02:00 at toBuffer (/app/bundle/programs/server/npm/node_modules/meteor/webapp/node_modules/compression/index.js:286:14)
t3y2m
2021-10-07 08:05:25+02:00 at ServerResponse.end (/app/bundle/programs/server/npm/node_modules/meteor/webapp/node_modules/compression/index.js:115:22)
t3y2m
2021-10-07 08:05:25+02:00 at Curl.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/ostrio_spiderable-middleware/node_modules/request-libcurl/index.js:222:24)
t3y2m
2021-10-07 08:05:25+02:00 at Curl.emit (events.js:400:28)
t3y2m
2021-10-07 08:05:25+02:00 at Curl.emit (domain.js:470:12)
t3y2m
2021-10-07 08:05:25+02:00 at /app/bundle/programs/server/npm/node_modules/meteor/ostrio_spiderable-middleware/node_modules/node-libcurl/dist/Curl.js:198:22
t3y2m
2021-10-07 08:05:25+02:00 at wrapper (/app/bundle/programs/server/npm/node_modules/meteor/ostrio_spiderable-middleware/node_modules/node-libcurl/dist/Curl.js:188:23)
t3y2m
2021-10-07 08:05:25+02:00 at Curl.onEnd (/app/bundle/programs/server/npm/node_modules/meteor/ostrio_spiderable-middleware/node_modules/node-libcurl/dist/Curl.js:189:9)
t3y2m
2021-10-07 08:05:25+02:00 at Easy.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/ostrio_spiderable-middleware/node_modules/node-libcurl/dist/Curl.js:47:22)

After removing the package things go back to normal.

dr-dimitru commented 2 years ago

Hello @StorytellerCZ ,

Pardon me for the silence. So far we haven't faced such issue on our end. Hopefully latest v1.6.4 solve all compatibility issues.

Feel free to close it in case if the issue is solved on your end.

If issue persists on your end, please share more details on your setup and connected website

StorytellerCZ commented 2 years ago

I'll give it a try.

StorytellerCZ commented 2 years ago

I think it is working now. Closing!

StorytellerCZ commented 2 years ago

Never mind, just got the error again and it crashed my app. Though this time it was after hours of running:

pkssb
2022-05-09 15:27:23+02:00TypeError [ERR_INVALID_ARG_TYPE] [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received function onStreamEndpkssb
2022-05-09 15:27:23+02:00 at new NodeError (internal/errors.js:322:7)pkssb
2022-05-09 15:27:23+02:00 at Function.from (buffer.js:334:9)pkssb
2022-05-09 15:27:23+02:00 at toBuffer (/app/bundle/programs/server/npm/node_modules/meteor/webapp/node_modules/compression/index.js:286:14)pkssb
2022-05-09 15:27:23+02:00 at ServerResponse.end (/app/bundle/programs/server/npm/node_modules/meteor/webapp/node_modules/compression/index.js:115:22)pkssb
2022-05-09 15:27:23+02:00 at Curl.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/ostrio_spiderable-middleware/node_modules/request-libcurl/index.js:222:24)pkssb
2022-05-09 15:27:23+02:00 at Curl.emit (events.js:400:28)pkssb
2022-05-09 15:27:23+02:00 at Curl.emit (domain.js:475:12)pkssb
2022-05-09 15:27:23+02:00 at /app/bundle/programs/server/npm/node_modules/meteor/ostrio_spiderable-middleware/node_modules/node-libcurl/dist/Curl.js:206:22pkssb
2022-05-09 15:27:23+02:00 at wrapper (/app/bundle/programs/server/npm/node_modules/meteor/ostrio_spiderable-middleware/node_modules/node-libcurl/dist/Curl.js:196:23)pkssb
2022-05-09 15:27:23+02:00 at Curl.onEnd (/app/bundle/programs/server/npm/node_modules/meteor/ostrio_spiderable-middleware/node_modules/node-libcurl/dist/Curl.js:197:9)pkssb
2022-05-09 15:27:23+02:00 at Easy.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/ostrio_spiderable-middleware/node_modules/node-libcurl/dist/Curl.js:47:22)

My settings are:

import { WebApp } from 'meteor/webapp'
import Spiderable from 'meteor/ostrio:spiderable-middleware'

WebApp.connectHandlers.use(
  new Spiderable({
    rootURL: 'https://www.literaryuniverse.com',
    serviceURL: 'https://render.ostr.io',
    auth: 'myauthkey',
    ignore: ['/user/', '/workshop/', '/library/', '/pm/']
  })
)
dr-dimitru commented 2 years ago

@StorytellerCZ figured it out. Pushed fixes in 1.6.5. I hope it will get solved now.

Feel free to reopen it in case if the issue is still persists on your end.