You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing an Angular library that has an indirect dependency on jsonld.
When I run my E2E tests that import elements of my Angular library I get:
E/launcher - Error: ReferenceError: window is not defined
at Object. (/.../node_modules/jsonld/dist/jsonld.js:10:4)
My understanding is that protractor is not aware of DOM objects that are normally available in client-side JS, so I added the following code in protractor.conf.js:
I am still using this workaround to import jsonld: const jsonld = require('jsonld/dist/jsonld.js');
I tried to change this to import * as jsonld from 'jsonld'; but then I get
jsonld.js:1034 Uncaught ReferenceError: global is not defined
at wrapper (jsonld.js:1034)
at Object../node_modules/jsonld/lib/jsonld.js (jsonld.js:1073)
I am developing an Angular library that has an indirect dependency on
jsonld
.When I run my E2E tests that import elements of my Angular library I get:
I found out that jsonld/dist/jsonld.js (distributed code: https://www.npmjs.com/package/jsonld/v/1.8.1) uses
window
:(window, function() {
(line 10).My understanding is that protractor is not aware of DOM objects that are normally available in client-side JS, so I added the following code in
protractor.conf.js
:Details can be found here: dasch-swiss/dsp-ui-lib#124
Has anyone faced a similar issue with protractor and
jsonld
? If yes, how was it solved?The text was updated successfully, but these errors were encountered: