Closed stephenmcconnachie closed 5 years ago
And output from npm test:
universalviewer@3.0.36 test /home/collectionssystems/code/universalviewer jest
Error: Failed to launch chrome!
(chrome:32131): Gtk-WARNING **: 20:34:17.581: cannot open display:
TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
at onClose (/home/collectionssystems/code/universalviewer/node_modules/puppeteer/lib/Launcher.js:349:14)
at ChildProcess.<anonymous> (/home/collectionssystems/code/universalviewer/node_modules/puppeteer/lib/Launcher.js:339:60)
at ChildProcess.emit (events.js:214:15)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
npm ERR! Test failed. See above for more details.
It's possible this is an incompatibility with the node version. Travis currently tests 8.9.1
but 8.x
should work fine. Node 10 and above came with a pretty large breaking change for CLI applications (Buffer) and dependencies needed to be updated. So using Node 8.x may solve your problem in the short term.
Alternatively, it looks like updating a few dependencies could get UV compatibility with Node 10+
For the second error, check out the troubleshooting page here, lists the system dependencies that are required for headless-browser testing.
(The error does link to this page, but not the section you need!)
It's possible this is an incompatibility with the node version.
Thanks! I'll try with Node 8.x and report if that solves it.
For the second error, check out the troubleshooting page here, lists the system dependencies that are required for headless-browser testing.
I did go through the dependencies list and use apt to install them all, but probably I missed something.. I'll try again.
Cheers for your help, really appreciate it.
Stephen
One more thing that might solve the testing:
CI=true npm test
It looks like it only runs headless if CI
is set to "true"
, so that may also solve your issue! I think by default it uses the non-headless chromium and opens up the window, which it may have a problem with depending on your set up.
Thanks! That CI argument worked for the test - utput below. A few versioning / config warnings but looks ok I think.
I'll try the legacy node version for the install issue, and report back.
Cheers, Stephen
universalviewer@3.0.36 test /home/collectionssystems/code/universalviewer jest
ts-jest[versions] (WARN) Version 25.0.0 of jest installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=24.0.0 <25.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
ts-jest[backports] (WARN) "[jest-config].globals.ts-jest.enableTsDiagnostics" is deprecated, use "[jest-config].globals.ts-jest.diagnostics" instead.
ts-jest[backports] (WARN) Your Jest configuration is outdated. Use the CLI to help migrating it: ts-jest config:migrate [jest-config].globals.ts-jest.diagnostics
option):
message TS151001: If you have issues related to imports, you should consider setting esModuleInterop
to true
in your TypeScript configuration file (usually tsconfig.json
). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) TypeScript diagnostics (customize using [jest-config].globals.ts-jest.diagnostics
option):
message TS151001: If you have issues related to imports, you should consider setting esModuleInterop
to true
in your TypeScript configuration file (usually tsconfig.json
). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
ts-jest[config] (WARN) TypeScript diagnostics (customize using [jest-config].globals.ts-jest.diagnostics
option):
message TS151001: If you have issues related to imports, you should consider setting esModuleInterop
to true
in your TypeScript configuration file (usually tsconfig.json
). See https://blogs.msdn.microsoft.com/typescript/2018/01/31/announcing-typescript-2-7/#easier-ecmascript-module-interoperability for more information.
PASS tests/test.js
PASS src/extensions/uv-seadragon-extension/Bounds.spec.ts
PASS src/Utils.spec.ts
PASS src/PubSub.spec.ts
Test Suites: 1 skipped, 4 passed, 4 of 5 total Tests: 3 skipped, 7 passed, 10 total Snapshots: 0 total Time: 3.596s Ran all test suites.
Looks good. I installed node 8.16.1 using this recipe: sudo npm cache clean -f sudo npm install -g n sudo n 8.16.1
Then re-did sudo npm install in the universalviewer folder - a few yellow warnings, but no fails.
Thanks again for your help - I realise Node legacy install is not a permanent solution but great to get past the error so that I can hopefully get UV running.
Dumb question I suspect, but I can't find documentation beyond 'grunt build' 'grunt examples' etc
I run a grunt build option, then I have to serve the universalviewer folder in a web server eg nginx? It doesn't run a web server itself right? Will python SimpleHTTPServer work out?
Sorry I realise this is more like a support question - please point me at docs if I've missed them? Or should I put this in SlackOverflow IIIF tagged?
@stephenmcconnachie, grunt examples
should run a web server for you. As you say, grunt build
just creates a package that you can deploy through your server of choice.
Got it, thanks
I've stumbled into the same problem with Universalviewer 3.1.1
Turns out this is an issue with core-js: https://github.com/zloirock/core-js/issues/824
Universalviewer depends on core-js v2.4.1
(see: package.json). This is an older version of core-js which isn't compatible with more versions of NodeJS. Per the assertion of the maintainer of core-js: v.2.4 was released 5 years ago.
Universalviewer works fine with up to and including node v11.x. But anything higher will break.
UV version:
I'm submitting a:
Current behavior:
After cloning UV master branch repo, when running 'npm install', one issue causes fatal error in the install. Error output is:
/home/collectionssystems/code/universalviewer/node_modules/core-js/modules/_typed-buffer.js:157 if(numberLength != byteLength)throw RangeError(WRONG_LENGTH); ^
RangeError: Wrong length! at validateArrayBufferArguments (/home/collectionssystems/code/universalviewer/node_modules/core-js/modules/_typed-buffer.js:157:39) at new ArrayBuffer (/home/collectionssystems/code/universalviewer/node_modules/core-js/modules/_typed-buffer.js:247:29) at zlib.js:334:28 at NativeModule.compile (internal/bootstrap/loaders.js:300:5) at NativeModule.compileForPublicLoader (internal/bootstrap/loaders.js:217:8) at loadNativeModule (internal/modules/cjs/helpers.js:23:9) at Function.Module._load (internal/modules/cjs/loader.js:685:15) at Module.require (internal/modules/cjs/loader.js:830:19) at require (internal/modules/cjs/helpers.js:68:18) at Object. (/home/collectionssystems/code/universalviewer/node_modules/node-fetch/index.js:12:12)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! universalviewer@3.0.36 postinstall:
opencollective postinstall
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the universalviewer@3.0.36 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.Expected behavior:
npm install would complete successfully with no issues
Steps to reproduce:
Clone master branch repo into Ubuntu 18.04.3 LTS, run npm install.
Related code:
Other information: