Hi! I’m new to contributing and I’m trying to do to “npm run test” to run the tests and make sure the code I cloned works properly. When I do, I get this error:
Cannot start Chrome
… Missing X server or $DISPLAY
…The platform failed to initialize. Exiting.
I’ve tried to look it up but didn’t find any successful solutions. Does someone know how to solve this error? Thank you!
Hi @Yuri_Chen,
Welcome to the community! We really appreciate your eagerness to contribute

Regarding the issue with npm run tests
, please be sure to follow the documentation outlined here:
I am also unfamiliar with this issue but curious if other community members have also experienced it.
One other effective way to ensure that your code passes our tests is to run a local version of CesiumJS. From here, click “run all tests”. You may want to give this a try in the meantime.
Looking forward to learning more!
Best,
Sam
Update: I have noticed some internal discussion about npm run tests
. @Gabby_Getz, do you have any updates from the CesiumJS squad?
Hi Sam,
Thank you! I really appreciate your help.
I’ve had previous issues with my Chrome.exe when running other programs since it is in my Program Files instead of Program Files (x86) but I’m not sure if that’s why it’s running into an issue. I wasn’t able to find how Karma finds/detects chrome.
You mention running a local version of CesiumJS and clicking “run all tests.” I believe I have a local version of Cesium built, but I don’t see anything on the page that says “run all tests.” Am I looking in the wrong place?
Thank you for your time!
Yuri
Hi @Yuri_Chen,
Apologies, it seems like this testing method may have been deprecated with a recent version of CesiumJS! (I just pulled the most recent version of CesiumJS
)
I’m going to check in with the CesiumJS squad - we should get back to you shortly! We really appreciate your patience 
-Sam
Hi Sam,
Thank you for your response! I appreciate the update. I look forward to hearing back so I can start contributing!
Best,
Yuri
Hi Yuri,
Are you on a Windows machine?
Can you run the following commands in the root cesium
directory and past the the output here?
npm install
npm run build
npm run test -- --verbose
Thanks,
Gabby
Hi Gabby,
Yes, I’m on WSL. Here’s the output:
cesium@1.91.0 test
gulp test “–verbose”
[11:22:49] Using gulpfile /mnt/c/Users/16177/Desktop/eecs481/cesium/cesium/gulpfile.cjs
[11:22:49] Starting ‘test’…
04 04 2022 11:23:03.464:INFO [framework.detect-browsers]: Detecting browsers is disabled. The browsers of the browsers array are used.
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
(Use node --trace-deprecation ...
to show where the warning was created)
04 04 2022 11:23:19.365:INFO [karma-server]: Karma v5.2.3 server started at http://localhost:9876/
04 04 2022 11:23:19.367:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
04 04 2022 11:23:19.412:INFO [launcher]: Starting browser Chrome
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
04 04 2022 11:23:19.949:ERROR [launcher]: Cannot start Chrome
[1355:1355:0404/112319.920050:ERROR:ozone_platform_x11.cc(234)] Missing X server or $DISPLAY
[1355:1355:0404/112319.921521:ERROR:env.cc(225)] The platform failed to initialize. Exiting.
04 04 2022 11:23:19.949:ERROR [launcher]: Chrome stdout:
04 04 2022 11:23:19.949:ERROR [launcher]: Chrome stderr: [1355:1355:0404/112319.920050:ERROR:ozone_platform_x11.cc(234)] Missing X server or $DISPLAY
[1355:1355:0404/112319.921521:ERROR:env.cc(225)] The platform failed to initialize. Exiting.
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
04 04 2022 11:23:19.956:INFO [launcher]: Trying to start Chrome again (1/2).
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
04 04 2022 11:23:20.056:ERROR [launcher]: Cannot start Chrome
[1386:1386:0404/112320.049050:ERROR:ozone_platform_x11.cc(234)] Missing X server or $DISPLAY
[1386:1386:0404/112320.049133:ERROR:env.cc(225)] The platform failed to initialize. Exiting.
04 04 2022 11:23:20.056:ERROR [launcher]: Chrome stdout:
04 04 2022 11:23:20.057:ERROR [launcher]: Chrome stderr: [1386:1386:0404/112320.049050:ERROR:ozone_platform_x11.cc(234)] Missing X server or $DISPLAY
[1386:1386:0404/112320.049133:ERROR:env.cc(225)] The platform failed to initialize. Exiting.
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
04 04 2022 11:23:20.061:INFO [launcher]: Trying to start Chrome again (2/2).
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
04 04 2022 11:23:20.165:ERROR [launcher]: Cannot start Chrome
[1417:1417:0404/112320.157456:ERROR:ozone_platform_x11.cc(234)] Missing X server or $DISPLAY
[1417:1417:0404/112320.157560:ERROR:env.cc(225)] The platform failed to initialize. Exiting.
04 04 2022 11:23:20.165:ERROR [launcher]: Chrome stdout:
04 04 2022 11:23:20.165:ERROR [launcher]: Chrome stderr: [1417:1417:0404/112320.157456:ERROR:ozone_platform_x11.cc(234)] Missing X server or $DISPLAY
[1417:1417:0404/112320.157560:ERROR:env.cc(225)] The platform failed to initialize. Exiting.
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
04 04 2022 11:23:20.169:ERROR [launcher]: Chrome failed 2 times (cannot start). Giving up.
(node:865) [log4js-node-DEP0004] DeprecationWarning: Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.
[11:23:20] Finished ‘test’ after 30 s
I double checked to make sure google chrome was installed in WSL:
google-chrome --version
Google Chrome 99.0.4844.82
Thank you for helping me on this!
Yuri
Hi Sam and Gabby,
I actually got the tests to run! This is my first time working on a project that involves a GUI so I had to create an X Server that my WSL Ubuntu could communicate with, and it worked!
I do have an additional question; I have not changed the code but the code fails one test. Here is the screenshot of the failed test. Please let me know if this is normal!
Thank you,
Yuri
Oh good! I’m glad you got the tests to run.
Some of the tests, like this one, actually render a scene and then check the results. It’s not uncommon to get a different result on your machine every once in a while, which can point to a bad test on our side. Does it fail consistently?
Hi Gabby,
I’ve just the tests another 3 times and actually now I have 2 tests that are failing consistently. Here is a screenshot of those tests:
Should I worry about these? It seems as if the numbers match and the test should pass but it doesn’t.
Hi Yuri,
The renders terrain with lambertDiffuseMultiplier
failure has recently been fixed.
I’m not sure what the cause of the second test failure is, however Scene/Model
is an older class which is in the process of being replaced along with the tests.