Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.
This repository was archived by the owner on Feb 18, 2024. It is now read-only.

Bootstrap overrides appear incorrect? #1037

@dougludlow

Description

@dougludlow

I've been trying to get bootstrap to work with JSPM, but keep running into issues. I started a new project and went through the following steps:

$ yarn global add jspm@beta
$ jspm init # chose defaults on all except named the main file app.ts
$ jspm install [email protected]
$ touch src/app.ts
$ touch index.html

Add the following to src/app.ts:

import 'bootstrap';
import 'bootstrap/dist/css/bootstrap.css!'

Add the following to index.html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Bootstrap Test</title>
</head>
<body>
    <div class="container">
      <div class="jumbotron">
        <h1>Hello world!</h1>
      </div>
    </div> 

    <script src="jspm_packages/system.js"></script>
    <script src="jspm.config.js"></script>
    <script>
        System.import('app');
    </script>
</body>
</html>

When I serve that up, I see the following error:

Error: Fetch error: 404 Not Found
  Instantiating http://127.0.0.1:8080/jspm_packages/github/twbs/[email protected]/js/bootstrap.js
  Loading http://127.0.0.1:8080/src/app.ts
  Loading app  
system.js:4

When I take a look at the override for [email protected], I see this:

    "main": "js/bootstrap.js",

Looking in the bootstrap github repo (https://github.com/twbs/bootstrap/tree/v3.3.7/js), there is no js/bootstrap.js. This should be dist/js/bootstrap.js.

Downgrading to [email protected] appears to work fine. I'm assuming that is due to the systemjs property in the override which points to the correct main (dist/js/bootstrap.js).

Interestingly enough, when upgrading back to [email protected], it works, but this is because my package.json has kept the 3.3.6 overrides for some reason:

...
      "github:twbs/[email protected]": {
        "shim": {
          "js/bootstrap": {
            "deps": [
              "jquery"
            ],
            "exports": "$"
          }
        },
        "dependencies": {
          "jquery": "2"
        },
        "files": [
          "dist",
          "fonts",
          "js",
          "css",
          "less",
          "grunt",
          "LICENSE"
        ],
        "systemjs": {
          "main": "dist/js/bootstrap.js",
          "modules": {
            "dist/js/bootstrap.js": {
              "deps": [
                "jquery"
              ],
              "exports": "$"
            }
          }
        }
      },
...

jspm version: 0.17.0-beta.40
systemjs version: SystemJS v0.20.9 Dev (bundles with jspm)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions