Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

By compiling using build --prod I get an error when trying to load layer from URL option, this is happening to me on master or develop branches #334

Open
dtorresreyes25 opened this issue Aug 11, 2021 · 5 comments
Labels
bug Something isn't working Points: 3 3 agile story points timescale/short-term Becomes timescale/imminent in weeks or months

Comments

@dtorresreyes25
Copy link

image

@isaisabel
Copy link
Contributor

isaisabel commented Aug 11, 2021

That's not an error I've seen before. I don't think this is caused by trying to load a layer by URL since it occurs when importing the initial ATT&CK data (in getDomainData). From the error it looks like Observable is not being properly imported, as forkJoin comes from that import here.

Did you npm install before running ng build --prod? I can't imagine you'd get this far if you didn't npm install but maybe you had the other dependencies installed globally for some reason.

Another possibility is that the import of forkJoin has changed for a recent release of RxJS. We currently import it like so:

import { Observable } from "rxjs/Rx"

and then invoke as:

Observable.forkJoin( [...] )

But the docs of RxJS import it like this:

import { forkJoin } from 'rxjs';

It's possible that the way we're using it is no longer supported.

@isaisabel isaisabel added the bug Something isn't working label Aug 11, 2021
@dtorresreyes25
Copy link
Author

dtorresreyes25 commented Aug 11, 2021

Hi @isaisabel, thanks for you quick reply!, in angular.json if I turn off AOT feat then everything works as expected from build --prod this is what I'm currently using for getting it works :

          "optimization": true,
          "outputHashing": "all",
          "sourceMap": false,
          "namedChunks": false,
          "aot": false,
          "extractLicenses": true,
          "vendorChunk": false,
          "buildOptimizer": false,

the point is if I revert this and set as it comes as default, and just make build not(--prod) no errors related about 'forkJoin' is displayed

@isaisabel
Copy link
Contributor

That's actually consistent with how we build the live deployment of the Navigator now that I look at my notes. We build with the following:

ng build --prod --aot=false --build-optimizer=false

I can't remember if we ever tracked down the cause. I'll leave this issue open to document the fact that we should probably track it down and document it.

In the meantime I'll amend the docs to clarify that ng build --prod doesn't work without the extra flags.

isaisabel added a commit that referenced this issue Aug 11, 2021
@dtorresreyes25
Copy link
Author

dtorresreyes25 commented Aug 11, 2021

mmm...OK ok, yep It would be nice having the docs updated with that clarification. Have a nice day.

@dtorresreyes25 dtorresreyes25 changed the title by compiling using build --prod I get an error when trying to load layer from URL option, this is happening to me on master or develop branches By compiling using build --prod I get an error when trying to load layer from URL option, this is happening to me on master or develop branches Aug 11, 2021
@isaisabel isaisabel added Points: 3 3 agile story points timescale/short-term Becomes timescale/imminent in weeks or months labels Aug 12, 2021
@poleshe
Copy link

poleshe commented Aug 18, 2022

Greetings!

We have run into this issue, too. Luckily it was already raised! I have also seen that it is in the documentation. (too late! :P)

ng build --prod without the extra flags raises errors with forkJoin when trying to fetch data from URL.

Adding the flags, works as expected. Thanks for your help.

Have a nice day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Points: 3 3 agile story points timescale/short-term Becomes timescale/imminent in weeks or months
Projects
None yet
Development

No branches or pull requests

3 participants