GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Inability to avoid including `source-map-support` in Karma tests · Issue #13580 · angular/angular-cli

Inability to avoid including source-map-support in Karma tests #13580

New issue
Copy link
New issue
Copy link
Closed
#13584
Closed
Inability to avoid including source-map-support in Karma tests#13580
#13584
Copy link
Labels
area: @angular-devkit/build-angularfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity5: regressiontype: bug/fix
Milestone
Backlog

Description

@badeball
badeball
opened on Feb 2, 2019
Issue body actions

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [x] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

I suspect this is a regression introduced by #13062.

Description

I believe one used to be able to configure through angular.json such that Karma tests would not include the karma-source-map-support plugin. It can now however seem like this plugin is mistakenly always included.

  1. Even though I specify "sourceMap": false in angular.json

  2. Config is normalized

  3. sourceMap option is further normalized

  4. Normalization of sourceMap always ends up with an object

  5. source-map-support is conditionally included, but the condition is always true

🔬 Minimal Reproduction

$ ng new foo
$ cd foo
$ npm install karma-jsdom-launcher jsdom
$ sed -i 's/Chrome/jsdom/g' src/karma.conf.js
$ sed -i 's/chrome/jsdom/g' src/karma.conf.js

Then run ng test and watch the process never exit.

🔥 Exception or Error

I was made aware of this issue in badeball/karma-jsdom-launcher#27. Project of said issue aims to allow jsdom to be used as a target browser. Making synchronous requests like source-map-support does will create a deadlock and halt execution indefinitely.

🌍 Your Environment

$ ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 7.3.0
Node: 11.8.0
OS: linux x64
Angular: 7.2.3
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.0
@angular-devkit/build-angular     0.13.0
@angular-devkit/build-optimizer   0.13.0
@angular-devkit/build-webpack     0.13.0
@angular-devkit/core              7.3.0
@angular-devkit/schematics        7.3.0
@angular/cli                      7.3.0
@ngtools/webpack                  7.3.0
@schematics/angular               7.3.0
@schematics/update                0.13.0
rxjs                              6.3.3
typescript                        3.2.4
webpack                           4.29.0
`` 

Activity

  1. filipesilva commented on Feb 2, 2019

    @filipesilva
    filipesilva
    on Feb 2, 2019
    Contributor
    More actions

    @badeball that's a pretty detailed investigation! As you mentioned in badeball/karma-jsdom-launcher#27 (comment), that really looks like it was introduced with #13062.

    Should be a trivial fix on our side. Sorry about that!

  2. filipesilva
    added a commit that references this issue on Feb 2, 2019

    fix(@angular-devkit/build-angular): use sourcemap object in karma plugin

    e362d7a
  3. filipesilva commented on Feb 2, 2019

    @filipesilva
    filipesilva
    on Feb 2, 2019
    Contributor
    More actions

    Please take a look at #13584 to see if it matches your understanding of the problem.

  4. badeball commented on Feb 2, 2019

    @badeball
    badeball
    on Feb 2, 2019
    Author
    More actions

    Can confirm, this corrects the issue. Thanks the quick response!

    Reacted by Filipe Silva
  5. alan-agius4
    added
    type: bug/fix
    severity5: regression
    area: @angular-devkit/build-angular
    on Feb 4, 2019
  6. ngbot
    added this to the needsTriage milestone on Feb 4, 2019
  7. alan-agius4
    added
    freq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarely
    on Feb 4, 2019
  8. ngbot
    modified the milestones: needsTriage, Backlog on Feb 4, 2019
  9. yogeshgadge commented on Feb 4, 2019

    @yogeshgadge
    yogeshgadge
    on Feb 4, 2019
    More actions

    I am also no longer able to use jsdom - waiting for this to merge.

    Reacted by PLPSDev and JohnLudlow
  10. vikerman
    closed this as completedin #13584on Feb 6, 2019
  11. vikerman
    added 2 commits that reference this issue on Feb 6, 2019

    fix(@angular-devkit/build-angular): use sourcemap object in karma plu…

    e6f96fb

    fix(@angular-devkit/build-angular): use sourcemap object in karma plu…

    acc31ba
  12. JohnLudlow commented on Feb 6, 2019

    @JohnLudlow
    JohnLudlow
    on Feb 6, 2019
    More actions

    @vikerman We're still getting karma-source-map-support included when we do npm install. I guess the 'fix' was to make it not fall over on build/test?

    We have a different issue. They have no license file, which causes a compliance issue for us (yes, even for dev dep). There was an issue raised 14 months ago: tschaub/karma-source-map-support#16

    There was a PR in September: tschaub/karma-source-map-support#22

    We're a little worried the project might be inactive, and we were hoping that this issue would remove that dependency.

  13. filipesilva commented on Feb 6, 2019

    @filipesilva
    filipesilva
    on Feb 6, 2019
    Contributor
    More actions

    #13584 wasn't meant to remove the dependency, just to not use it depending on the provided options.

  14. JohnLudlow commented on Feb 6, 2019

    @JohnLudlow
    JohnLudlow
    on Feb 6, 2019
    More actions

    @filipesilva thanks for the quick response!

    Yeah we're seeing that's the case now. What's the best way to proceed? I'm not sure raising an issue or PR for karma-source-map-support is worthwhile because that's already been done by other people.

    Should I raise a new issue against angular-cli (or a different project?) to consider removing that as a hard dependency?

    In general, it'd be nice to not have that as a hard dependency because maybe we don't use Karma or sourcemaps in that way, and a project kicking around 'just coz' will likely cause issues.

  15. filipesilva commented on Feb 6, 2019

    @filipesilva
    filipesilva
    on Feb 6, 2019
    Contributor
    More actions

    I'm sorry to say but we don't use a modular approach in @angular-devkit/build-angular. It's architecture is meant to include everything it might use. There are a few exceptions, like TypeScript, Protractor, Karma, and the Karma plugins referenced in the karma config.

    But karma-source-map-support is not referenced in the config, and is something we add internally based on some conditions. It's somewhat like scss/less/stylus: you might not use them, but we don't add them on the fly.

    Realistically speaking this could happen. But I don't think it will happen on the timeframe you'd like it to happen. It's a fair bit of work and not a priority.

    So I think your best chance right now is to get the karma-source-map-support maintainer to accept the PR you need in. We're happy enough accepting a substitute for that plugin but would be fairly strict in accepting that, because source map support is hard to validate.

  16. JohnLudlow commented on Feb 7, 2019

    @JohnLudlow
    JohnLudlow
    on Feb 7, 2019
    More actions

    :grumble:

    Ok, thanks. We'll try and get his attention

  17. JohnLudlow commented on Feb 8, 2019

    @JohnLudlow
    JohnLudlow
    on Feb 8, 2019
    More actions

    @filipesilva Looks like we succeeded - tschaub/karma-source-map-support#22 was merged.

    Thanks

  18. filipesilva commented on Feb 8, 2019

    @filipesilva
    filipesilva
    on Feb 8, 2019
    Contributor
    More actions

    Awesome! Renovate bot has picked it up already #13623. Should go in the next major/minor version, which is 8.0 at this point.

    Reacted by JohnLudlow
  19. angular-automatic-lock-bot commented on Sep 9, 2019

    @angular-automatic-lock-bot
    angular-automatic-lock-botBot
    on Sep 9, 2019
    More actions

    This issue has been automatically locked due to inactivity.
    Please file a new issue if you are encountering a similar or related problem.

    Read more about our automatic conversation locking policy.

    This action has been performed automatically by a bot.

  20. angular-automatic-lock-bot
    locked and limited conversation to collaborators on Sep 9, 2019
  21. mostafaibr
    added a commit that references this issue on May 29, 2026

    fix(@angular-devkit/build-angular): use sourcemap object in karma plu…

    4c18cd3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: @angular-devkit/build-angularfreq1: lowOnly reported by a handful of users who observe it rarelyOnly reported by a handful of users who observe it rarelyseverity5: regressiontype: bug/fix

    Type

    No type

    Projects

    No projects

      Milestone

      • BacklogNo due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.