You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
3th party lib hammer keep referring to .map files when made production build #2713
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.
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
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
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
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
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"
],
ng build --target=production --environment=prod
So now there is a dist folder:
This is the content of the folder:
[image: Inline image 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]
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
@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
@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.
@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?
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! :-)
Activity
filipesilva commentedon Oct 17, 2016
Fixed in #2519 I believe. If you still have the same problem with the next release, let me know and I'll reopen.
stefanaerts commentedon Oct 17, 2016
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:
stefanaerts commentedon Oct 17, 2016
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:
stefanaerts commentedon Oct 17, 2016
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:
filipesilva commentedon Oct 17, 2016
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.
stefanaerts commentedon Oct 18, 2016
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"
],
ng build --target=production --environment=prod
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
-styles..bundle.js
-styles..bundle.js.gz
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]
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:
devCrossNet commentedon Oct 19, 2016
@stefanaerts I solved it by referencing the non-minified version of hammer.
stefanaerts commentedon Oct 19, 2016
@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

filipesilva commentedon Oct 23, 2016
@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.
1 remaining item
mgechev commentedon 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 commentedon 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! :-)
angular-automatic-lock-bot commentedon Sep 9, 2019
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.