Skip to content

Incorrect declaration files #12094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alexeagle opened this issue Sep 4, 2018 · 6 comments
Closed

Incorrect declaration files #12094

alexeagle opened this issue Sep 4, 2018 · 6 comments
Labels
needs: more info Reporter must clarify the issue

Comments

@alexeagle
Copy link
Contributor

From @mdasberg on May 23, 2018 13:1

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Area

- [x] devkit
- [ ] schematics

Versions

All

Repro steps

Any typescript linter will show the error.

The log given by the failure

...packages/angular_devkit/build_angular/src/browser/schema.d.ts
Unresolved type FIleReplacements
52 | fileReplacements: FileReplacements[];

...packages/angular_devkit/build_angular/src/server/schema.d.ts
Unresolved type FIleReplacements
75 | fileReplacements: FileReplacements[];

Desired functionality

Fix the declaration files see: PR

Mention any other details that might be useful

Copied from original issue: angular/devkit#963

@alexeagle alexeagle added the needs: more info Reporter must clarify the issue label Sep 4, 2018
@alexeagle
Copy link
Contributor Author

From @filipesilva on May 24, 2018 16:45

I'm not sure how you're running this though. We run linting on your repro and the error does not come up.

How exactly are you getting this error? Can you provide repro steps?

@alexeagle
Copy link
Contributor Author

From @mdasberg on May 24, 2018 18:20

When trying to extend the BrowserBuilder for example, I get errors when trying to compile.
Also if you open those files in your IDE, you will see the errors.

FileReplaceMents is not an interface or class. FileReplacement is.

@alexeagle
Copy link
Contributor Author

From @mdasberg on May 24, 2018 18:50

For example:

import {BrowserBuilder, NormalizedBrowserBuilderSchema} from '@angular-devkit/build-angular';
import {Path, virtualFs} from '@angular-devkit/core';

import * as fs from 'fs-extra';

export class MyBrowserBuilder extends BrowserBuilder {
    /** {@inheritDoc}. */
    buildWebpackConfig(root: Path, projectRoot: Path, host: virtualFs.Host<fs.Stats>, options: NormalizedBrowserBuilderSchema): any {
        return super.buildWebpackConfig(root, projectRoot, host, options);
    }
}

export default MyBrowserBuilder;

will result in the following errors:

> tsc -p tsconfig.json

node_modules/@angular-devkit/build-angular/src/browser/schema.d.ts(52,21): error TS2304: Cannot find name 'FileReplacements'.
node_modules/@angular-devkit/build-angular/src/server/schema.d.ts(75,21): error TS2304: Cannot find name 'FileReplacements'.

Also notable is that when you change for instance the schema.d.ts file with

fileReplacements: abcde[];

It also passes.

@alan-agius4
Copy link
Collaborator

Duplicate of #11294

@alan-agius4 alan-agius4 marked this as a duplicate of #11294 Sep 5, 2018
@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 Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: more info Reporter must clarify the issue
Projects
None yet
Development

No branches or pull requests

2 participants