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.0Description
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:
- Created 4 years ago
- Comments:11 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @camila-borges ,
DOCUMENT was deprecated from β@angular/platform-browserβ you should start importing from @angular/common.
let me know if it works.
Hey @trotyl , Sorry missed reading that part, I will be careful in future. @camila-borges please follow suggestion from @trotyl