Skip to content

Webpack complain about d.ts #16907

Closed
@Seemspyo

Description

@Seemspyo

🐞 Bug report

Command (mark with an x)

ng build --prod

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

Is this a regression?

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

Description

I have updated my project to 9.0.0 and this happend.

I have component with type imports from '../@types.d.ts', but when run build, CLI throw an error that can't resolve '../@types'(+ Field 'browser' doesn't contain a valid alias configuration). If I fixed it like '../@types.d' it passes, but throw another error which '../@types.d.ts' is missing from typescript compilation and I should include it's path.

But things doesn't workout even though I add path to both tsconfig.json and tsconfig.app.json.
Is it because of the ivy typescript and webpack configuration?

🔬 Minimal Reproduction

🔥 Exception or Error




Module not found: Error: Can't resolve '../@types' in '{{ project root }}\src\app\account\sign-up'
resolve '../@types' in '{{ project root }}\src\app\account\sign-up'
  using description file: {{ project root }}\package.json (relative path: ./src/app/account/sign-up)
    Field 'browser' doesn't contain a valid alias configuration
    using description file: {{ project root }}\package.json (relative path: ./src/app/account/@types)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        {{ project root }}\src\app\account\@types doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        {{ project root }}\src\app\account\@types.ts doesn't exist
      .tsx
        Field 'browser' doesn't contain a valid alias configuration
        {{ project root }}\src\app\account\@types.tsx doesn't exist
      .mjs
        Field 'browser' doesn't contain a valid alias configuration
        {{ project root }}\src\app\account\@types.mjs doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        {{ project root }}\src\app\account\@types.js doesn't exist
      as directory
        {{ project root }}\src\app\account\@types doesn't exist
[{{ project root }}\src\app\account\@types]
[{{ project root }}\src\app\account\@types.ts]
[{{ project root }}\src\app\account\@types.tsx]
[{{ project root }}\src\app\account\@types.mjs]
[{{ project root }}\src\app\account\@types.js]
 @ ./src/app/account/sign-up/sign-up.component.ts 7:0-50
 @ ./src/app/account/account-routing.module.ts
 @ ./src/app/account/account.module.ts
 @ ./src/app/app-routing.module.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi ./src/main.ts

🌍 Your Environment




@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/cdk                      8.2.3
@angular/cli                      9.0.1
@angular/material                 8.2.3
@ngtools/webpack                  9.0.1
@schematics/angular               9.0.1
@schematics/update                0.900.1
rxjs                              6.5.4
typescript                        3.7.5
webpack                           4.41.2

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions