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

Error to call phantomjs in production. #5

Open
felipesmendes opened this issue Jul 22, 2016 · 7 comments
Open

Error to call phantomjs in production. #5

felipesmendes opened this issue Jul 22, 2016 · 7 comments

Comments

@felipesmendes
Copy link

Hi Ryan,

I'm developing my application in Windows but my server production is in Linux and when I call the webshot method is given this error:

Error: spawn /Tracker/bundle/programs/server/npm/node_modules/phantomjs-prebuilt/lib/phantom\bin\phantomjs.exe ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1057:32)
    at child_process.js:1151:20
    at process._tickCallback (node.js:355:11)

I think its because I installed NPM packages in Windows.
Do you know how to solve it?

@ryanswapp
Copy link
Owner

How are you deploying your application? That error (ENOENT) means that a file is missing. The specific file is the phantom js binary. I suspect the reason its missing is because you built your application bundle on a windows machine and then deployed it to Linux. I've never developed a Meteor app on windows so I'm not sure what the best solution is. If you haven't given mupx a try that might be the way to go. It contains everything inside a docker container and is likely to resolve the issue.

@felipesmendes
Copy link
Author

I'm deploying use meteor build and extracting it into Linux server.

I'll try to build in a linux and deploy it.

@ryanswapp
Copy link
Owner

Ya that's your problem then. Generally, you need to build your app in the environment in which you plan to deploy to.

@felipesmendes
Copy link
Author

Cool, I'll try on linux and tell you,

Other dobt is on development I could make your example.

But wanted to know if I can instead of using pokemon-reports.html some other template out of the private folder in the case client/views, or other alternative of Asses.getText

This is because I have one big report and I don't wana create other template just to generate a PDF, I want to reuse it

@ryanswapp
Copy link
Owner

You don't need to use a template. The key is that you need to pass a string of html to webshot. You can build that however you'd like.

Get Outlook for iOS

    _____________________________

From: felipesmendes [email protected]
Sent: Friday, July 22, 2016 8:40 AM
Subject: Re: [ryanswapp/meteor-pdf-tutorial] Error to call phantomjs in production. (#5)
To: ryanswapp/meteor-pdf-tutorial [email protected]
Cc: Comment [email protected], Ryan Swapp [email protected]

Cool, I'll try on linux and tell you,

Other dobt is on development I could make your example.

But wanted to know if I can instead of using pokemon-reports.html some other template out of the private folder in the case client/views, or other alternative of Asses.getText

This is because I have one big report and I don't wana create other template just to generate a PDF, I want to reuse it


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@felipesmendes
Copy link
Author

felipesmendes commented Jul 22, 2016

I understood, thank you!

Do you now some method to transform my template in a string?

Can I use Blaze.toHTML in server?

@ryanswapp
Copy link
Owner

You could grab all the html by calling the jquery html method on the outermost container. Something like $('.wrapper').html(). You would still need to add CSS to it which you could do server side with the juice npm module.

Get Outlook for iOS

On Fri, Jul 22, 2016 at 8:52 AM -0600, "felipesmendes" [email protected] wrote:

I understood, thank you!

Do you now some method to transform my template in a string?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

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