These are chat archives for systemjs/systemjs

22nd
Sep 2015
Sean Anderson
@MeoMix
Sep 22 2015 05:44
Can baseURL be expressed as a conditional?
I've been trying to get things running with Karma and I played with a few diff solutions. Kept running into weird errors in css-modules when trying to forego a baseURL entirely for compatibility w/ Karma. The best solution I've had is doing a conditional baseURL, which works, but is reset upon jspm install
Guy Bedford
@guybedford
Sep 22 2015 07:11
@MeoMix no baseURL needs to be an absolute thing. If baseURL is behaving differently with css modules, I'd suggest posting an issue there.
Sean Anderson
@MeoMix
Sep 22 2015 07:12
Doesn't appear to be limited to just them. Still fighting with Karma. I end up specifying "base/" for my paths, but it doesn't seem to apply to dependencies.
So I end up getting something like "404, localhost:port/process.js not found'
but really the easiest solution by far would just to be able to dynamically have baseURL be "/base" or "/" depending on karma.
Guy Bedford
@guybedford
Sep 22 2015 07:35
yes you want the baseURL to be "/base" certainly
I'd suggest removing the baseURL from your config then and just making it environment-specific
Sean Anderson
@MeoMix
Sep 22 2015 07:44
Yeah. When I remove the baseURL I can have a working setup if I prefix a "/" onto my paths for github/npm, but then it causes Karma to choke when looking up dependnecies. We'll see if I can find a working combo
Guy Bedford
@guybedford
Sep 22 2015 07:45
is this karma-jspm?
or karma-systemjs?
Sean Anderson
@MeoMix
Sep 22 2015 07:51
Oh, karma-jspm. I guess I should be talking over there. I think since I adopted both of the techs at the same time I use them interchangeably.
(obviously they aren't)
Anywho, my brain is beat from trying hundreds of things over the past few days. I'll try and do a better write-up of what issues I'm hitting tomorrow and post it on the karma-jspm github. It does look like some people have working setups, but I'm at a loss.
Guy Bedford
@guybedford
Sep 22 2015 11:29
I think this is a common issue
I also described what I would suggest karma jspm does in https://github.com/Workiva/karma-jspm/issues/91#issuecomment-134994316
I can't personally work on these projects though unfortunately so do rely on community contributions to make this stuff work
Dennis Rieks
@drieks
Sep 22 2015 12:55
hi
@guybedford have to time to talk about systemjs/systemjs#800 ?
Mike Haas
@mikehaas763
Sep 22 2015 13:18
@MeoMix yeah I'm also having issues with karma-systemjs.
Mike Haas
@mikehaas763
Sep 22 2015 13:30
My entire app, loader config, index.html, app code all live in a project sub directory src/. Whereas node_modules/ does not live there but is a dir level higher up at the project root. My node_module deps and entire app are copied to a build/ dir at build time. I can't find a winning combination of baseURL
Will hopefully have it resolved soon
Sharon (Sean) Rolel
@Mosho1
Sep 22 2015 16:46
Do I have to do anything special to work with systemjs in node? did a fresh install and nothing happens when I import
literally just
import System from 'systemjs';
System.import('./mod').then(m => console.log(m));
process exits and nothing in mod gets called
Mike Haas
@mikehaas763
Sep 22 2015 16:48
@Mosho1 I would need more debugging info to help. What does just an invocation of System.import do?
Sharon (Sean) Rolel
@Mosho1
Sep 22 2015 16:50
without the chained then? same thing, where what I'm importing just logs something
Mike Haas
@mikehaas763
Sep 22 2015 16:51
Ok does the same thing happen from just the System import?
without actually using System
Sharon (Sean) Rolel
@Mosho1
Sep 22 2015 16:51
not sure what you mean
Mike Haas
@mikehaas763
Sep 22 2015 16:51
just import System from 'systemjs';
Sharon (Sean) Rolel
@Mosho1
Sep 22 2015 16:51
yeah, it's there
I log it and it seems like the right module
Mike Haas
@mikehaas763
Sep 22 2015 16:52
Does the process error or does it exit with code 0
ok cool
Sharon (Sean) Rolel
@Mosho1
Sep 22 2015 16:52
code 0
Mike Haas
@mikehaas763
Sep 22 2015 16:53
I guess I don't know. I'd personally set up a debugger (I use webstorm) and step into the System.import() call
Sharon (Sean) Rolel
@Mosho1
Sep 22 2015 16:56
yeah, not in the mood for that
I'll just use npm
thanks :)