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

Crashing My App #2

Closed kenshinman closed 6 years ago

kenshinman commented 7 years ago

code

import Spiderable from "meteor/ostrio:spiderable-middleware";

WebApp.connectHandlers.use(
  new Spiderable({ // this line is where error occurs line 4
    rootURL: "https://site.org",
    serviceURL: "https://render.ostr.io",
    auth: "APIUser:APIPass"
  })
);
TypeError: object is not a function
  W20170927-14:25:38.965(1)? (STDERR)     at meteorInstall.server.Spiderable.js (server/Spiderable.js:4:3)
  W20170927-14:25:38.967(1)? (STDERR)     at fileEvaluate (packages/modules-
  runtime/.npm/package/node_modules/install/install.js:153:1)
  W20170927-14:25:38.968(1)? (STDERR)     at require (packages/modules-
  runtime/.npm/package/node_modules/install/install.js:82:1)
  W20170927-14:25:38.969(1)? (STDERR)     at 
  C:\projects\app2\.meteor\local\build\programs\server\app\app.js:2933:1
  W20170927-14:25:38.970(1)? (STDERR)     at 
  C:\projects\app\.meteor\local\build\programs\server\boot.js:297:10
  W20170927-14:25:38.971(1)? (STDERR)     at Array.forEach (native)
  W20170927-14:25:38.972(1)? (STDERR)     at Function._.each._.forEach (C:\Users\DESKTOP-
  PU4PNV5\AppData\Local\.meteor\packages\meteor-tool\1.3.5_1\mt-
  os.windows.x86_32\dev_bundle\server-lib\node_modules\underscore\underscore.js:79:11)
  W20170927-14:25:38.975(1)? (STDERR)     at 
  C:\projects\app\.meteor\local\build\programs\server\boot.js:133:5
dr-dimitru commented 7 years ago

Hello @kenshinman ,

  1. What version of Meteor and spiderable-middleware package you're on?
  2. Could you console.log(Spiderable)?

From the quick look, it seems like you're on the outdated version.

dr-dimitru commented 7 years ago

@kenshinman is this one solved?

nicooprat commented 7 years ago

I guess I had the same issue because the code was loaded client-side. Putting the config server-side only fixed the issue. If I'm right, worth adding a line in the readme?

dr-dimitru commented 7 years ago

@nicooprat good catch, I'll update readme. Thank you. Marked as documentation

dr-dimitru commented 6 years ago

Thank you @nicooprat for pointing this out. Readme.md is updated.

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