Skip to content

3th party lib hammer keep referring to .map files when made production build #2713

Closed

Description

@stefanaerts

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

mac osx

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
angular-cli: 1.0.0-beta.16
node: 6.5.0
os: darwin x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
yes

The log given by the failure.

Normally this include a stack trace and some more information.

image

Mention any other details that might be useful.

When i do ng build --target=production --environment=prod

it keeps generating a reference to js.map file for hammer
image

Then when i do a refresh or redirect in the url i get this message:
Failed to parse SourceMap: https://ethnicfoods-b928a.firebaseapp.com/hammer.min.js.map


Thanks! We'll be in touch soon.

Activity

  1. filipesilva commented on Oct 17, 2016

    @filipesilva
    Contributor

    Fixed in #2519 I believe. If you still have the same problem with the next release, let me know and I'll reopen.

  2. stefanaerts commented on Oct 17, 2016

    @stefanaerts
    Author

    I updated to cli 1.0.0-beta.17
    But i stil see the sourcemapping .
    So to be sure, am I right that there should not be a reference to a map
    file of hammer when i made this build ?
    ng build --target=production --environment=prod

    [image: Inline image 1]

    On Mon, Oct 17, 2016 at 6:31 PM, Filipe Silva notifications@github.com
    wrote:

    Fixed in #2519 #2519 I
    believe. If you still have the same problem with the next release, let me
    know and I'll reopen.

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub
    #2713 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/ADg499xFtDh7GzMYEPOfD49h2dQnc5Idks5q06LsgaJpZM4KXWVW
    .

  3. stefanaerts commented on Oct 17, 2016

    @stefanaerts
    Author

    this is in my angular-cli.json file:
    [image: Inline image 1]

    On Mon, Oct 17, 2016 at 8:22 PM, Stefan Aerts aerts.stefan@gmail.com
    wrote:

    I updated to cli 1.0.0-beta.17
    But i stil see the sourcemapping .
    So to be sure, am I right that there should not be a reference to a map
    file of hammer when i made this build ?
    ng build --target=production --environment=prod

    [image: Inline image 1]

    On Mon, Oct 17, 2016 at 6:31 PM, Filipe Silva notifications@github.com
    wrote:

    Fixed in #2519 #2519 I
    believe. If you still have the same problem with the next release, let me
    know and I'll reopen.

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub
    #2713 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/ADg499xFtDh7GzMYEPOfD49h2dQnc5Idks5q06LsgaJpZM4KXWVW
    .

  4. stefanaerts commented on Oct 17, 2016

    @stefanaerts
    Author

    What does this mean? declaration in unreachable code should be dropped?
    [image: Inline image 1]

    On Mon, Oct 17, 2016 at 8:25 PM, Stefan Aerts aerts.stefan@gmail.com
    wrote:

    this is in my angular-cli.json file:
    [image: Inline image 1]

    On Mon, Oct 17, 2016 at 8:22 PM, Stefan Aerts aerts.stefan@gmail.com
    wrote:

    I updated to cli 1.0.0-beta.17
    But i stil see the sourcemapping .
    So to be sure, am I right that there should not be a reference to a map
    file of hammer when i made this build ?
    ng build --target=production --environment=prod

    [image: Inline image 1]

    On Mon, Oct 17, 2016 at 6:31 PM, Filipe Silva notifications@github.com
    wrote:

    Fixed in #2519 #2519 I
    believe. If you still have the same problem with the next release, let me
    know and I'll reopen.

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub
    #2713 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/ADg499xFtDh7GzMYEPOfD49h2dQnc5Idks5q06LsgaJpZM4KXWVW
    .

  5. filipesilva commented on Oct 17, 2016

    @filipesilva
    Contributor

    Since #2519 didn't fix it for you I'll reopen.

    Can you give me exact repro steps to get this behaviour? If I start with a brand new CLI app, what do I need to do to see it?

    Your last three comments should have images I think, but none appeared here.

  6. stefanaerts commented on Oct 18, 2016

    @stefanaerts
    Author

    1)I install hammerjs, so i have a folder node_modules/hammerjs
    2) i add to angular-cli.json the following configuration:
    "scripts": [
    "../node_modules/hammerjs/hammer.min.js"
    ],

    1. ng build --target=production --environment=prod

    2. So now there is a dist folder:
      This is the content of the folder:
      [image: Inline image 1]

    Do you see the picture above this line?

    So as you can see there is a
    -inline.js

    • main..bundle.js
    • main..bundle.js.gz
    • scripts..bundle.js
    • scripts..bundle.js.gz
      -styles..bundle.js
      -styles..bundle.js.gz
    1. So as there are no js.map files in dist folder i would expect that for
      hammerjs there is no reference anymore to a js.map file in the generated
      scripts.<uniquenumber.bundle.js file.

    But as you can see in thsi picture below this line there is line in the
    file that contains:
    (window,document,"Hammer");\n//# sourceMappingURL=hammer.min.js.map

    [image: Inline image 2]

    1. So when I deploy this to firebase and i open the application(firebase
      url) in my browser i get in the console the message
      Failed to parse SourceMap : https://.
      firebaseapp.com/hammer.min.js.map

    [image: image]
    https://cloud.githubusercontent.com/assets/3684599/19399598/a112a444-9252-11e6-8640-a9c50e3ba1bc.png
    So i guess the angular-cli/webpack chaking/minify/whatever stuff is not
    working correctly for the 3th party hammerjs minified js file ?

    Maybe its because its already minified?

    Kind Regards,
    Stefan.

    On Tue, Oct 18, 2016 at 1:41 AM, Filipe Silva notifications@github.com
    wrote:

    Since #2519 #2519 didn't fix
    it for you I'll reopen.

    Can you give me exact repro steps to get this behaviour? If I start with a
    brand new CLI app, what do I need to do to see it?

    Your last three comments should have images I think, but none appeared
    here.

    —
    You are receiving this because you authored the thread.
    Reply to this email directly, view it on GitHub
    #2713 (comment),
    or mute the thread
    https://github.com/notifications/unsubscribe-auth/ADg49wVRsulfyPMevuA-M0cdmS2jr6rvks5q1AeWgaJpZM4KXWVW
    .

  7. devCrossNet commented on Oct 19, 2016

    @devCrossNet

    @stefanaerts I solved it by referencing the non-minified version of hammer.

  8. stefanaerts commented on Oct 19, 2016

    @stefanaerts
    Author

    @devCrossNet
    As i expected, thanks for verifying.
    @filipesilva So this means we should not include minified files in the angular-cli.json configuration file?
    I also added this line to styles.css
    "@import '~@angular/material/core/theming/prebuilt/deeppurple-amber.css';"

    Thats also gave a reference to a .map file in the dist/styles..bundle.js
    image

  9. filipesilva commented on Oct 23, 2016

    @filipesilva
    Contributor

    @stefanaerts you should be able to use both minified and un-minified versions in the scripts/styles array. I think this is a bug in how we process those files. Will look into it.

  10. added
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Oct 23, 2016
  11. 1 remaining item

  12. self-assigned this
    on Oct 23, 2016
  13. modified the milestone: on Nov 11, 2016
  14. removed this from the milestone on May 2, 2017
  15. added
    freq1: lowOnly reported by a handful of users who observe it rarely
    and removed
    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
    on Feb 1, 2018
  16. mgechev commented on Dec 17, 2018

    @mgechev
    Member

    @stefanaerts would you verify if you hit the issue with the latest CLI? If you do, would you share a minimal example on GitHub so we can reproduce it locally?

  17. mgechev commented on Dec 21, 2018

    @mgechev
    Member

    Closing the issue due to inactivity. If the problem still exists in the latest version of the CLI, please open a new issue following the template and providing a minimal demo where we can reproduce it. Thanks! :-)

  18. angular-automatic-lock-bot commented on Sep 9, 2019

    @angular-automatic-lock-bot

    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.

  19. locked and limited conversation to collaborators on Sep 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions