Need Help with a cjs import that is calling System.register

144 views
Skip to first unread message

Al J

unread,
Apr 15, 2016, 9:52:32 AM4/15/16
to SystemJS
I am using the Aurelia framework(which uses System.js) and I want to use the package github:ArthurClemens/Javascript-Undo-Manager

That package has a few things that need fixing and I'd like to suggest them to the author, but I can't quite figure out what to tell him

The [jspm] import (when done from npm: or github:)  warns of no entrypoint -- and I fix that with an override:  -o "{main: 'undomanager.js'}"

But I can't use the UndoManager object unless I copy the undomanager.js file to my sources folder and import it from there (I clean undomanager from config.js)

Note: If I imported it from npm I have to remove the line: "format cjs"; 

Also: If I remove the line: "format cjs";  when it's in the jspm installed directory it still won't work, and an override of { format: '' } doesn't help

At one point in my fumbling around I managed to get the browser to display this error: ( but I can't figure out how I did it )
  
   system.src.js:4597 Uncaught Error: Module http://0.0.0.0:9000/dist/undomanager.js interpreted as cjs module format, but called System.register. 


I would like to suggest fixes to the author that will let me use file from a clean import

Thanks for any help you can provide

Al;

Guy Bedford

unread,
Apr 16, 2016, 4:13:46 PM4/16/16
to Al J, SystemJS
This is a jspm issue, rather than a SystemJS one, but it seems to work in jspm with:

jspm install github:ArthurClemens/Javascript-Undo-Manager -o "{main:'undomanager.js'}"

The main can be put in the jspm registry, or added to the package.json of the repo to work without the custom override being necessary.

--
You received this message because you are subscribed to the Google Groups "SystemJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to systemjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

research...@gmail.com

unread,
Apr 16, 2016, 6:31:39 PM4/16/16
to SystemJS, allen....@gmail.com
But what the format of the module?

How do I find out what format it is?

What's the default format you get when you delete the format it says it is ?
Reply all
Reply to author
Forward
0 new messages