question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Migration from Angular 6 to Angular 8 - DOCUMENT import from @angular/platform-browser

See original GitHub issue

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Yes, the previous version in which this bug was not present was: 6.1.0

Description

I was migrating my project from Angular 6.1.0 to Angular 8.0. I thought I was importing wrong in any part of project the DOCUMENT api, but I didn’t find any code like β€œimport { DOCUMENT } from β€˜@angular/platform-browser’;” in the project (so I couldn’t import it right from β€˜@angular/common’ like I’ve seen as a solution in many places…).

πŸ”¬ Minimal Reproduction

Only updated my Angular version from 6.1.0 to 8.0.0 (using ng update @angular/cli @angular/core)

πŸ”₯ Exception or Error




ERROR in ./src/app/features/secure/secure.module.ngfactory.js 104:4894-4906
"export 'DOCUMENT' (imported as 'i48') was not found in '@angular/platform-browser'
ERROR in ./src/app/features/secure/secure.module.ngfactory.js 104:5033-5045
"export 'DOCUMENT' (imported as 'i48') was not found in '@angular/platform-browser'
ERROR in ./src/app/features/updates/updates.module.ngfactory.js 108:4963-4975
"export 'DOCUMENT' (imported as 'i50') was not found in '@angular/platform-browser'
ERROR in ./src/app/features/updates/updates.module.ngfactory.js 108:5102-5114
"export 'DOCUMENT' (imported as 'i50') was not found in '@angular/platform-browser'
ERROR in ./src/app/features/jobs/job.module.ngfactory.js 109:5118-5130
"export 'DOCUMENT' (imported as 'i51') was not found in '@angular/platform-browser'
ERROR in ./src/app/features/jobs/job.module.ngfactory.js 109:4979-4991
"export 'DOCUMENT' (imported as 'i51') was not found in '@angular/platform-browser'
ERROR in ./src/app/features/accounts/account.module.ngfactory.js 112:5035-5047
"export 'DOCUMENT' (imported as 'i52') was not found in '@angular/platform-browser'
ERROR in ./src/app/features/accounts/account.module.ngfactory.js 112:5174-5186
"export 'DOCUMENT' (imported as 'i52') was not found in '@angular/platform-browser'
ERROR in ./src/app/features/control/control.module.ngfactory.js 115:5134-5146
"export 'DOCUMENT' (imported as 'i55') was not found in '@angular/platform-browser'
ERROR in ./src/app/features/control/control.module.ngfactory.js 115:5273-5285
"export 'DOCUMENT' (imported as 'i55') was not found in '@angular/platform-browser'
ERROR in ./src/app/features/devices/device.module.ngfactory.js 122:5242-5254
"export 'DOCUMENT' (imported as 'i58') was not found in '@angular/platform-browser'
ERROR in ./src/app/features/devices/device.module.ngfactory.js 122:5381-5393
"export 'DOCUMENT' (imported as 'i58') was not found in '@angular/platform-browser'
ERROR in ./node_modules/@swimlane/ngx-datatable/release/components/header/header.component.ngfactory.js 55:107-118
"export 'DOCUMENT' (imported as 'i8') was not found in '@angular/platform-browser'

🌍 Your Environment




     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / β–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 8.0.1
Node: 10.16.0
OS: darwin x64
Angular: 8.0.0
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.800.1
@angular-devkit/build-angular     0.800.1
@angular-devkit/build-optimizer   0.800.1
@angular-devkit/build-webpack     0.800.1
@angular-devkit/core              8.0.1
@angular-devkit/schematics        8.0.1
@angular/cdk                      6.4.7
@angular/cli                      8.0.1
@angular/flex-layout              7.0.0-beta.24
@angular/material                 6.4.7
@ngtools/webpack                  8.0.1
@schematics/angular               8.0.1
@schematics/update                0.800.1
rxjs                              6.5.2
typescript                        3.4.5
webpack                           4.30.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
santoshyadavdevcommented, Jun 7, 2019

Hi @camila-borges ,

DOCUMENT was deprecated from β€˜@angular/platform-browser’ you should start importing from @angular/common.

let me know if it works.

1reaction
santoshyadavdevcommented, Jun 7, 2019

Hey @trotyl , Sorry missed reading that part, I will be careful in future. @camila-borges please follow suggestion from @trotyl

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading from AngularJS to Angular
This guide describes the built-in tools for efficiently migrating AngularJS projects over to the Angular platform, a piece at a time.
Read more >
Angular Update Guide
Select the options that match your update. Angular versions. From v. 16.0, 15.0, 14.0, 13.0, 12.0, 11.0, 10.2, 10.1, 10.0, 9.1, 9.0, 8.2,...
Read more >
Guide to update your Angular application v5.0 -> v6.1 for ...
If you use DOCUMENT from @angular/platform-browser, you should start to import this from @angular/common. Anywhere you use ReflectiveInjector,Β ...
Read more >
Deprecated APIs and features - Angular
For more information, please refer to the migration doc. ... As a result, the integration was deprecated in Angular version 8, and due...
Read more >
Angular Update Guide
Warning: Be sure to follow the guide below to migrate your application to the ... If you use DOCUMENT from @angular/platform-browser, you should...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found