bug(moment-adapter): “_rollupMoment__default is not defined”

(related with angular/angular#36248)

Reproduction

https://github.com/kaito3desuyo/angular-test

Steps to reproduce:

  1. clone this repository
  2. ng build --prod
  3. npm i -g http-server
  4. move root directory to dist/angular-test Folder
  5. http-server
  6. open http://localhost:8080

This issue only occurs with production builds.

Expected Behavior

Screen is displayed correctly

Actual Behavior

Screen goes blank with console error

Environment

  • Angular: 9.1.0
  • CDK/Material: 9.2.0
  • Browser(s): Chrome 80.0.3987.149
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 10 x64 1909 18363.720

13 thoughts on “bug(moment-adapter): “_rollupMoment__default is not defined”

  1. Edit: Noted wrong package :/

    Can recreate with "@angular-devkit/build-angular": "~0.901.0"

    “Resolved” with "@angular-devkit/build-angular": "~0.900.7"

  2. @wasiddiqui, ~0.907.0 worked for me.
    My project is using another lib, that was also built with ~0.901.0. once I’ve rebuilt that lib and my project, the issue has gone.
    So you might need to check your dependencies.

  3. I spent some time investigating it and it’s most-likely an issue with build-angular like mentioned above. I’ve narrowed it down to somewhere between 0.900.3 and 0.901.0-next.4. The issue comes from the following lines:

    var Jg = n("wd/R");
    const Zg = _rollupMoment__default || Jg

    Compared to the ones from a working version:

    Ng = n("wd/R"),
    Vg = n.n(Ng).a || Ng

    I’m transferring the issue over to the correct repo.

  4. Have the same problem but with
    main-es2015.8a5dc9b260c775d8aa4b.js:1 Uncaught ReferenceError: dragulaExpt__default is not defined (“@angular-devkit/build-angular”: “~0.901.0”)