-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
ReferenceError: Element is not defined - nodejs-pal #243
Comments
window and Element injects are now requested via the PAL so that executing tests with node-based unit test runners like Jest do not break related issue #243
@dweber019 let me first say thanks for the great issue report and the example to reproduce the issue. This makes fixing things much easier :) So the reason was that the i18n plugin still directly referenced I've checked out your example and with these fixes it works. With the next release everything should be ok. Thanks again for the feedback |
@zewa666 awesome! Really like you guys speed on fixing things. Do you have any estimate on when this fix will be published? |
I've already contacted @EisenbergEffect and queued this up for the next release cycle. So as soon as his time permits this will be pushed. In the meantime if this is a blocker for you, you can fork the repo, build the dist files and reference your fork for the time being. |
@EisenbergEffect, @zewa666 i think this kind of problems could be automatically detected with aurelia-template-lint - it just needs small improvements (additional rule, that would alert via linter when using globals, that don't work with aurelia-pal-nodejs) |
@dweber019 please check out the latest release, closing this for now. if there are any issues please report back. |
Thanks a lot. Amazing speed 👍 |
I'm submitting a bug report
1.6.2 / 2.0.0
Please tell us about your environment:
Operating System:
OSX
Node Version:
6.11.4
NPM Version:
3.10.10
JSPM OR Webpack AND Version
webpack 3.8.1
Browser:
Jest
Language:
TypeScript 2.6.1
Setup:
I'm using a slighly changed version of the Aurelia Skeleton for Webpack and Typescript.
There I have tests, which mock i18n => https://github.com/w3tecch/aurelia-typescript-boilerplate/blob/feature/dependency-update/test/unit/app.spec.ts#L50
I have now upgraded to the latest dependencies regarding Aurelia and everything from building to running the app in the browser (even e2e test) work fine.
Sadly the jest unit tests are broken with the following errror:
This error disappears when I remove aurelia-i18n.
There is no difference in using version 1.6.2 or 2.0.0. So I think it has something to do with the other Aurelia dependencies, which are the lastest as of today.
The tests in aurelia-i18n repository are using
aurelia-pal-browser
. On the other hand the Aurelia-CLI and the Aurelia Skeleton are using theaurelia-pal-nodejs
and so do I. Maybe this makes some difference regarding this issue.If you like to reproduce checkout this branch, yarn install and run npm test:
https://github.com/w3tecch/aurelia-typescript-boilerplate/tree/feature/dependency-update
Thanks for any advise / help
The text was updated successfully, but these errors were encountered: