Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Issues
  • #27119
Closed
Open
Issue created Aug 22, 2018 by Administrator@rootContributor

support native es6 module loading

Created by: rpokrovskij

Bootstrap 4.3 (budnle from dist folder) fails when global is null.

From sources:

(function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery'), require('popper.js')) :
  typeof define === 'function' && define.amd ? define(['exports', 'jquery', 'popper.js'], factory) :
  (factory((global.bootstrap = {}),global.jQuery,global.Popper));
}(this, (function (exports,$,Popper) {...});

There this from next line can't be null since we will get an excpetion on global.bootstrap = {}

And there are situations when this can be null during loading e.g. importing using native module support:

<script type="module">
           import Popper from "./js/popper.js"; // esm version
           window.Popper = Popper;
           import "./js/bootstrap.js"; // TODO : error
           // expected : window.bootstrap created , plugins attached to jquery etc.
</script>

Check sources of jquery. They support this new type of loading by checking (this==null)?window:this.

Assignee
Assign to
Time tracking