Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

domino uninstalled upgrading to ng 9 #1499

Closed
5 tasks
wafflesrg00d opened this issue Feb 11, 2020 · 5 comments
Closed
5 tasks

domino uninstalled upgrading to ng 9 #1499

wafflesrg00d opened this issue Feb 11, 2020 · 5 comments
Labels
need: repro steps We cannot reproduce the issue with the information given

Comments

@wafflesrg00d
Copy link

🐞 Bug report

What modules are related to this issue?

  • aspnetcore-engine
  • builders
  • common
  • [ x] express-engine
  • hapi-engine
  • module-map-ngfactory-loader

Is this a regression?

Yes, the previous version in which this bug was not present was: 8.x

Description

domino was uninstalled while upgrading to Angular 9 in a Universal project, and I'm no longer able to build, due to the following error: "ReferenceError: document is not defined". Re-adding domino via npm install did not resolve this error, either. Requiring and referencing domino in either server.ts or main.ts also fails.

🔬 Minimal Reproduction

Just adding document.addEventListener(...) in main.ts produces the described error.

🔥 Exception or Error

"ReferenceError: document is not defined"

🌍 Your Environment


Angular CLI: 9.0.1
Node: 10.16.2
OS: darwin x64

Angular: 9.0.0
... animations, common, compiler, compiler-cli, core, elements
... forms, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
... service-worker
Ivy Workspace: Yes

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.900.1
@angular-devkit/build-angular     0.900.1
@angular-devkit/build-optimizer   0.900.1
@angular-devkit/build-webpack     0.900.1
@angular-devkit/core              9.0.1
@angular-devkit/schematics        9.0.1
@angular/cli                      9.0.1
@ngtools/webpack                  9.0.1
@nguniversal/builders             9.0.0
@nguniversal/common               9.0.0
@nguniversal/express-engine       9.0.0
@schematics/angular               9.0.1
@schematics/update                0.900.1
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2
@jsonpj3wt
Copy link

jsonpj3wt commented Feb 19, 2020

I am also seeing a similar issue with upgrading to ng 9 and using universal - specifically with the prerender. Previously was able to use domino in server.ts but that seems to not work anymore.

I did also try to add the old domino code into master.ts but got a slew of problems with that approach. What is weird is that the only reference to document I have now is related to node modules and it seems to be pointing to bluebird (which is packaged by Karma and webpack).

@alan-agius4 alan-agius4 added the need: repro steps We cannot reproduce the issue with the information given label Feb 21, 2020
@alan-agius4
Copy link
Collaborator

Can you please share a reproduction? Thanks.

@jsonpj3wt
Copy link

jsonpj3wt commented Feb 21, 2020

@alan-agius4 I actually ran the steps from Angular documentation and even with document.* in main.ts, it did work (prerender and serve).

One thing I noticed when building was the following output:

Compiling angular2-notifications : module as esm5
Compiling @angular/forms : es2015 as esm2015
Compiling ng-select2 : es2015 as esm2015
Compiling ngx-google-places-autocomplete : main as umd
Compiling ngx-markdown : es2015 as esm2015
Compiling ngx-pagination : module as esm5
Compiling ngx-xml2json : es2015 as esm2015

I wonder since those imports do have document.* and dependent packages have them as well, could that be the issue?

Basically, if domino can be used, I think this solves this issue. The problem is it will not import into main.ts because it fails on node modules (path, fs, etc).

@CaerusKaru
Copy link
Member

This is not an issue with Angular Universal, but maybe related to #1675. Either way, closing.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
need: repro steps We cannot reproduce the issue with the information given
Projects
None yet
Development

No branches or pull requests

4 participants