phantomjs installs but fails to run due to Qt dependency

Created on 27 Jun 2016  路  8Comments  路  Source: ariya/phantomjs

  1. Which version of PhantomJS are you using? Tip: run phantomjs --version.
    phantom-prebuilt ver. 2.1.7
  2. What steps will reproduce the problem?

    1. npm install phantomjs-prebuilt

    2. call node_modules/phantomjs-prebuilt/bin/phantom

      Response is : This application failed to start because it could not find or load the Qt platform plugin "xcb".

  3. Which operating system are you using?
    ArchLinux
  4. Did you use binary PhantomJS or did you compile it from source?
    npm install
  5. Please provide any additional information below.
    I do have all the Qt libraries for xcb.
    I also understand from the documentation in this site that there is no dependency on Qt

Most helpful comment

What's your env variable QT_QPA_PLATFORM? It must be empty to run PhantomJS successfully.

why?

All 8 comments

What's your env variable QT_QPA_PLATFORM? It must be empty to run PhantomJS successfully.

No response. Closing.

$ echo $QT_QPA_PLATFORM
xcb

(not the original poster)

Shouldn't it be robust against existing environment variables ?

What's your env variable QT_QPA_PLATFORM? It must be empty to run PhantomJS successfully.

why?

A workaround is setting the env variable for the single call:

QT_QPA_PLATFORM="" phantomjs myscript.js

@solvemon your workaround works. Shouldn't this be fixed in phantomjs?

The problem is that we compile PhantomJS statically, that means all dependencies (not in 2.5) will be compiled into a single binary (even Qt platform plugins). I already pushed the fix to master (https://github.com/ariya/phantomjs/commit/abd8ac58ea0a60482373df848d6b7928c722ca83)

@Vitallium Any idea when or if the fix will become part of a release? I just stumbled upon this issue the second time :-/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

qaDream77 picture qaDream77  路  4Comments

Sayalic0 picture Sayalic0  路  5Comments

yisibl picture yisibl  路  5Comments

Snowlav picture Snowlav  路  3Comments

h4wlt picture h4wlt  路  5Comments