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

Bootstrap overrides appear incorrect? #1037

Open
dougludlow opened this issue Feb 22, 2017 · 0 comments
Open

Bootstrap overrides appear incorrect? #1037

dougludlow opened this issue Feb 22, 2017 · 0 comments

Comments

@dougludlow
Copy link

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)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant