Skip to content

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

@camila-borges

Description

@camila-borges

🐞 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions