Giter Club home page Giter Club logo

systemjs_issue2's Introduction

Versions

At the time of submitting the issue:

systemjs: 0.19.35 and 0.19.36 systemjs-builder: 0.15.25 and 0.15.26

Steps to reproduce the problem

  1. Clone this repo: https://github.com/lddubeau/systemjs_issue2

  2. npm install.

  3. npm run build will produce js/out.js.

  4. Open index.html in a server. (You cannot just load it from file:// due to cross-origin restrictions.)

You may need to reload, or play with the time parameter of setTimeout to get an error, the problem is a race condition.

The index.html contains the following:

<html>
  <head>
    <script type="text/javascript" src="node_modules/systemjs/dist/system.src.js"></script>
    <script type="text/javascript" src="system-config.js"></script>
    <script type="text/javascript">
      System.config({
      bundles: {
        "out.js": [ "lib/modB.js"],
      }
      });
      window.require = SystemJS.amdRequire;
      window.define = SystemJS.amdDefine;
      require(["modA"]);
      setTimeout(function () {
        require(["modC", "lib/modB"]);
      }, 10);
    </script>
  </head>
  <body>
  </body>
</html>

The system-config.js file contains:

System.config({
    baseURL: "js",
    packages: {
        '': {
            defaultExtension: "js"
        }
    }
});

Expected behavior

Everything should load without error. Files should be loaded once and only once.

Actual behavior

Two HTTP requests are made for modC.js

Errors on the console:

Uncaught (in promise) Error: (SystemJS) Cannot read property 'length' of null(…)
Uncaught (in promise) Error: (SystemJS) Cannot read property 'length' of null(…)

By putting breakpoints and stepping through code I've found that this error is triggered by normalizedDeps being null at this line.

systemjs_issue2's People

Contributors

lddubeau avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.