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

following usage instructions results in error #1

Open
josh-m-sharpe opened this issue Aug 11, 2017 · 7 comments
Open

following usage instructions results in error #1

josh-m-sharpe opened this issue Aug 11, 2017 · 7 comments

Comments

@josh-m-sharpe
Copy link
Contributor

I can't seem to get this running locally - errors below. Is it possible the installation/usage sections are out of date?

More broadly - how are you hosting this for production? On heroku maybe? A section in the README about how to set that up would be much appreciated.

Thanks!

(12:05 PM) jsharpe@mbp:~/ys-critical-path-server npm install critical-path-server
npm WARN deprecated [email protected]: This project has moved to critical-css-server
npm WARN deprecated [email protected]: Use uuid module instead

> [email protected] install /Users/jsharpe/ys-critical-path-server/node_modules/phantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Download already available at /var/folders/8d/psl4_tyd38b7c_y2qwyxwdz80000gn/T/phantomjs/phantomjs-2.1.1-macosx.zip
Verified checksum of previously downloaded file
Extracting zip contents
Removing /Users/jsharpe/ys-critical-path-server/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /var/folders/8d/psl4_tyd38b7c_y2qwyxwdz80000gn/T/phantomjs/phantomjs-2.1.1-macosx.zip-extract-1502467534667/phantomjs-2.1.1-macosx -> /Users/jsharpe/ys-critical-path-server/node_modules/phantomjs-prebuilt/lib/phantom
Writing location.js file
Done. Phantomjs binary available at /Users/jsharpe/ys-critical-path-server/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
npm WARN saveError ENOENT: no such file or directory, open '/Users/jsharpe/ys-critical-path-server/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/jsharpe/ys-critical-path-server/package.json'
npm WARN ys-critical-path-server No description
npm WARN ys-critical-path-server No repository field.
npm WARN ys-critical-path-server No README data
npm WARN ys-critical-path-server No license field.

+ [email protected]
added 213 packages in 13.279s
(12:05 PM) jsharpe@mbp:~/ys-critical-path-server npm start
npm ERR! path /Users/jsharpe/ys-critical-path-server/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/jsharpe/ys-critical-path-server/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jsharpe/.npm/_logs/2017-08-11T16_05_38_097Z-debug.log
@wheeyls
Copy link
Owner

wheeyls commented Aug 11, 2017

Hi Josh. PhantomJS as a dependency is certainly tricky; I'll have to look into some better docs on getting it installed and running. If I remember correctly I had to do some manual work to get the correct version of https://www.npmjs.com/package/phantomjs-prebuilt for my operating system.

As for production, I run this in heroku using this buildpack to satisfy the phantomjs dependency:

https://github.com/stomita/heroku-buildpack-phantomjs

Have you managed to work around this problem yet?

@josh-m-sharpe
Copy link
Contributor Author

No - just started playing around with it. I don't have it live yet.

Do you run it along side your app that uses it or do you have a separate app in heroku just for this?

@wheeyls
Copy link
Owner

wheeyls commented Aug 11, 2017

In production I run it as a standalone app; it is used to compile CSS for a few different apps.

@josh-m-sharpe
Copy link
Contributor Author

Ok. Got this running on heroku. And I have my rails app wired up with RailsCriticalCssServer.

if I look in the logs of the critical-css-server I see POST requests being made to it that correspond with me refreshing my rails app. So, that's great. However, they're all status=202, which I think is this line? https://github.com/wheeyls/critical-css-server/blob/master/src/app.js#L33

I've been refreshing for a few minutes now - any ideas what i've missed? How long should it take to process a single page/file ?

Thanks!

@josh-m-sharpe
Copy link
Contributor Author

One note, I commented out auth_token in the RailsCriticalCssServer config since I wasn't sure what kind of 'auth' that referred to on the node side. I suppose that's fine because it's getting to the 202 line above and not bonking on some 401 auth required.

@wheeyls
Copy link
Owner

wheeyls commented Aug 15, 2017

@josh-m-sharpe yeah the critical-css-server doesn't have any auth options by default; when I use this in production I actually route it through an extra middleware that looks for the auth token.

Have you checked the logs on heroku with heroku logs --tail while hitting the server? The worker should be processing the CSS in the background, and reporting any errors to the logs.

@wheeyls
Copy link
Owner

wheeyls commented Aug 19, 2017

Hi @josh-m-sharpe, curious if you ever got this up and running?

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

2 participants