Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • 05:54
    shrinktofit opened #2281
  • Nov 20 23:38
    joeldenning commented #2280
  • Nov 20 20:07
    guybedford commented #2280
  • Nov 20 19:54
    joeldenning edited #2280
  • Nov 20 19:53
    github-actions[bot] commented #2280
  • Nov 20 19:52
    joeldenning opened #2280
  • Nov 20 19:51

    joeldenning on issue-2272-2

    Self review (compare)

  • Nov 20 19:47

    joeldenning on issue-2272-2

    Add firstGlobalProp option for … (compare)

  • Nov 20 19:24
    guybedford commented #2272
  • Nov 20 19:23
    guybedford commented #2272
  • Nov 20 19:22
    guybedford closed #2272
  • Nov 20 19:22
    guybedford commented #2272
  • Nov 20 19:21
    guybedford commented #2272
  • Nov 20 19:05
    joeldenning commented #2272
  • Nov 20 19:04
    joeldenning commented #2272
  • Nov 20 19:03
    guybedford commented #2272
  • Nov 20 19:03
    joeldenning commented #2272
  • Nov 20 19:01
    guybedford commented #2272
  • Nov 20 19:00

    joeldenning on issue-2272


  • Nov 20 18:57
    joeldenning commented #2272
Guy Bedford
@stevenvachon System.set should be set with full URLs usually if you can. prepareImport is just for loading the import map initially. Updating the import map after that prepareImport is a use case we have yet to support, but are currently matching what browser import maps provide.
4 replies
Guy Bedford
Exactly - import maps spec is now frozen and doesn’t support updates
It does support dynamic injection before the first module load, but so does systemjs
After the first module load they are frozen
I’ve created http://github.com/guybedford/import-maps-extensions to get movement on new spec work for these sorts of cases
Will post to WICG when import maps unflag
Steven Vachon
so, then you wouldn't be interested in a PR
@guybedford if you're aware of any hacks i can use (i'm using jest), please post them to the github issue i created
Akanksha Singh
Hello everyone. I need help. I'm using systemJS with import map inside my react application to load certain external modules (micro front end modules) . I have configured cors in my webpack-dev-server. Still it's throwing cors access not allowed error. Any idea, on how to fix it?
@hiaparna I'm using same single-spa for microfrint end, but getting cors error when importing modules using systemJS. Can you please help me, on how you did it.
Jari Germeraad

Hey everyone!

We're currently using SystemJS' Import Maps with single-spa and we were wondering whether we can add a header to the requests done by SystemJS (if I'm not mistaken?)!
It would be a custom header.

Any thoughts? Thanks!

Frank Lemanschik
it is possible you can add a modifyed loader
or you use serviceworkers
both are good methods
ehm sorry
serviceworkers :)
thats the right term
Guy Bedford
@jari_germeraad_gitlab custom headers aren't supported for script tags in browsers, but you could do this by using a fetch loader and then cutomizing the fetch request. You can use the module types extra and then set the shouldFetch hook to always return true in https://github.com/systemjs/systemjs/blob/master/docs/hooks.md#shouldfetchurl---boolean. Then hook the fetch call as well itself to add the extra headers you need.
Michiel Vermandel
Hi, I want to use SystemJS 6 to build a plugin system in Angular. Almost any example uses SystemJS 0.2x. Is it possible to achieve the same as describes in this SO question with SystemJS6? https://stackoverflow.com/questions/60284943/updating-systemjs-from-0-21-to-6-x-with-webpack => The thing I do not know to migrate is the SystemJS.newModule, as it does not exist in SystemJS 6 anymore. Any advice would be greatly appriciated!
Guy Bedford
@resolvethis you can use System.set instead of System.registry.set, then you likely want to use a resolved URL for those dependencies configured via an import map.
If you look for System.set examples in the issue queue I'm sure you should find a similar answer
For example see systemjs/systemjs#2152
Michiel Vermandel
Thanks a lot, I managed to get it working! See https://stackoverflow.com/a/63917606/2528609 for details
Hello! I'm sorry this is a super-old question, but we're using 0.21.0 as part of a dynamically fetched system and I'm trying to work out how to externalise react and react-dom. The outer application is built using webpack, and I've got that happily putting the UMD builds of react/dom as script imports in the html file, but I'm not sure how I can tell systemjs that import React from 'react' is already provided and doesn't need fetching. Any ideas?