text:
Update dependencies

I get a lot of deprecation warnings when running "npm install". Looks like a lot of the dependencies are set to a specific version and many of those are out of date. Most of them are dev dependencies but it's still worth keeping things up to date.
-Update dependencies as much as possible.
-Change the package to at least get bug fix versions. (i.e. change "1.2.3" to "^1.2.3")

What Node and NPM versions are you running?

Node 4.4.7
NPM 2.15.8

A little behind but not excessively. That wouldn't effect the out of date dependencies though.

You're right. I would expect the module to work fine with Node 4 and up.

I just double checked this, and this is showing in console for every version of Node since 4, and seems to be a problem of our dependencies. I'm closing this since we can't have control over those.
Node: v4.7.0
NPM: 2.15.11
Node: v5.12.0
NPM: 3.8.6
Node: v6.9.2
NPM: 3.10.9
Node: v7.2.1
NPM: 3.10.10

We can have control by updating our dependencies. For instance in package.json  "commitizen" is set to "2.7.2". It won't even get bug fix updates let alone minor version updates. A few other of the devdependencies are set that way too. Keeping those more updated would be a good idea.
Even is some of the deprecations are for dependencies of our dependencies, by keeping ours updated that means its more likely those will be updated too (for instance, I see commitizen 2.8.0 updated its dependencies).

@derikb Ok, I'm going to double check. Reopening.

authors: andresdavid90 andrscrrn derikb


text:
🛑 nhcam is down

In 15dea01, nhcam ($NHIPCAM) was down:

HTTP code: 0
Response time: 0 ms

Resolved: nhcam is back up in a471a7c.

source: gharchive/issue

repo: andrewdavies-net/upptime

license: MIT

license_type: permissive

license_source: github-api


text:
🛑 plexd is down

In fa92f2d, plexd ($PLEXD) was down:

HTTP code: 401
Response time: 474 ms

Resolved: plexd is back up in 6e40380.


text:
🛑 nhcam is down

In 3bf04b7, nhcam ($NHIPCAM) was down:

HTTP code: 0
Response time: 0 ms

Resolved: nhcam is back up in 2fed80d.


text:
🛑 plexd is down

In 1023897, plexd ($PLEXD) was down:

HTTP code: 401
Response time: 472 ms

Resolved: plexd is back up in e9937f2.


text:
🛑 nhcam is down

In 5533adf, nhcam ($NHIPCAM) was down:

HTTP code: 0
Response time: 0 ms

Resolved: nhcam is back up in b499be3.


text:
How do I use it like LSTMLayer in torch

I want to use this code like Torch.nn.LSTM, but I'm having problems with the data applied to (batch, len, emb), and I sincerely request that you continue to present the code in batch

If you prefer to have the batch dimension first, you can set the batch_first=True parameter when initializing the LSTM. This changes the expected input shape to (batch, seq_len, input_size).
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pad_sequence, pack_padded_sequence, pad_packed_sequence
Example parameters
input_size = 10  # Number of features per timestep
hidden_size = 20 # Number of features in hidden state
num_layers = 2   # Number of recurrent layers
Creating the LSTM
lstm = nn.LSTM(input_size, hidden_size, num_layers, batch_first=True)
Example data (list of tensors of varying lengths)
data = [torch.randn(5, input_size), torch.randn(3, input_size), torch.randn(6, input_size)]
Padding sequences and creating a batch
padded_data = pad_sequence(data, batch_first=True)
lengths = torch.tensor([len(x) for x in data])
Packing the padded sequences
packed_input = pack_padded_sequence(padded_data, lengths.cpu(), batch_first=True, enforce_sorted=False)
Feeding the packed batch to the LSTM
packed_output, (hidden, cell) = lstm(packed_input)
Unpacking the output
output, output_lengths = pad_packed_sequence(packed_output, batch_first=True)
Processing outputs...
print(output.shape)  # [batch, seq_len, num_directions * hidden_size]

repo: andrewgcodes/xlstm


text:
🛑 Gioia News is down

In 1089934, Gioia News (https://gioia.news) was down:

HTTP code: 0
Response time: 0 ms

Resolved: Gioia News is back up in 757203a after 7 minutes.

repo: andrewgioia/status


text:
Missing functions

Looking at std::fs, for the functions I was using in my project, I was missing hard_link, soft_link, rename. Could these be added?

soft_link is deprecated. Would your use case be solved by exposing the platform specific replacements (std::os::unix::fs::symlink and std::os::windows::fs::{symlink_file, symlink_dir}) instead?

I'd have been happy without soft_link, given its deprecated - but thanks for the inclusion anyway!

authors: andrewhickman ndmitchell

repo: andrewhickman/fs-err


text:
Docs: "Source" link points to wrong source code lines on GitHub

Hi.
The Source link on the API Documentation page (which is located at the bottom of each function description)  points to wrong source code lines on GitHub (at least for Functions)

Hi, thanks for this!
I think it's because I'm linking to the "master" branch which gets out of sync. There's a big release coming up so I'll make sure it links to the right version blob at that time.
Thanks!

Actually scratch that... this was a very minor fix so just fixed it!

authors: andrewplummer vinogradov

repo: andrewplummer/Sugar

license: mit

license_source: bigquery


text:
Permit 13881 will not print

Permit 13881 will not print.

Issue resolved - was not printing because it had District Manager as approver.

repo: andrewviren/PPRstat

license: isc


text:
Unable to authenticate

When authenticating with calendar_auth() I run into the below issue.

I have a similar issue

sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS

Matrix products: default
BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8
 [4] LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8
 [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                  LC_ADDRESS=C
[10] LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] gcalendr_0.2.1.9004

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7         later_1.2.0        pillar_1.6.1       compiler_4.1.0
 [5] jrApiGitLab_0.1.13 prettyunits_1.1.1  remotes_2.4.0      jrApiUtils_0.2.2
 [9] tools_4.1.0        pkgbuild_1.2.0     jsonlite_1.7.2     gargle_1.2.0
[13] lubridate_1.7.10   lifecycle_1.0.0    tibble_3.1.3       pkgconfig_2.0.3
[17] rlang_0.4.11       rstudioapi_0.13    cli_3.0.1          curl_4.3.2
[21] yaml_2.2.1         httr_1.4.2         withr_2.4.2        dplyr_1.0.7
[25] stringr_1.4.0      askpass_1.1        rappdirs_0.3.3     fs_1.5.0
[29] generics_0.1.0     vctrs_0.3.8        rprojroot_2.0.2    tidyselect_1.1.1
[33] glue_1.4.2         R6_2.5.0           processx_3.5.2     fansi_0.5.0
[37] jrApiAsana_0.1.1   tidyr_1.1.3        purrr_0.3.4        callr_3.7.0
[41] magrittr_2.0.1     promises_1.2.0.1   ps_1.6.0           ellipsis_0.3.2
[45] timeDate_3043.102  httpuv_1.6.1       utf8_1.2.2         stringi_1.7.3
[49] openssl_1.4.4      crayon_1.4.1

Calender only allows oauth route I believe.

authors: JosiahParry RMHogervorst jamieRowen

repo: andrie/gcalendr


text:
How to extract API method calls from dex file using androguard...?

I'm interested to implement an android app's malware detection with deep learning methods.
The Neural Network's input is the raw sequence of the app's API method calls which must be extracted from the DEX files. I have written a code to do this. Would you please check it in order Not to have a mistake. Great Thanks:)
from androguard.misc import AnalyzeAPK
import os
import time

def EXTRACT_METHOD_CALLS(a):
    app, list_of_dex, dx = AnalyzeAPK(a)
    for method in dx.get_methods():
        file.write("inside Method {} ".format(method.name) + ':' + '\n')
        for _, call, _ in method.get_xref_to():
            file.write("    calling -> {} -- {}".format(call.class_name, call.name) + '\n')

begin = time.time()

for apk in os.listdir():
    file_name , file_extension = os.path.splitext(apk)
    file = open(file_name + '.txt', 'w')
    EXTRACT_METHOD_CALLS(apk)
    file.close()

end = time.time()

print(end-begin)

I'm not sure if I understand the topic correctly, but if you say "sequence of the app's API method calls", you need the order or not? If you need the order, you should sort by the offset you get as the third value of the return tupe from get_xref_to.
Next, you never specify what do you mean by "API method calls". Then, you can filter the XREFs according to your definition of that and proceed from there.
If you take a look at several dex files, you will see that not only java.* or android.* are regarded as external classes, but all kinds of classes are external, as they are loaded dynamically. Thus you really need to specify what is an API and what is just not resolved at the time of Analysis.
Malware detection using deep learning sounds very interesting!

As a matter of fact, I couldn't understand what 'API Method calls' mean exactly just like U...:)
I saw it in a journal paper and asked them to explain but didn't answer.

Hi again :)
As you know, API is an interface which helps Applications or software talk to together. Suppose that you decide to develop an application like Uber which helps taxi drivers find their paths.
how do you work on it...?

you can sit and develop a complete map for your application
use google map API.

Now if come back to our problem, most of the applications written in Java and use Android APIs.
by this explanation, the above code does this or not...! :)

I know what an API is ;) But what you mean by "sequence of ...." is not clear.
One problem is, that branches inside the method lead to different code paths on execution time.
One big question is now how you can normalize this in order to give the same sequence for the same code.
For example, what if you have two code blocks, one like if x > 0 then A else B and the other like if x <= 0 then B else A. In both cases the code leads to the same result, but if you just dump the sequence inside the bytecode you end up with A B for the first case and B A for the second one.
Yet another problem is the exact definition of API. Obvious there are very many different APIs on Android. First of all there is the Java API. Then there is the Android API, then the GCM API, Google Play Services, ... And then there are apps using dynamically loaded code - which looks like an API for androguard, as the reference to the method can not be statically determined.
In order to only gather the "official" APIs , you need to come up with some sort of whitelist - which is very hard!

hi androguard is a good tools but many of code are broken and undocumented.
for example i tested  method.get_xref_to():  it returns an empty set.

authors: SamiraSadat its-me-abi reox

repo: androguard/androguard


text:
Screen Flashing when Recording in Camera2Video

When testing on an emulator and any device really, the screen flashes when we record video. I understand it is due to the repeating animation but it is not natural behaviour and looks like a bug along with taking up system resources to show the animation during an intensive task such as recording video.
I suggest there to be a flash at the start and end of recording video and no repeating animation.
Device model: sdk_gphone_x86_arm
Build number: sdk_gphone_x86_arm-userdebug 11 RSR1.201013.001 6903271 dev-keys
It's not an error so not attaching any logs.

I am having this 'issue' as well. As you said, it's not an error, but it certainly doesn't look great for official sample code.
I am testing on an LG-H933 running Android 9.

Got the same problem here and didn't event notice it was because of an animation... Thanks for the info

authors: amazingvoice emersonk mdsheraj123

repo: android/camera-samples


text:
Disconnect client

I have a problem with discoverability of the device and the reconnection after i disconnect from a client.
The only solution was to reboot the rpi and i be able to re-discover and re-connect from my client app.
If you have some advice for resolving this issue.
EDIT: I have an Error 133 (0x85) when i tried to reconnect.

I faced the same issue.

authors: edouardouvrard nlhien


text:
Sometimes controller.currentPositon is bigger than controller.duration when play end.

Media3 Version
1.0.0-beta01
Devices that reproduce the issue
Samsung galaxy note 10 5G running Android 11
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps

Just play the audio attached
Open it, drag the seekbar to where a few second left
Wait it play end
Print the MediaController.getDuration and MediaController.getCurrentPosition, you will find that the latter is greater than the former, 900ms.
if it does not appear, repeat.Usually two to three times.

Expected result
The difference should not exceed 100ms I think.
Actual result
The difference is close to a second.
Media
Help (Sunset Rollercoaster 落日飛車 Remake) - 혁오 (HYUKOH) _ 落日飛車.mp3.zip
Bug Report

[ ] You will email the zip file produced by adb bugreport to dev.exoplayer@gmail.com after filing this issue.

I can repro this with the attached media in the demo app. The duration is 4.12 and the timebar goes to 4:13 when the songs play ends.

Seeking in MP3 files is known to be inaccurate due to limitations in the format. See https://github.com/google/ExoPlayer/issues/7767#issuecomment-677760688 for more explanations. You can work around this by setting Mp3Extractor#FLAG_ENABLE_INDEX_SEEKING in DefaultExtractorsFactory.setMp3ExtractorFlags. But note that this setting should only be used for relatively short MP3 files like this one.

authors: XuQK marcbaechinger tonihei

repo: androidx/media


text:
detection error

Hi,
I tried to detect the bounding boxes with pretrained weights. But I am facing the error.
Pytorch version in my system : 0.4.1.post2
Error Mesage :
Can you please suggest the fix.
Loading weights from yolov3.weights... Done!
data/dog.jpg: Predicted in 1.102185 seconds.
3 box(es) is(are) found
Traceback (most recent call last):
File "detect.py", line 113, in
detect(cfgfile, weightfile, imgfile)
File "detect.py", line 39, in detect
plot_boxes(img, boxes, 'predictions.jpg', class_names)
File "/home/hareeshkumawat/GitHub/adv/A3/utils.py", line 305, in plot_boxes
print('%s: %f' % (class_names[cls_id], cls_conf))
TypeError: list indices must be integers or slices, not float

@hareesh00
in 304th line, change cls_id = int(box[6]).
After version upgrading,  array index may be stricted.

但是修改之后又出现了这个问题：
Traceback (most recent call last):
File "detect.py", line 113, in
detect(cfgfile, weightfile, imgfile)
File "detect.py", line 39, in detect
plot_boxes(img, boxes, 'predictions.jpg', class_names)
File "/public/home/G19850028/RWJ/pytorch-0.4-yolov3-master/utils.py", line 312, in plot_boxes
drawtext(img, (x1, y1), text, bgcolor=rgb, font=font)
File "/public/home/G19850028/RWJ/pytorch-0.4-yolov3-master/utils.py", line 275, in drawtext
img.paste(box_img, (sx, sy))
File "/public/home/G19850028/zheng/Anacoda3/public/home/G19850028/anacoda35/envs/pytorch0.4/lib/python3.6/site-packages/PIL/Image.py", line 1472, in paste
self.im.paste(im, box)
TypeError: integer argument expected, got float
这要怎么修改？谢谢

@sdustdk1427 Ok, you change the 271th codes as :
sx, sy = int(pos[0]), int(pos[1]-th-2)
I'll update the code.


text:
Prevent recursivelly triggering img.onload

Hi! I just noticed in my project that if I set a defaultImage when initializing picEdit, I couldn't change it. It's because the plugin was overriding the new picture with the default one. Adding a console.log(1) to the function assigned to img.onload on line 421, I also noticed that img.onload was kicking itself infinite times, so I just added this img.onload=null; at the end of the event so it is called just once after a picture change.
Cheers!

Thanks for this!

Heya!
My pleasure, thank you for putting this up and sharing. Great job indeed!
Paulo Amaral
site http://paulodev.com | linkedin http://www.linkedin.com/in/paulodev
| twitter https://twitter.com/paulo_dev | github
https://github.com/paulera
On 16 February 2016 at 21:29, Andy V. notifications@github.com wrote:

Thanks for this!
—
Reply to this email directly or view it on GitHub
https://github.com/andyvr/picEdit/pull/44#issuecomment-184881892.

source: gharchive/pull-request

authors: andyvr paulera

repo: andyvr/picEdit


text:
Add control-plane chart

A first version of control-plane chart

 Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

authors: CLAassistant sboukhetta


text:
TLS Handshake failed/key negotiation failed IPv6

Im new to this OpenVPN stuff. My problem is that im behind NAT and i can only access WAN/internet via IPv6. If i connect via ipv4 everything works (internaly). For configuration i followed the script and some guide. If you need more info please ask.

The script supports configuring an IPv6 address, did you answer the questions correctly? Also make sure to use your public reachable IPv6 address to connect.

The script supports configuring an IPv6 address, did you answer the questions correctly? Also make sure to use your public reachable IPv6 address to connect.
Posting server and client logs would help. You can replace the sensitive information.

Yes i think i answered the question correctly. Im also able to ping the IPv6.
What logs would you need?

repo: angristan/openvpn-install


text:
not working

hi
first of all thank you for making this. also I want to point out that is not working for me
AttributeError: type object 'AuthHandler' has no attribute 'client_client_handler_table'
what am I doing wrong ?

Sounds like an error in the cryptography library. What's the full
input/output
On Wed, 6 July 2022, 05:44 c0d3x27, @.***> wrote:

Closed #2 https://github.com/angry-bender/SUOPE/issues/2 as completed.
—
Reply to this email directly, view it on GitHub
https://github.com/angry-bender/SUOPE/issues/2#event-6937041303, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AEKSTKIO663JZGKOM3KP4YDVSSGBXANCNFSM52XEW2HA
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

fixed already thank you again

No worries, Good code courtesy is to let people know how to fix it in case
they have the same issue, or, so a coder can fix it 🙂
If you wouldn't mind letting us know that would be awesome.
On Wed, 6 July 2022, 11:25 c0d3x27, @.***> wrote:

fixed already thank you again
—
Reply to this email directly, view it on GitHub
https://github.com/angry-bender/SUOPE/issues/2#issuecomment-1175668439,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AEKSTKM77U3ZGPPQKF7NLT3VSTOBNANCNFSM52XEW2HA
.
You are receiving this because you commented.Message ID:
@.***>

repo: angry-bender/SUOPE


text:
[FEATURE REQUEST] Angular material version

Would you ever consider making an angular material version? I think this would be a great addition.

You can use angular material with the following html as a Custom Template as specified in the README.md file

    Every:
    <md-select class="cron-select" ng-model="myFrequency.base" aria-label="Select frequency type">
        <md-option ng-value="opt.value" ng-repeat="opt in frequency">{{opt.label}}</md-option>
    </md-select>
     on
    <md-select ng-show="myFrequency.base == 4" class="cron-select day-value" ng-model="myFrequency.dayValue" aria-label="Week number">
        <md-option ng-value="opt" ng-repeat="opt in dayValue">{{opt | dayName}}</md-option>
    </md-select>
    = 5"> on the
    <md-select ng-show="myFrequency.base >= 5" class="cron-select day-of-month-value" ng-model="myFrequency.dayOfMonthValue" aria-label="day of month">
        <md-option ng-value="opt" ng-repeat="opt in dayOfMonthValue">{{opt | numeral}}</md-option>
    </md-select>
     of
    <md-select ng-show="myFrequency.base == 6" class="cron-select month-value" ng-model="myFrequency.monthValue" aria-label="Month number">
        <md-option ng-value="opt" ng-repeat="opt in monthValue">{{opt | monthName}}</md-option>
    </md-select>
    = 2"> at
    <md-select ng-show="myFrequency.base >= 3" class="cron-select hour-value" ng-model="myFrequency.hourValue" aria-label="hour">
        <md-option ng-value="opt" ng-repeat="opt in hourValue">{{opt}}</md-option>
    </md-select>
    = 3"> :
    <md-select ng-show="myFrequency.base >= 2" class="cron-select minute-value" ng-model="myFrequency.minuteValue" aria-label="minute">
        <md-option ng-value="opt" ng-repeat="opt in minuteValue">{{opt}}</md-option>
    </md-select>
     past the hour

Cool thanks

I suggest a "more" Material template:

  <md-input-container flex>
    Every
    <md-select ng-model="myFrequency.base">
        <md-option ng-value="item.value" ng-repeat="item in frequency">{{item.label}}</md-option>
    </md-select>
  </md-input-container>
  <md-input-container ng-show="myFrequency.base == 4" flex>
    on
    <md-select ng-model="myFrequency.dayValue">
      <md-option ng-value="value" ng-repeat="value in dayValue">{{value | cronDayName}}</md-option>
    </md-select>
  </md-input-container>
  <md-input-container ng-show="myFrequency.base >= 5" flex>
    on the
    <md-select ng-model="myFrequency.dayOfMonthValue">
      <md-option ng-value="value" ng-repeat="value in dayOfMonthValue">{{value | cronNumeral}}</md-option>
    </md-select>
  </md-input-container>
  <md-input-container ng-show="myFrequency.base == 6" flex>
    on
    <md-select ng-model="myFrequency.monthValue">
      <md-option ng-value="value" ng-repeat="value in monthValue">{{value | cronMonthName}}</md-option>
    </md-select>
  </md-input-container>
  <md-input-container ng-show="myFrequency.base >= 3" flex>
    at hour
    <md-select ng-model="myFrequency.hourValue">
      <md-option ng-value="value" ng-repeat="value in hourValue">{{value}}</md-option>
    </md-select>
  </md-input-container>
  <md-input-container ng-show="myFrequency.base >= 3" flex>
    and minute
    <md-select ng-model="myFrequency.minuteValue">
      <md-option ng-value="value" ng-repeat="value in minuteValue">{{value}}</md-option>
    </md-select>
  </md-input-container>
  <md-input-container ng-show="myFrequency.base == 2" flex>
    at minute
    <md-select ng-model="myFrequency.minuteValue">
      <md-option ng-value="value" ng-repeat="value in minuteValue">{{value}}</md-option>
    </md-select>
  </md-input-container>

Tried using your template but values are not showing up.

I haven't used angular in ages.

authors: AntonisFK QuantumInformation jacobscarter menegazzo

repo: angular-cron-jobs/angular-cron-jobs


text:
README fixes

Markdown syntax and formatting fixes in README.md

Coverage remained the same at 87.273% when pulling a26e5769ae23f95c882bae1fe43f640eb2dba4af on jamesevickery:patch-1 into 87e0adb3b6a1025e55e3ebea1e5423feb1010ef6 on angular-cron-jobs:master.

authors: coveralls jamesevickery


text:
How's the state of this fork?

I just tried using your fork on a website of mine which already used Spectre and it worked like a charm. Implementing dark mode using CSS variables was easy! The only things I had to change is changing table padding back to what it was before and handling special cases for the dark mode.
Because I use PurgeCSS, which handles CSS variables, the built CSS file size is still quite small. That makes me think: maybe you can add a page about how to use PurgeCSS to make the file size smaller. Anyway, that's not the point...
The point is: is this fork being maintained, but no updates are being done as it seems complete, or it's not being maintained?

I am working on 1.0 version of  https://github.com/angular-package/sass. Then it will be implemented in spectre dev. You can add PurgeCSS and join to add some updates to the latest version.

authors: qgustavor sciborrudnicki


text:
Discussion: Develop/release flow

So there are a few things I wanna discuss with you guys, since a lot of things have changed in the past due to the switch to a separate organization. The code is getting complex and we have to work with several repositories rather than just one. At the same time we have to move forward and try to push angular-translate to the edge of technologies to be prepared for the future :).
So here are the points I wanna discuss with you and I would really like to hear your thoughts/ideas/opinions on them:

Redesign build process
Switching from grunt to gulp
Switching from ngdocs to dgeni
Automate build/release process
Consider switching to ES6
Package manager agnostic repos

Redesign build process
The current build process is pretty straight forward. However, I think it needs some more love. We should talk about what tasks we really need and how to handle these processes when working with several repositories. This goes hand in hand with the second point.
Switching from grunt to gulp
You might heard of it, I like it. Gulp is a stream based task runner, which makes build processes faster. There are already plenty plugins and they all do just one thing, which is great. I would like to rebuild our build processes with gulp and kick grunt.
Switching from ngdocs to dgeni
The great @petebacondarwin is currently building a very flexible and extendable document generator called dgeni. It generates templates that represents our docs. Then there's a separate angular app that runs with these templates. We are currently sitting on grunt-ngdocs which did a great job but the following things speak against it:

we probably switch to gulp, so the grunt plugin doesn't work for us anymore
grunt-ngdocs is just the ngdoc generator pulled out of the angular source and hardcoded as grunt plugin. It's uses twitter bootstrap and feels kinda buggy in recent versions

Automate build/release process
So we have several repositories now. We have the source repo, we have a repo for docs and there's a repo for each extension as bower package. We should talk about how to make releases as easy as possible because currently, updating the docs is a pain in the ass. Also pushing the latest source to the package repos is a repetitive task that could be automated. I need help on that.
Consider switching to ES6
The angular core team does it and I think it's a good thing. I would like to build angular-translate in ES6 too, just to learn about the new syntax. We also don't have to rewrite it in the future, once es6 features land in browsers :)
Package manager agnostic repos
There are several bower repositories for our extensions and the source itself. We can publish these packages as npm modules too, and there were already a few requests for it. I think we should do it, since it's a win win. But we should consider renaming the repos and make them package manager agnostic. With package manager agnostic I don't mean to remove everything that has too much detail about a package manager, but make them at least work with other package manager (talking npm and bower).
Okay, that's all I have team @angular-translate

:ghost: What's up?

We don't have and will probably not changing the process.

authors: PascalPrecht knalli

repo: angular-translate/angular-translate


text:
Bug in our software lead me to documentation error: $translate.preferredLanguage

It says "Returns the language key" but language key is a parameter so it is confusing to me.  Then is says that is returns the preferred language key.  I'm investigating a bug in our code and came across this method.  I wonder if having a bit more docs on this method would have helped avoid the bug..
See: http://angular-translate.github.io/docs/#/api/pascalprecht.translate.$translate
preferredLanguage(langKey)

Returns the language key for the preferred language.

Parameters
Param	Type	Details
langKey	string
language String or Array to be used as preferredLanguage (changing at runtime)

Returns
preferred language key

https://github.com/angular-translate/angular-translate/blob/master/src/service/translate.js#L1377-L1382

We had calls in our code to try and change the preference via calls to $translate.use("...") ..   I changed those call to $translate.preferredLanguage("...") and got much better behaviour.  Maybe a small note under "use" that says call preferredLanguage to actually change the preferredLanguage.  You suggested update sounds great.  Thank you..

I fixed the title .. sorry about that ;)

authors: DWand jcalfee


text:
fix(datepicker): min-date: timezone fix for literals

fixes #3437
original plunker, with pr code: http://plnkr.co/edit/jsfOVBZj51yajpZYkC9N?p=preview
maintainer plunker, with pr core: http://plnkr.co/edit/buQXUxndajMYFOZorzq9?p=preview

Fix formatting - an easy way to see what is off is to rebase off of current master, run npm install, and run grunt eslint.

Not sure what formatting needs fixing. I rebased and ran grunt eslint: Done, without errors

As a rule of thumb, the code should look like the surrounding code - the whitespace differences are pretty stark in this case, or lack of whitespace.

Thinking about this problem for a bit, I am not sure we want to support this date format in the long run - it would be much better if it required a date object from the user's side as a breaking change, which would prevent the timezone issue, and allow the user the flexibility to specify the timezone of the min date.

Whoops... just realized this is an American biased solution and does work for East Europe and Asia

Changed the code to simply parse dates:

We now expect literal min-date and max-date to match the displayFormat; otherwise, it will not work at all
If they want to use an alternate format, they can indicate it in alt-input-formats

This fixes the underlying problem in issue #3437, which is that javascript parses yyyy-MM-dd as GMT; see https://github.com/angular-ui/bootstrap/issues/3437#issuecomment-160008324

Just realized that the concepts of display format and alt-input-formats does not exist for the datepicker itself. So, this would still be an issue for the datepicker; and, the different behavior of min-date/max-date would be confusing.

OK. Switched to using dateFilter to feed new Date for these literal cases.

@wesleycho would you re-review?

Only thing I hesitate on is the assumption of the medium format in the dateFilter usage - I guess I'm ok with that, but it needs to be mentioned in the documentation.

The medium format is an internal format picked "at random"... Any format that indicates all the possible date information would do the trick. It doesn't impact the parse work.

Guess I'm fine with it - LGTM then

authors: davious wesleycho

repo: angular-ui/bootstrap


text:
guessSortFn - where to use?

doc with no example
Should this be set in columnDefinitions? Like so:
{"name": "some_numbers", "sortingAlgorithm":  guessSortFn("number")}

I've got this issue (rc-21) where its sorting the numbers 10, 75, and 300. When sorting Descending, 75 is the 'top value', then 300, then 10. As if it thinks they are strings and doing alphabetical sort, I want to force a numerical sort.

If you set the type of the column to (IIRC) numberStr it should work.

Oh, so it automatically picks a sorting algorithm based off of the columns type attr. Thanks, that's worth documenting. That did work.
{"name": "some_numbers", "type": "number"}

is there a type: 'percentage' ?

No, but I'd guess type: 'numberStr' might work - I think that treats a string as a number and attempts to parse it as such.  I'd guess that means we end up sorting the numeric characters as a number, and ignoring the percentage sign.
Of course, if I had a column that had percentages in it, I'd store it as a decimal number and use a cellFilter to display it as a percentage.  That'd make it much easier to work with.

repo: angular-ui/ng-grid


text:
Mask not being properly formatted

I have the following input:
   <input type="text" id="cpfcnpj" ng-model="PersonalIdentificationNumber" ui-mask-placeholder="" ui-mask="000.000.000-00" name="PersonalIdentificationNumber" model-view-value="true" required="" readonly="" class="ng-pristine ng-not-empty ng-valid ng-valid-required ng-touched">
But when I receive data to fill the input and apply that same data to the ng-model:
    $scope.PersonalIdentificationNumber = result.Result.PersonalIdentificationNumber;
The mask is not being properly formatted. Instead of 000.000.000-00 I get 00000000000.
Already tried this solution and also with: $("#cpfcnpj").attr('mask', '000.000.000-00'); But none of them works.

Just found what was wrong with it:
I set the mask to: '999.999.999-99';

repo: angular-ui/ui-mask


text:
Dynamic query string

Is there any way to load state with query string without mention query string in state.url? For example,
I am writing routes like:

state('advanced-search', {
url: '/advanced-search?genre&length&instrumental&q&decade&searchInstrument&tempo'',
templateUrl: 'partials/songs.html',
controller: 'AdvancedSearchController'
})

Is there anyway to use it like:
...

url: '/advanced-search?path*,

without loosing query string from url.

At this time there is not a way to do that, sorry

No but if you are just using those values in the controller you can use vanilla angular's $location.search()  to retrieve them.
If this doesn't solve your problem, can you please clarify what you are trying to do?

authors: christopherthielen eddiemonge umair321

repo: angular-ui/ui-router


text:
Apache Rewrites for HTML5 mode give server error

I have copied the example app, running XAMPP. But for some reason Apache can't even find the index.html file.
What I did:

I am using Angular 1.5.8 (the latest version)

I have set a base tag. I am not on the root level, but on /my-application/, so I've set it like this:

     <base href="/test/">

I have added an .htaccess file in the /my-application/ directory, like the :

<VirtualHost *:80>
   #I don't know what ServerName actually means, so I just set it to "localhost"
    ServerName localhost

    DocumentRoot "D:\xampp\htdocs\test"

    <Directory "D:\xampp\htdocs\test">
        RewriteEngine on

        # Don't rewrite files or directories
        RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -d
        RewriteRule ^ - [L]

        # Rewrite everything else to index.html to allow html5 state links
        RewriteRule ^ index.html [L]
    </Directory>
</VirtualHost>

All I get is an "500 Internal Server Error!". I don't know what I am doing wrong. I have tried DocumentRoot with the slashes in the other direction, I've tried:
Listen 85
<VirtualHost *:85>

... in case some port would be blocked, nothing. I don't know what to do.
The only thing that somehow worked, was this:
FallbackResource /test/index.html
BUT: The pages do not allow for bookmarking and they load very slow (I get an error about Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING). But at least Apache is finding the index.html

Your base ref looks like it should be "/" since your docRoot is /test.
This is a better question for stackoverflow since its apache (on Windows) and not a ui-router bug.

authors: eddiemonge sharazam


text:
Bug on  change  ng-disable when using  Multiple Select

Hello every body
I'm using ui-select on my project
But I have some problem:
When after select any item in ui-select-choices, I want temporary disable multiple select an display some input fields for user input (required)
But it's disabled only  but not hidden or  if I not click Outside To Close
I had been used:

{{$item.name}} -{{$item.reward}}

                                email: {{person.email}}
                                age:

Selected: {{multipleDemo.selectedPeopleWithGroupBy}}  -- {{counter}}

After select,  I using onSelectCallback to disable box...

I'm resolve problem by tag
close-on-select="true"

repo: angular-ui/ui-select


text:
ng-required on angular >1.3 clearing out ng-model

here's a plunkr that illustrates the issue
http://plnkr.co/edit/MZzbHfhjywvELRwiODEF
if you remove ng-required='true' everything works as expected.

This appears to work fine in the latest version of the library.
Closing.


text:
Clicking dropdown option doesn't select element

Hey, folks! I am running Angular 1.3.0, and I cannot seem to get the ui-select to function correctly when it comes to clicking on options. I copied the demo.js & the bootstrap.html demo files, and clicking on options does not add the options to a select, whether it is a single select or a multi-select.

Hey, so here's some further diagnosis: this only happens when Batarang for AngularJS 0.7.4 is enabled. Seriously, it slows everything way, way down for ui-select, and makes it impossible to click on choices in order to select them.

confirmed for me too.  Thanks for pointing out the chrome plugin workaround.  Strange!

I'm seeing a similar problem but the examples work for me it's just my simple implementation that doesn't. I'm not sure batarang is the actual problem.

I had a similar problem that was solved by removing creepy Batarang.

That's bizarre about Batarang. Good find :smiley:

Had the same problem, disabling Batarang fixed it. Thanks very much

Gah, I just spent an hour and half fighting this. Thank you Jordan!

@jordanthornquest  THANK YOU. Just spent an hour trying to figure what is wrong. Batarang was disabled, had to enable & disable it.

@jordanthornquest Thank you very much! Wasted at least an hour trying to find the cause. After disabling batarang everything works again -.- (Using Angular 1.3.15)

@jordanthornquest Thanks for this solution. Ran into this today and fought it for a good hour. Using Angular 1.3.2 and disabling Batarang solved the problem. First google result - nice work!

+1 Thanks for the Batarang fix.

+1 Thanks for the Batarang fix.Thanks.

Closing as a batarang issue (and duplicate of another closed issue).

authors: Dr4K4n adamcmoore dparish irizvi jordanthornquest migajek mraible nickradford robshep toboid uhomira wesleycho xolraid


text:
Angular ui-select tagging lose text input on blur

Hello guys.
I have encountered a little issue regarding the creation of a new tag.
By pressing ENTER or TAB after entering the text input the new tag is saved and everything is working fine.
But if, after entering the text, i focus out with the mouse (quite usual) i lose the text input and the new tag is not saved.
How can i do to save a new tag ALSO by focusing out with the mouse?
Plunker:
http://plnkr.co/edit/7fSAKmj3pLeeTaid4pMH?p=preview
Stackoverflow question:
http://stackoverflow.com/questions/29407098/angular-ui-select-tagging-lose-text-input-on-blur
Thank you very much!

+1

authors: FrancescoMussi pglotov


text:
Feature Request : Add Support for Strict Content Security Policy

🚀 Feature request
Command (mark with an x)

[x ] build

Description
Lighthouse now throws error if No CSP is found in enforcement mode.
Ensure CSP is effective against XSS attacks
No CSP found in enforcement mode with High Severity
Describe the solution you'd like
My knowledge about CSP is limited and I was going through these guides on CSP:
http://web.dev
https://web.dev/csp-xss/
https://web.dev/strict-csp/
Apparently Nonce-based CSP seems easy to implement for SSR, for example for scripts, after Angular returns the final html, we can use string replace function on server side, to replace "<script" with "<script nonce="RANDOM_NONCE"" add RANDOM_NONCE in CSP header and I believe it should work.
But this string replace work will have to be done for each request.
On the other hand, in case of Hash-based strict CSP if Angular CLI calculates hashes and include these hashes in script tags at build time, this could save us the string replace work that has to be done for each request in case of nonce. But there's a tradeoff, we will have to sync these hashes with our Server Side App so that appropriate headers could be added for generated response. Alternatively CSP could be generated by Angular CLI and added as Content-Security-Policy meta tag.
Ref: https://web.dev/strict-csp/#step-1:-decide-if-you-need-a-nonce-or-hash-based-csp

There are two types of strict CSPs, nonce- and hash-based. Here's how they work:

Nonce-based CSP: You generate a random number at runtime, include it in your CSP, and associate it with every script tag in your page. An attacker can't include and run a malicious script in your page, because they would need to guess the correct random number for that script. This only works if the number is not guessable and newly generated at runtime for every response.

Hash-based CSP: The hash of every inline script tag is added to the CSP. Note that each script has a different hash. An attacker can't include and run a malicious script in your page, because the hash of that script would need to be present in your CSP.

Criteria for choosing a strict CSP approach:

Nonce-based CSP
For HTML pages rendered on the server where you can create a new random token (nonce) for every response
Hash-based CSP
For HTML pages served statically or those that need to be cached. For example, single-page web applications built with frameworks such as Angular, React or others, that are statically served without server-side rendering

I think this repo from Google can provide some directions https://github.com/google/strict-csp/tree/main/strict-csp-html-webpack-plugin

Hi @naveedahmed1, I don't think it should be necessary do anything very fancy for CSP. We only generate scripts and styles for the same domain, so default-src self; should be enough without any need for hashes or nonces. Is there some reason this is inadequate?
The one exception is styles, where we require style-src unsafe-inline;, see https://github.com/angular/angular/issues/6361.
We can't really generate a CSP for users as there are various attributes that apply beyond what Angular provides. Users can control their index.html page and add third-party scripts, or control fetch data, iframe URLs, etc. We can't take full responsibility for generating this string, so it's ultimately up to users and including default-src self; style-src unsafe-inline; should be all that users need to do for Angular.
I can see the argument that SSR could generate a CSP policy to some extent. That still runs into challenges with user-controlled fields that can't be generated and has an implicit risk that attacker code in the request could poison files before hashes/nonces are generated and invalidate much of the security CSP provides. Regardless, that would be handled by Universal rather than the CLI. We can follow up there if you have a specific thought or request for SSR.
We could probably do a better job documenting this, as our current CSP section is pretty limited.

default-src self; style-src unsafe-inline; works great for most scenarios.
However, we're running into a scenario where it would be beneficial to use strict-dynamic, which disables self in browsers which support it.  The result is that the bundled Angular files (polyfills.js, runtime.js, etc...) are blocked when using strict-dynamic.
It sounds like the direction that @naveedahmed1 was trying to go down might solve this issue for us.  If there was a way to use hashing or nonces for the Angular bundle files, then that would probably allow us to use strict-dynamic.  In the meantime it seems that Angular can't be used alongside strict-dynamic at this point in time because I can't find any solution that would work.

Could you expand on the scenario where it would be beneficial to use strict-dynamic? We are always interested in new use cases.
With the current internal bundler usage of Webpack, dynamic import expressions are not used for lazy loading of JavaScript but rather Webpack uses its own runtime that injects script elements into the DOM.
Also, sub-resource integrity (SRI) checks are fully supported with the CLI which will generate the appropriate integrity attributes for both initial and lazy scripts (given the above Webpack injection method).  (SRI: https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity)
In the future, we are currently exploring the ability to generate a bundled ES module application output which may include the use of dynamic imports.  In that scenario, SRI is not supported with dynamic imports and the use of strict-dynamic then provides a replacement of such functionality.
Irrespective of the above, hashes for each script within the application can potentially be calculated as part of the deployment step for the application.  This is a useful time to calculate them as the CSP configuration would need to be updated for each deployment to include those hashes. The server configuration containing the new CSP configuration can then be uploaded during deployment or forwarded to the project's infrastructure team for inclusion, if applicable.
Nonces are recommended to change per request and would best be handled by Angular Universal and SSR (as mentioned in a previous comment) as Universal generates the HTML for each request and can then inject nonces as needed.

Our use-case for strict-dynamic is as follows:
We're loading a handful of external scripts for integrations with third party services.  These scripts then load other scripts, which load even more scripts.  This quickly results in a very long script-src whitelist which is undesirable for two important reasons:

It's difficult to keep track of from a maintenance perspective
After reading this paper I'm learning that long http whitelists are inherently insecure for a variety of reasons.

What we really want is the "trust propagation" aspect of strict-dynamic so that we can whitelist only the 2 or 3 top-level entry point scripts and implicitly trust all of the downstream scripts that they load.  Ideally we could use hashes for these, but even a domain-based whitelist with trust propagation would be a step forward from where we are.
The unfortunate (for us) side effect of browsers' current implementation is that, by design, they ignore self when strict-dynamic is specified, which breaks Angular because the go-to way to tell the browser to load [polyfill.js, runtime.js, etc...] is to use self.  In a perfect world we could tell the browser to use strict-dynamic alongside self, but that doesn't seem to be possible from my research.
If my current understanding is correct, then SRI is a great tool to solve a different problem, thus it wouldn't help us to achieve the "trust propagation" that we're looking for.  It seems that SRI adds the hash to the script tag that's inserted into the index, whereas what we need is to add the hash to script-src in our CSP.
Your suggestion of calculating the hashes of the generated scripts and writing them to the CSP sounds like it would probably work.  However, there are two extra things to keep in mind there:

We'd have to take the time to write and maintain our own script to run as an extra stage in our build pipeline
At that point we'd have to maintain two separate index.htmls, two separate CSPs, or some variation thereof, because per my understanding this would only be possible for the deployed application and not for local development with ng serve.

Per my understanding I think the above are absolutely possible, but it seems to be enough engineering effort to tip the cost/benefit ratio in favor of living with long whitelists at least for the short-term.
Please feel free to poke holes in the above if relevant.  I might have gotten something wrong because I'm still learning the nitty-gritty details about modern CSP stuff.  And thank you for your help!

I think the original issue was about CSP in general, and default-src self; style-src unsafe-inline; should be enough there for Angular.
Regarding @pbrowning-tt's concern, it's unfortunate that strict-dynamic doesn't work with self, which I think is the real solution here. I'm not sure if there's any motivation to make that work in the CSP spec or if there is some technical reason why that can't or shouldn't be supported.
While Angular could generate a CSP with explicit hashes, we don't fully own the user's CSP string, as dynamic behavior in the app can require other changes to the CSP which we couldn't possibly generate (such as image-src or frame-src). Allowing the high-degree of customization that would be required makes this a much more complex feature for Angular than just hashing a bunch of files. For users, there is nothing Angular-specific here (aside from the style-src unsafe-inline;) and since strict-dynamic happens to require this much complexity, that is the effort that is required in its solution.
Our current approach has been to let users deal with the CSP strings and require minimal exceptions for Angular to allow the policy to be as strict as possible. Future CSP features might allow Angular to be more intelligent than default-src self; gives, and then we might consider doing something more complex to improve application security. As it stands today however, we can't do much better than default-src self; and generating a policy compatible with strict-dynamic is unnecessary complexity that can be just as easily handled by the user.
We should definitely update our docs about this to be more clear about style-src unsafe-inline; which I think is the main action item for this issue.

repo: angular/angular-cli


text:
ng destroy does not unlink the dir

When performing ng destroy all related files are unlinked but directory is left in the tree. This is obviously ember-cli issue and we should override that command and unlink the whole related directory.

When implementing this fix to prevent execution of ember cli commands that are not relevant to the angular cli  please ensure that all commands are accounted for. A graceful message stating that the requested command is not valid would be appropriate.

Is there a list of commands ng will include (unless we're just using all current ones that are listed in the readme) that I can compare to ember-cli?

I think we should try to include the ng destroy command for our blueprints overall. ng g route has to take it into account because removing a route causes side effect (like updating the config).
The reason ember-cli doesn't automatically destroy the dirs is because they put multiple components/services/etc in each dir.
With nested routes, we might also have a situation where deleting a route shouldn't delete all files in those directories.
This feature requires a bit of effort in planning imho.

Destroy is no longer supported.

authors: Brocco cwramsey filipesilva hansl jkuri


text:
Out of memory error when building with AOT

When I run ng build --prod --aot
it goes fine until 40%, then it becomes slow, and once it gets to 64% it stucks. It stucks for ~10 minutes and throws exception:
 2649/2791 modules 142 active ...de_modules/socket.io-client/lib/on.js
<--- Last few GCs --->

  834523 ms: Mark-sweep 1346.7 (1433.1) -> 1346.6 (1435.1) MB, 913.7 / 0.0 ms [allocation failure] [GC in old space requested].
  835570 ms: Mark-sweep 1346.6 (1435.1) -> 1346.5 (1435.1) MB, 1047.1 / 0.0 ms [allocation failure] [GC in old space requested].
  836555 ms: Mark-sweep 1346.5 (1435.1) -> 1347.9 (1402.1) MB, 984.8 / 0.0 ms [last resort gc].
  837489 ms: Mark-sweep 1347.9 (1402.1) -> 1347.9 (1399.1) MB, 933.7 / 0.0 ms [last resort gc].

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x3a414ebcfb51 <JS Object>
    1: applyPluginsBailResult1 [/Users/pleerock/www/project/node_modules/tapable/lib/Tapable.js:~80] [pc=0x38e7e98874d4] (this=0x214e62096241 <a Parser with map 0x5828c3561c1>,name=0x3320359c0b99 <String[27]: evaluate FunctionExpression>,param=0x33c4cc2bf4c9 <a Node with map 0xf06457379f9>)
    2: evaluateExpression [/Users/pleerock/www/project/node_modules/webpack/lib/P...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/local/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
 4: v8::internal::Factory::NewFixedArray(int, v8::internal::PretenureFlag) [/usr/local/bin/node]
 5: v8::internal::HashTable<v8::internal::StringTable, v8::internal::StringTableShape, v8::internal::HashTableKey*>::EnsureCapacity(v8::internal::Handle<v8::internal::StringTable>, int, v8::internal::HashTableKey*, v8::internal::PretenureFlag) [/usr/local/bin/node]
 6: v8::internal::StringTable::LookupKey(v8::internal::Isolate*, v8::internal::HashTableKey*) [/usr/local/bin/node]
 7: v8::internal::StringTable::LookupString(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>) [/usr/local/bin/node]
 8: v8::internal::LookupIterator::LookupIterator(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>, v8::internal::LookupIterator::Configuration) [/usr/local/bin/node]
 9: v8::internal::LookupIterator::PropertyOrElement(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, bool*, v8::internal::LookupIterator::Configuration) [/usr/local/bin/node]
10: v8::internal::Runtime::GetObjectProperty(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>) [/usr/local/bin/node]
11: v8::internal::Runtime_KeyedGetProperty(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
12: 0x38e7e52092a7
13: 0x38e7e98874d4
Abort trap: 6

mac OSX El Capitan
angular-cli: 1.0.0-beta.22-1
node: 6.6.0
Looks like there is memory leak somewhere. We have a big project. 1500 typescript files and almost 100k lines of code.

Probably not a leak, just a cap on your node heap. For others also seeking help with this, the issue is known to plague the CLI (#1652, #2974, #3099) when projects grow beyond what many of us consider small-medium sized codebases.
The fix it to set Node's heap size. This is done with node --max_old_space_size=[Space in MB] followed by whatever call you wanted to make, e.g. node --max_old_space_size=2048 ./node_modules/.bin/ng build (Credit to @hansl for that one line.)

Don't really think that this process requires so much memory, either there is a memory leak, either there is a room for huge optimizations

I just built my project into a fresh /dist. My process peaked at 883.7MB of memory space in use during the optimization and final emission of the bundle with ng build --prod --aot. I don't have a very large project, just three modules, it's just that the process keeps the entire build in memory.

I was able to build PHP projects, Grunt, Gulp, Phing and Bower projects with a machine that had only 1GB of Ram (Ubuntu 14). That machine compiled my Angular 1 projects for the last 2 years without any issues, and all my other projects.
My first Angular 2 with just a few components triggered this out of memory error. Had to upgrade my node to 2GB just to restore nightly builds.
I also ran out of memory doing npm install when it hit a build for a node dependency introduced by Angular 2.

btw even with node --max_old_space_size=4048 ./node_modules/.bin/ng build --prod --aot it brings out of memory error on 92%

Dupe of https://github.com/angular/angular-cli/issues/1652 as @gelliott181 mentioned. It's better to keep issue discussion in a single thread.

Don't really think that this process requires so much memory, either there is a memory leak, either there is a room for huge optimizations

Any suggestion or trick to find the memory leak or where the optimisation is needed?


text:
npm i -g angular-cli fails on window: installs broccoli plugin 1.0, 1.1, 1.2 (are all 3 necessary)

Hans@HP-HANS C:\Users\Hans\Web\js\angular20\angular-cli\test-cli

ng new todo
installing ng2
create .clang-format
create angular-cli.json
create config\environment.js
create e2e\app.e2e.ts
create e2e\app.po.ts
create e2e\tsconfig.json
create e2e\typings.d.ts
create angular-cli-build.js
create .gitignore
create karma-test-shim.js
create karma.conf.js
create package.json
create protractor.conf.js
create public.npmignore
create src\app\todo.html
create src\app\todo.spec.ts
create src\app\todo.ts
create src\app\route-config.ts
create src\app.ts
create src\favicon.ico
create src\index.html
create src\tsconfig.json
create src\typings.d.ts
create tslint.json
create typings.json
Successfully initialized git.
Installing packages for tooling via npm..broccoli-plugin 1.0.0: Installing
loadDep:promise-map-serie / |############################-------------------------------------------------------------------------------------------------------------| Installing packages for tooling via npmloadDep:rsvp              - |############################------------------------------------------------------------------------C:\Users\Hans\Web\js\angular20\angular-cli\test-cli\todo\node_modules\angular-cli\node_modules\broccoli\test\multidep\broccoli-plugin-1.0.0
broccoli-plugin@1.0.0Installing packages for tooling via npm
├─┬ promise-map-series@0.2.2
│ └── rsvp@3.2.1
├─┬ quick-temp@0.1.5
│ ├── mktemp@0.3.5
│ ├── rimraf@2.2.8
underscore.string@2.3.3Installing packages for tooling via npm
├─┬ .rimraf@2.5.2
│ └─┬ glob@7.0.3
│   ├─┬ inflight@1.0.4
│   │ └── wrappy@1.0.1
│   ├── inherits@2.0.1
│   ├─┬ minimatch@3.0.0
│   │ └─┬ brace-expansion@1.1.3
│   │   ├── balanced-match@0.3.0
│   │   └── concat-map@0.0.1
│   ├── once@1.3.3
│   └── path-is-absolute@1.0.0
└─┬ symlink-or-copy@1.0.1
└── copy-dereference@1.0.0

Installing packages for tooling via npm...broccoli-plugin 1.1.0: Installing
Installing packages for tooling via npmextract -> gunzTarPerm    - |################################################################################################----.extract:once -> gentlyRm  | |#################################################################################################----------------------------------------|C:\Users\Hans\Web\js\angular20\angular-cli\test-cli\todo\node_modules\angular-cli\node_modules\broccoli\test\multidep\broccoli-plugin-1.1.0
└─┬ broccoli-plugin@1.1.0 oling via npm...
├─┬ promise-map-series@0.2.2
│ └── rsvp@3.2.1
├─┬ quick-temp@0.1.5
│ ├── mktemp@0.3.5
│ ├── rimraf@2.2.8
│ └── underscore.string@2.3.3
├─┬ rimraf@2.5.2
│ └─┬ glob@7.0.3
│   ├─┬ inflight@1.0.4
│   │ └── wrappy@1.0.1
│   ├── inherits@2.0.1
│   ├─┬ minimatch@3.0.0
│   │ └─┬ brace-expansion@1.1.3
│   │   ├── balanced-match@0.3.0
│   │   └── concat-map@0.0.1
│   ├── once@1.3.3
│   └── path-is-absolute@1.0.0
└─┬ symlink-or-copy@1.0.1
└── copy-dereference@1.0.0
Installing packages for tooling via npmbroccoli-plugin 1.2.0: Installing
C:\Users\Hans\Web\js\angular20\angular-cli\test-cli\todo\node_modules\angular-cli\node_modules\broccoli\test\multidep\broccoli-plugin-1.2.0
└─┬ broccoli-plugin@1.2.0 oling via npm
├─┬ promise-map-series@0.2.2
│ └── rsvp@3.2.1
├─┬ quick-temp@0.1.5
│ ├── mktemp@0.3.5
│ ├── rimraf@2.2.8
│ └── underscore.string@2.3.3
├─┬ rimraf@2.5.2
│ └─┬ glob@7.0.3
│   ├─┬ inflight@1.0.4
│   │ └── wrappy@1.0.1
│   ├── inherits@2.0.1
│   ├─┬ minimatch@3.0.0
│   │ └─┬ brace-expansion@1.1.3
│   │   ├── balanced-match@0.3.0
│   │   └── concat-map@0.0.1
│   ├── once@1.3.3
│   └── path-is-absolute@1.0.0
└─┬ symlink-or-copy@1.0.1
└── copy-dereference@1.0.0
Installing packages for tooling via npm.broccoli-source 1.1.0: Installing
C:\Users\Hans\Web\js\angular20\angular-cli\test-cli\todo\node_modules\angular-cli\node_modules\broccoli\test\multidep\broccoli-source-1.1.0
└── broccoli-source@1.1.0 oling via npm...
├── es6-shim (ambient)
├── angular-protractor (ambient dev)
├── jasmine (ambient dev)
└── selenium-webdriver (ambient dev)
Installed packages for tooling via npm.

Dupe of #389

authors: HansS hansl


text:
Latest .28 build can't generate production build

OS
angular-cli: 1.0.0-beta.28.3
node: 6.9.5
os: win32 x64
@angular/common: 2.4.5
@angular/compiler: 2.4.5
@angular/core: 2.4.5
@angular/forms: 2.4.5
@angular/http: 2.4.5
@angular/language-service: 2.4.5
@angular/platform-browser: 2.4.5
@angular/platform-browser-dynamic: 2.4.5
@angular/router: 3.2.1
@angular/compiler-cli: 2.4.5
Repro steps.
Repo: https://github.com/born2net/studioweb
git clone https://github.com/born2net/studioweb.git
cd studioweb
npm install --no-optional
ng build --target=production --base-href ./ --aot true

Error:
worked fine with previous build of .26
dump
root@DESKTOP-VEUHFOL /cygdrive/c/msweb/studioweb
$ npm run release_aot

> studioweb@0.1.94 release_aot C:\msweb\studioweb
> rm -r -f ./dist && npm run x_bump && npm run x_prod_aot && npm run x_sw && npm run x_rsync

> studioweb@0.1.94 x_bump C:\msweb\studioweb
> gulp x_bump

[13:54:01] Using gulpfile C:\msweb\studioweb\gulpfile.js
[13:54:01] Starting 'x_bump'...
[13:54:01] Finished 'x_bump' after 7.87 ms
[13:54:01] Bumped 0.1.94 to 0.1.95 with type: patch

> studioweb@0.1.95 x_prod_aot C:\msweb\studioweb
> ng build --target=production --base-href ./ --aot true

As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release,
which will only support Node 6.9 and greater. This package will be officially deprecated
shortly after.

To disable this warning use "ng set --global warnings.packageDeprecation=false".

Hash: 602058ee3363a6f815d2
Time: 76015ms
chunk    {0} 0.0cb116efbe3477609730.chunk.js 766 kB {1} {2} {3} {4} {5} {6} {7} [rendered]
chunk    {1} 1.167b3ce0de7984a2da69.chunk.js 65.7 kB {0} {2} {3} {4} {5} {6} {7} [rendered]
chunk    {2} 2.1bc6cc7bf67d3e5de3df.chunk.js 173 kB {0} {1} {3} {4} {5} {6} {7} [rendered]
chunk    {3} 3.08532ef528810c0c1231.chunk.js 72.5 kB {0} {1} {2} {4} {5} {6} {7} [rendered]
chunk    {4} 4.e609f12f3d59a017f9c6.chunk.js 173 kB {0} {1} {2} {3} {5} {6} {7} [rendered]
chunk    {5} 5.f6c8c71220b7cc76c1e1.chunk.js 25.1 kB {0} {1} {2} {3} {4} {6} {7} [rendered]
chunk    {6} 6.b6fb4534b8ac718334ca.chunk.js 26.8 kB {0} {1} {2} {3} {4} {5} {7} [rendered]
chunk    {7} main.88ec1f21a0a9e3c70b74.bundle.js (main) 738 kB {10} [initial] [rendered]
chunk    {8} scripts.84cb767c4a82d1b1ee75.bundle.js (scripts) 1.63 MB {11} [initial] [rendered]
chunk    {9} styles.8e33d6addfa8d4f9302a.bundle.css (styles) 334 bytes {11} [initial] [rendered]
chunk   {10} vendor.8f2abf8c51545a5ec54c.bundle.js (vendor) 5.62 MB [initial] [rendered]
chunk   {11} inline.c190dbe96e6cc81bc31c.bundle.js (inline) 0 bytes [entry] [rendered]

ERROR in ./src/services/StoreService.ts
Module build failed: TypeError: Cannot read property 'kind' of undefined
    at C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:93:31
    at Array.map (native)
    at _addCtorParameters (C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:92:46)
    at C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:114:17
    at Array.forEach (native)
    at _removeDecorators (C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:109:10)
    at C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:280:48
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./src/locale/app/app-module.ngfactory.ts 85:0-56
 @ ./src/main.ts
 @ multi ./src/main.ts

ERROR in ./src/store/effects/appdb.effects.ts
Module build failed: TypeError: Cannot read property 'kind' of undefined
    at C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:93:31
    at Array.map (native)
    at _addCtorParameters (C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:92:46)
    at C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:114:17
    at Array.forEach (native)
    at _removeDecorators (C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:109:10)
    at C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:280:48
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./src/locale/app/app-module.ngfactory.ts 65:0-62
 @ ./src/main.ts
 @ multi ./src/main.ts

ERROR in ./src/store/effects/msdb.effects.ts
Module build failed: TypeError: Cannot read property 'kind' of undefined
    at C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:93:31
    at Array.map (native)
    at _addCtorParameters (C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:92:46)
    at C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:114:17
    at Array.forEach (native)
    at _removeDecorators (C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:109:10)
    at C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:280:48
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./src/locale/app/app-module.ngfactory.ts 66:0-61
 @ ./src/main.ts
 @ multi ./src/main.ts

ERROR in ./src/comps/sliderpanel/Sliderpanel.ts
Module build failed: TypeError: Cannot read property 'kind' of undefined
    at C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:93:31
    at Array.map (native)
    at _addCtorParameters (C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:92:46)
    at C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:114:17
    at Array.forEach (native)
    at _removeDecorators (C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:109:10)
    at C:\msweb\studioweb\node_modules\@ngtools\webpack\src\loader.js:280:48
    at process._tickCallback (internal/process/next_tick.js:103:7)
 @ ./src/modules/shared.module.ts 2:0-63
 @ ./src/locale/app/app-module.ngfactory.ts
 @ ./src/main.ts
 @ multi ./src/main.ts

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "x_prod_aot"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! studioweb@0.1.95 x_prod_aot: `ng build --target=production --base-href ./ --aot true`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the studioweb@0.1.95 x_prod_aot script 'ng build --target=production --base-href ./ --aot true'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the studioweb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ng build --target=production --base-href ./ --aot true
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs studioweb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls studioweb
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\msweb\studioweb\npm-debug.log

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "release_aot"
npm ERR! node v6.9.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! studioweb@0.1.94 release_aot: `rm -r -f ./dist && npm run x_bump && npm run x_prod_aot && npm run x_sw && npm run x_rsync`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the studioweb@0.1.94 release_aot script 'rm -r -f ./dist && npm run x_bump && npm run x_prod_aot && npm run x_sw && npm run x_rsync'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the studioweb package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     rm -r -f ./dist && npm run x_bump && npm run x_prod_aot && npm run x_sw && npm run x_rsync
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs studioweb
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls studioweb
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\msweb\studioweb\npm-debug.log

root@DESKTOP-VEUHFOL /cygdrive/c/msweb/studioweb

let me also add that non AOT does works
ng build --target=production --base-href ./ --aot false

ng build --prod now defaults to use aot.

@born2net take a look into #4343 :smile:
(spoiler alert : If you're using yarn you should be able to fix this)

Thanks, checking now
Angular 2 Kitchen sink: http://ng2.javascriptninja.io
and source@ https://github.com/born2net/Angular-kitchen-sink
Regards,
Sean

@born2net better than the yarn thing, read that comment : https://github.com/angular/angular-cli/issues/4343#issuecomment-276918967
I was able to upgrade all my deps after that (so it would be working with npm too :+1: !!)

TX!
will do

Maybe this will help. I accidentally called ng init in Нome directory, after the launch of the ng in any other directory caused the error (even when call ng --version). After deleting ng files from the home directory. ng runs without errors

I still have the same issue with .30 :(

Dupe of #4343

Whether Aot is or is not implemented.
If Aot is implemented : bootstrapModuleFactory in main.ts
ng build --prod

If Aot is not implemented : bootstrapModule in main.ts
ng build --prod --aot=false

authors: AhmedBahet born2net dlimkin filipesilva maxime1992 yarrgh


text:
fix(mobile): AppShellPlugin for Broccoli failed systematically on rebuild

Please provide us with the following information:

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

Versions. Please run ng --version. If there's nothing outputted, please
run in a Terminal:
angular-cli: 1.0.0-beta.2-mobile
node: 6.1.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.

ng new demo-mobile --mobile --prefix dm
npm start
Ensure the browser displays title 'demo-mobile works!'
Change title property on DemoMobileAppComponent to 'demo-mobile works! :)'

The log given by the failure. Normally this include a stack trace and some
more information.

Build successful - 2243ms.

Slowest Trees                                 | Total
----------------------------------------------+---------------------
BroccoliTypeScriptCompiler                    | 881ms
ServiceWorkerPlugin                           | 782ms
vendor                                        | 325ms
AppShellPlugin                                | 170ms

Slowest Trees (cumulative)                    | Total (avg)
----------------------------------------------+---------------------
BroccoliTypeScriptCompiler (1)                | 881ms
ServiceWorkerPlugin (1)                       | 782ms
vendor (1)                                    | 325ms
AppShellPlugin (1)                            | 170ms

file changed app/demo-mobile.component.ts
The Broccoli Plugin: [AppShellPlugin] failed with:
Error: There can be only one platform. Destroy the previous one to create a new one.
    at new BaseException (/Users/Philippe/Desktop/demo-mobile/node_modules/@angular/core/src/facade/exceptions.js:17:23)
    at Object.createPlatform (/Users/Philippe/Desktop/demo-mobile/node_modules/@angular/core/src/application_ref.js:36:15)
    at Bootloader.platform (/Users/Philippe/Desktop/demo-mobile/node_modules/angular2-universal/dist/node/bootloader.js:48:23)
    at new Bootloader (/Users/Philippe/Desktop/demo-mobile/node_modules/angular2-universal/dist/node/bootloader.js:16:33)
    at Function.Bootloader.create (/Users/Philippe/Desktop/demo-mobile/node_modules/angular2-universal/dist/node/bootloader.js:23:16)
    at AppShellPlugin.build (/Users/Philippe/Desktop/demo-mobile/node_modules/angular2-broccoli-prerender/dist/prerender.js:26:58)
    at /Users/Philippe/Desktop/demo-mobile/node_modules/angular2-broccoli-prerender/node_modules/broccoli-caching-writer/index.js:152:21
    at lib$rsvp$$internal$$tryCatch (/Users/Philippe/Desktop/demo-mobile/node_modules/angular2-broccoli-prerender/node_modules/broccoli-caching-writer/node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/Philippe/Desktop/demo-mobile/node_modules/angular2-broccoli-prerender/node_modules/broccoli-caching-writer/node_modules/rsvp/dist/rsvp.js:1048:17)
    at lib$rsvp$$internal$$publish (/Users/Philippe/Desktop/demo-mobile/node_modules/angular2-broccoli-prerender/node_modules/broccoli-caching-writer/node_modules/rsvp/dist/rsvp.js:1019:11)
    at lib$rsvp$asap$$flush (/Users/Philippe/Desktop/demo-mobile/node_modules/angular2-broccoli-prerender/node_modules/broccoli-caching-writer/node_modules/rsvp/dist/rsvp.js:1198:9)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

The broccoli plugin was instantiated at:
    at AppShellPlugin.Plugin (/Users/Philippe/Desktop/demo-mobile/node_modules/angular2-broccoli-prerender/node_modules/broccoli-caching-writer/node_modules/broccoli-plugin/index.js:10:31)
    at AppShellPlugin.CachingWriter [as constructor] (/Users/Philippe/Desktop/demo-mobile/node_modules/angular2-broccoli-prerender/node_modules/broccoli-caching-writer/index.js:21:10)
    at new AppShellPlugin (/Users/Philippe/Desktop/demo-mobile/node_modules/angular2-broccoli-prerender/dist/prerender.js:15:16)
    at Angular2App._buildTree (/Users/Philippe/Desktop/demo-mobile/node_modules/angular-cli/lib/broccoli/angular2-app.js:153:48)
    at new Angular2App (/Users/Philippe/Desktop/demo-mobile/node_modules/angular-cli/lib/broccoli/angular2-app.js:53:23)
    at module.exports (/Users/Philippe/Desktop/demo-mobile/angular-cli-build.js:6:10)
    at Class.module.exports.Task.extend.setupBroccoliBuilder (/Users/Philippe/Desktop/demo-mobile/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:55:19)
    at Class.module.exports.Task.extend.init (/Users/Philippe/Desktop/demo-mobile/node_modules/angular-cli/node_modules/angular-cli/lib/models/builder.js:89:10)
    at new Class (/Users/Philippe/Desktop/demo-mobile/node_modules/angular-cli/node_modules/core-object/core-object.js:18:12)
    at Class.module.exports.Task.extend.run (/Users/Philippe/Desktop/demo-mobile/node_modules/angular-cli/node_modules/angular-cli/lib/tasks/serve.js:15:19)
    at /Users/Philippe/Desktop/demo-mobile/node_modules/angular-cli/node_modules/angular-cli/lib/commands/serve.js:64:24
    at lib$rsvp$$internal$$tryCatch (/Users/Philippe/Desktop/demo-mobile/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1036:16)
    at lib$rsvp$$internal$$invokeCallback (/Users/Philippe/Desktop/demo-mobile/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1048:17)
    at /Users/Philippe/Desktop/demo-mobile/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:331:11
    at lib$rsvp$asap$$flush (/Users/Philippe/Desktop/demo-mobile/node_modules/angular-cli/node_modules/rsvp/dist/rsvp.js:1198:9)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)

Mention any other details that might be useful.

Thanks! We'll be in touch soon.

The mobile story is heavily under construction; please use either latest or beta releases. Mobile will be part of latest as soon as it's available and properly tested.

authors: hansl pkamdem


text:
replaceBootstrap transformer fails when bootstrapModule() call is not chained with platformBrowserDynamic() call

Versions
Angular CLI: 1.5.4 (e)
Node: 6.11.3
OS: darwin x64
Angular: 5.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.5.4
@angular-devkit/build-optimizer: 0.0.35
@angular-devkit/core: 0.0.22
@angular-devkit/schematics: 0.0.41
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.4
@schematics/angular: 0.1.10
@schematics/schematics: 0.0.10
typescript: 2.4.2
webpack-concat-plugin: 1.4.0
webpack-dev-server: 2.9.7
webpack: 3.8.1

Repro steps

Create a new project with: ng new project-name
Run using: ng serve --prod
Open browser and it runs as expected
Change main.ts to split the call to platformBrowserDynamic() from the call to bootstrapModule()

const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule)
  .catch(err => console.log(err));

Run: ng serve --prod
Open browser and see error in console:
Error: No NgModule metadata found for 'function (){}'.

Observed behavior
Complete stack trace:
main.9d791305398abba6bf45.bundle.js:1 Uncaught Error: No NgModule metadata found for 'function (){}'.
    at e.resolve (main.9d791305398abba6bf45.bundle.js:1)
    at e.getNgModuleMetadata (main.9d791305398abba6bf45.bundle.js:1)
    at e._loadModules (main.9d791305398abba6bf45.bundle.js:1)
    at e._compileModuleAndComponents (main.9d791305398abba6bf45.bundle.js:1)
    at e.compileModuleAsync (main.9d791305398abba6bf45.bundle.js:1)
    at e.compileModuleAsync (main.9d791305398abba6bf45.bundle.js:1)
    at e.LMZF.e.bootstrapModule (main.9d791305398abba6bf45.bundle.js:1)
    at Object.cDNt (main.9d791305398abba6bf45.bundle.js:1)
    at n (inline.687454df27f852918dab.bundle.js:1)
    at Object.0 (main.9d791305398abba6bf45.bundle.js:1)

Desired behavior
It should work identically as when the calls are chained.
Mention any other details that might be useful (optional)
The reason for making this change to split into two lines is that in my case, in the handler for the promise returned from bootstrapModule() I need to do some initialization and I need access to the platfor. Calling platformBrowserDynamic() seems to return a different platform if you call it a second time so I need the one used to call bootstrapModule on:
// this is unique to my portal environment
declare var wrapper: any;

const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule)
  .then((ref: NgModuleRef<AppModule>) => {
    // setup required for my portal environment
    wrapper.setApplicationComponentNode(ref, platform);
  })
  .catch(err => console.log(err));

The only workaround at the moment for this is to create a separate main-prod.ts file, eject the webpack config and then modify it to use a different main file for prod vs. dev build.

I found a workaround for this by using:
platformBrowserDynamic().bootstrapModule(AppModule)
  .then((ref: NgModuleRef<AppModule>) => {
    // setup required for my portal environment
    const platform: PlatformRef = ref.injector.get(PlatformRef);
    wrapper.setApplicationComponentNode(ref, platform);
  })
  .catch(err => console.log(err));

However, a better error message or a comment in the generated main.ts would at least be an improvement.

I have the same issue when trying to fork my code in main.ts to an UnderConstructionModule when building or serving with --prod modifier:
**Error: No NgModule metadata found for 'function (){}**
// main.ts
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { UnderConstructionModule } from './under-construction/under-construction.module';
import { environment } from './environments/environment';

if (environment.production) {
 enableProdMode();
}

if (environment.production) {

 platformBrowserDynamic().bootstrapModule( UnderConstructionModule )
   .catch( err => console.log( err ) );

} else {

 platformBrowserDynamic().bootstrapModule( AppModule )
   .catch( err => console.log( err ) );

}

Without --prod modifier, ng serve and ng build work ok with both modules.
Versions
Angular CLI: 1.7.4
Node: 6.14.1
npm: 3.10.10
OS: win32 x64
Angular: 5.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
@ angular/cli: 1.7.4
@ angular-devkit/build-optimizer: 0.3.2
@ angular-devkit/core: 0.3.2
@ angular-devkit/schematics: 0.3.2
@ ngtools/json-schema: 1.2.0
@ ngtools/webpack: 1.10.2
@ schematics/angular: 0.3.2
@ schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0

Hello,
I am facing the same issue of mcgraphix with:
Versions
`Angular CLI: 6.1.1
Node: 8.11.3
OS: win32 x64
Angular: 6.1.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package                           Version
@angular-devkit/architect         0.7.1
@angular-devkit/build-angular     0.7.1
@angular-devkit/build-optimizer   0.7.1
@angular-devkit/build-webpack     0.7.1
@angular-devkit/core              0.7.1
@angular-devkit/schematics        0.7.1
@angular/cli                      6.1.1
@ngtools/webpack                  6.1.1
@schematics/angular               0.7.1
@schematics/update                0.7.1
rxjs                              6.2.2
typescript                        2.7.2
webpack                           4.9.2`
Do you know if you will work on this limitation and when ?
Thank you very much.

As @JavierFuentes  and @guisaas mentioned there is an issue when use fork in the main.ts. It affects I believe all environments with production=true flag. Furthermore if you run ng serve or ng build with --configuration={evnironmentValue}, application will fail with "No NgModule metadata found for..."
I've played with configs a bit and discovered that 'aot' and 'buildOptimizer' must be disabled at angular.json configuration section to make application work.
I expect this behavior must work with aot=true as well.
Does anyone know workaround for now?
Thanks!

I've used workaround with angular.json -> configurations -> fileReplacements section. Replace your main.ts with another one that contains the second module. Works for me.

Any updates on this? I have a related issue, I'd like to create the custom platform:
export const myPlatform = createPlatformFactory(platformBrowserDynamic, 'myPlatform');
myPlatform().bootstrapModule(AppModule)

And get the same error, only with AOT:
Unhandled Promise rejection: No NgModule metadata found for 'function(e){}'

Chaining it directly doesn't help:
createPlatformFactory(platformBrowserDynamic, 'myPlatform')
.bootstrapModule(AppModule);

Produces the same error.
Any help appreciated

Heya, does using getPlatform() as described in https://github.com/angular/angular-cli/issues/8265#issuecomment-449610872 work for your usecase?
We try to identify the platformBrowserDynamic().bootstrapModule(AppModule); call to replace it properly but don't support variations.

@filipesilva  Hi! It's not related to my usecase.  In my case, I want to create a custom platform based on platformBrowserDynamic, and then bootstrap an app with it.
Both this
export const myPlatform = createPlatformFactory(platformBrowserDynamic, 'myPlatform');
myPlatform().bootstrapModule(AppModule)

and this
(createPlatformFactory(platformBrowserDynamic, 'myPlatform'))().bootstrapModule(AppModule)

leads to AOT error that I described

authors: JavierFuentes filipesilva guisaas mcgraphix mtuzinskiy rkhramiankou


text:
angular/cli

I got an error while installing angular js file i.e, angluar/cli when i gave the command "npm install @angular/cli"
npm ERR! Unexpected end of JSON input while parsing near '...9852a748cb8a6954d3c41'
npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Ankith-Poojary\AppData\Roaming\npm-cache_logs\2018-02-21T15_52_13_193Z-debug.log

I think you're having some weird errors and can't debug it, and so, understandably, you're frustrated. But this is a tracker for bugs and feature requests. If we can we also try to help with support requests. We're very lucky to have awesome community members that also spend time trying to help people here in the issue tracker.
But we can't really help much at all if you don't fill in the issue template. I read your issue and have no idea what's going wrong and how to help you. And when other users search the issue tracker and see your issue, it also doesn't help them.
So I think the best thing to do is to close this issue, and ask you to open a new one. In that new one please fill in the issue template and give us an idea of what's happening and how to reproduce it. That way we'll have a chance to help you.


text:
fix(angular_devkit): Update postcss dependency to 8.2.15

I'm having problems installing "@angular-devkit/build-angular": "~0.1102.13" because it uses postcss 8.2.14, but also cssnano 5.0.2, which uses  cssnano-preset-default@5.1.0, which has a peer dependency to postcss@"^8.2.15", so npm 7 fails to install because of peer dependency mismatch

@googlebot I signed it!

I did it from github site, so can't make those changes, sorry, just wanted to unblock all the people that can't install this package on npm 7.


text:
fix(e2e): add typings detection

By configuring ts-node with the project location, it is no
longer necessary to reference typings at the top of files.

Lgtm. Neat

Just following your tip really :p

authors: filipesilva hansl


text:
chore(commands): override ng destroy

It's common for users to try and do ng destroy component name and have
it only partially work.
Since we don't support the command, it's better to not have it do any
partial operations.

Still need to add tests.

Just clean up the linting errors so CI will pass.

authors: Brocco filipesilva


text:
migrate API examples to ng.io

cc @kwalrath

Examples will reside under https://github.com/dart-lang/angular2_api_examples.


text:
any plans to run digest cycle in a web worker?

Feature Request / Road Map
Any plans to include ability to run digest cycle in a web worker (in 1.x)? something like http://slides.com/bahmutov/run-digest-cycle-in-web-worker#/

There are no plans, and such wide-ranging architecture changes are out of scope for AngularJS.

I agree with @Narretz.
Besides, just having the Scope $digest run in a web worker won't work, if your app doesn't run in the web worker too, because the type of data you can send over is limited. So, in order to get proper web worker support, we need to run the whole app on the web worker and just have the DOM-related parts of the framework live in a separate script that runs on the page (not the web worker) and is able to communicate with the web-worker bit. Considering how tightly AngularJS's $compile is coupled to the DOM, this would require a heavy refactoring of the internal logic. (Actually, this is already done. It's called Angular (2+) 😛)
That said, for AngularJS, it makes more sense to run specific, computationally heavy tasks on a web worker imo. AngularJS doesn't have to know anything about this - you can implement it independently.

authors: Narretz cynx gkalpak


text:
ordering by priority and setting priority

Hi all,
Please help me to find out,
Is it possible to order by priority and set priority using AngularFire2?
I'm trying to find an answer to https://stackoverflow.com/questions/49474761/how-to-order-elements-in-firebase-using-angularfire2

Hi @matiishyn! Priority is not recommend anymore, so we do not wrap the methods. You can always use the underlying reference.

@davideast can you please write a quick example or send me a link how can I use the underlying reference?
It looks like I really need to use the Priority - setting and ordering by it.
Will it be possible to do with angularfire2?

authors: davideast matiishyn


text:
Feature request - Firebase admin sdk

I looked through the angularfire2 docs and didn't see this, so I am either opening a feature request or a documentation request.
I would love to have this functionality:
https://firebase.google.com/docs/auth/admin/manage-users#create_a_user
and be able to administer my users from an admin page on my site.
Version info
    "@angular/animations": "^4.1.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/material": "git+https://github.com/angular/material2-builds.git",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "angularfire2": "^4.0.0-rc.0",
    "core-js": "^2.4.1",
    "firebase": "^3.9.0",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.4"

Expected behavior
Access to the users authentication console through my own page.
Actual behavior
Must go through firebase console.

@jdell64 Admin SDK is for server side only. AngularFire is for client side apps. There are no plans for us to merge the two together.


text:
feat(performance tab): Add initial structure for performance tab

Add a perf item for inspected app, create a performance tab, add some basic stylings.
Calculate total time taken per-watcher.
We're finally adding performance back into the mix!  Styling is fairly utilitarian at this point.
TODO:

[ ] Add graph from https://github.com/kentcdodds/ng-stats (thanks, @kentcdodds !)
[ ] Pull out watchers with a time of zero (irrelevant)
[ ] Stats on last N digest cycles
[x] # of watchers in last digest cycle

(I'll be rebasing all these commits down before PR is ready)

Ready for review, will compress to a single commit when everyone's ok with the current state.

Wow, I feel like you improved on my implementation big time. At least there's a lot less code! Good work :+1:

:clap: bravo!

:+1:

LGTM

landed via https://github.com/angular/batarang/commit/f8359a9f410a173397f461a6ffc14c4b52ad2990

authors: SomeKittens btford erwinmombay kentcdodds

repo: angular/batarang