computmaxer / karma-jspm

Other
74 stars 50 forks source link

Error: SystemJS baseURL should only be configured once #106

Closed hmps closed 8 years ago

hmps commented 8 years ago

After upgrading SystemJS to v0.19.4 my tests could not run anymore. The error message I saw was

14 10 2015 10:33:07.646:ERROR [PhantomJS 1.9.8 (Mac OS X 0.0.0)]: TypeError: baseURL should only be configured once and must be configured first.
at http://localhost:9876/base/jspm_packages/system.src.js?4cf2029bbbbc9b776337cc3b2c67ab2beea97a00:1633

The error is fixed by modifying the adapter.js. From

System.config({ baseURL: 'base' });

to

if ( !System.baseURL ) {
    System.config({ baseURL: 'base' });
}

I'm happy to PR this but wanted to get your eyes on it first. Does this seem like a reasonable approach to solving the error?

Gu1 commented 8 years ago

I'm also affected by the same problem. Your proposed fix works for me.

stephenlautier commented 8 years ago

:+1:

CristianMR commented 8 years ago

+1

gavinaiken commented 8 years ago

+1

sergei-maertens commented 8 years ago

:+1:

vperron commented 8 years ago

Subscribing to this issue, which is actually a blocker right now.

maxwellpeterson-wf commented 8 years ago

I'm thinking a better approach may be to go back to how we were doing it before this commit: https://github.com/Workiva/karma-jspm/commit/c14be8ae3f5745cec542bf40ffa36eb35a5220aa

Any thoughts?

hmps commented 8 years ago

I took a look at your proposal above @maxwellclarke-wf. On my machine it seems like this issue has been solved by SystemJS 0.19.6. I'm not getting the error anymore, with or without my original if clause solution.

In fact, it doesn't seem to matter what I set baseURL to in System.config({ baseURL: 'base' });. base works just as fine as null or any string value it seems. Don't know why or how, but it seems to me like this issue is resolved.

I'm closing this for now, if someone is still seeing the issue in SystemJS 0.19.6 please reopen it.