Skip to content
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

Module loading problems in phantomjs #103

Closed
polarctos opened this issue May 4, 2017 · 3 comments
Closed

Module loading problems in phantomjs #103

polarctos opened this issue May 4, 2017 · 3 comments

Comments

@polarctos
Copy link
Contributor

I just upgraded to ember-cli v2.13.1 and use phantomjs v2.1.14, and now the qunit tests are failing during module loading. The Tests run fine in Chrome though.

I am using ember-lodash v4.17.2.

<error message="
Died on test #1 moduleLoadFailure@http://localhost:10001/assets/test-support.js:15093:28
http://localhost:10001/assets/test-support.js:15321:33
require@http://localhost:10001/assets/test-support.js:15309:32
loadModules@http://localhost:10001/assets/test-support.js:15301:23
loadTests@http://localhost:10001/assets/test-support.js:15146:33
start@http://localhost:10001/assets/test-support.js:15181:16
http://localhost:10001/assets/tests.js:1194:28
exports@http://localhost:10001/assets/vendor.js:119:37
requireModule@http://localhost:10001/assets/vendor.js:34:25
global code@http://localhost:10001/assets/tests.js:1262:8: Object is not a constructor (evaluating '(0, _lodash_defineProperty['default'])')
">
@rwjblue
Copy link
Contributor

rwjblue commented May 4, 2017

I've seen this reported in slack a few times, and I'd love to help figure this out but I will need a reproduction..

@simonihmig
Copy link
Contributor

simonihmig commented May 5, 2017

OMG, I just lost so many hours debugging through this... 😢

Here are my findings...

In my case the use of lodash originated in ember-cli-mirage: https://github.com/samselikoff/ember-cli-mirage/blob/master/app/initializers/ember-cli-mirage.js#L6

Unfortunately this is in a private app I cannot share. I tried to reproduce it in a minimal app, but did not succeed. A fresh (ember-cli 2.13.1) app just with mirage and a dummy acceptance test did load the mirage initializer, but did not fail in Phantom unfortunately... 🤔

Here is the final part of the stack trace (I added the functions of lodash where the code lines come from):

http://localhost:7357/assets/vendor.js:231897:50  // lodash/_baseSetToString
http://localhost:7357/assets/vendor.js:236300:24 // lodash/_shortOut
baseRest@http://localhost:7357/assets/vendor.js:231790:47 // lodash/_baseRest
createAssigner@http://localhost:7357/assets/vendor.js:233130:44 // lodash/_createAssigner
http://localhost:7357/assets/vendor.js:237374:54 // lodash/assign
exports@http://localhost:7357/assets/vendor.js:119:37

_baseSetToString imports _defineProperty which is null in case of the failing app, thus the exception.

I added a bunch of console.log here and there to track this down, always rerunning the tests in Phantom. (hey, debugging Phantom is so much fun 😩):

So seems something is different in the failing case for the global Object, but no idea what and why.

Anyone any idea what all that means? @rwjblue if not you, then who??? 😉

I could post my compiled vendor.js if that would help...

@rwjblue
Copy link
Contributor

rwjblue commented May 12, 2017

Will be fixed by #104.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants