Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
stefanaerts opened this issue Oct 14, 2016 · 12 comments
Closed
Labels

Comments

@stefanaerts
Copy link

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.

@filipesilva
Copy link
Contributor

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

@stefanaerts
Copy link
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 [email protected]
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
.

@stefanaerts
Copy link
Author

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

On Mon, Oct 17, 2016 at 8:22 PM, Stefan Aerts [email protected]
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 [email protected]
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
.

@stefanaerts
Copy link
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 [email protected]
wrote:

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

On Mon, Oct 17, 2016 at 8:22 PM, Stefan Aerts [email protected]
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 [email protected]
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
.

@filipesilva filipesilva reopened this Oct 17, 2016
@filipesilva
Copy link
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.

@filipesilva filipesilva added the needs: repro steps We cannot reproduce the issue with the information given label Oct 17, 2016
@stefanaerts
Copy link
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 [email protected]
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
.

@devCrossNet
Copy link

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

@stefanaerts
Copy link
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

@filipesilva
Copy link
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.

@filipesilva filipesilva added type: bug/fix command: build P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs: repro steps We cannot reproduce the issue with the information given labels Oct 23, 2016
@filipesilva filipesilva self-assigned this Oct 23, 2016
@hansl hansl modified the milestone: RC1 Nov 11, 2016
@hansl hansl removed this from the RC1 milestone May 2, 2017
@filipesilva filipesilva added freq1: low Only reported by a handful of users who observe it rarely severity1: confusing and removed P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels Feb 1, 2018
@mgechev
Copy link
Member

mgechev commented Dec 17, 2018

@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?

@mgechev
Copy link
Member

mgechev commented Dec 21, 2018

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! :-)

@mgechev mgechev closed this as completed Dec 21, 2018
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants