Skip to content
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

fix(spectacular): expose SpectacularFeatureTestingRootModule to prevent NGCC error when using Nx #20

Merged
merged 1 commit into from
Mar 2, 2021

Conversation

LayZeeDK
Copy link
Member

@LayZeeDK LayZeeDK commented Mar 2, 2021

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines: CONTRIBUTING.md#commit
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

When using Nx and Yarn, NGCC fails after adding Spectacular.

Issue Number: N/A

What is the new behavior?

No NGCC error when using Nx and Yarn to install Spectacular.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

NGCC error message when

node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points

is run:

Error: Error on worker #4: Error: No typings declaration can be found for the referenced NgModule class in static withFeature({ featureModule, featurePath, routerOptions = {}, }) {
        const { providers: routerTestingProviders = [], } = RouterTestingModule.withRoutes([{ path: featurePath, loadChildren: () => featureModule }], routerOptions);
        return {
            ngModule: SpectacularFeatureTestingRootModule,
            providers: [
                ...routerTestingProviders,
                {
                    provide: featurePathToken,
                    useValue: featurePath,
                },
            ],
        };
    }.
    at ModuleWithProvidersAnalyzer.resolveNgModuleReference (C:\projects\sandbox\nx114-angular-app\node_modules\@angular\compiler-cli\ngcc\src\analysis\module_with_providers_analyzer.js:179:23)
    at ModuleWithProvidersAnalyzer.getDtsModuleWithProvidersFunction (C:\projects\sandbox\nx114-angular-app\node_modules\@angular\compiler-cli\ngcc\src\analysis\module_with_providers_analyzer.js:166:33)
    at C:\projects\sandbox\nx114-angular-app\node_modules\@angular\compiler-cli\ngcc\src\analysis\module_with_providers_analyzer.js:47:43    
    at Array.forEach (<anonymous>)
    at C:\projects\sandbox\nx114-angular-app\node_modules\@angular\compiler-cli\ngcc\src\analysis\module_with_providers_analyzer.js:40:28    
    at Array.forEach (<anonymous>)
    at ModuleWithProvidersAnalyzer.analyzeProgram (C:\projects\sandbox\nx114-angular-app\node_modules\@angular\compiler-cli\ngcc\src\analysis\module_with_providers_analyzer.js:38:23)
    at Transformer.analyzeProgram (C:\projects\sandbox\nx114-angular-app\node_modules\@angular\compiler-cli\ngcc\src\packages\transformer.js:133:45)
    at Transformer.transform (C:\projects\sandbox\nx114-angular-app\node_modules\@angular\compiler-cli\ngcc\src\packages\transformer.js:76:27)
    at C:\projects\sandbox\nx114-angular-app\node_modules\@angular\compiler-cli\ngcc\src\execution\create_compile_function.js:52:42
    at ClusterMaster.onWorkerMessage (C:\projects\sandbox\nx114-angular-app\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:195:27)
    at C:\projects\sandbox\nx114-angular-app\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:55:95
    at ClusterMaster.<anonymous> (C:\projects\sandbox\nx114-angular-app\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:293:57)
    at step (C:\projects\sandbox\nx114-angular-app\node_modules\tslib\tslib.js:143:27)
    at Object.next (C:\projects\sandbox\nx114-angular-app\node_modules\tslib\tslib.js:124:57)
    at C:\projects\sandbox\nx114-angular-app\node_modules\tslib\tslib.js:117:75
    at new Promise (<anonymous>)
    at Object.__awaiter (C:\projects\sandbox\nx114-angular-app\node_modules\tslib\tslib.js:113:16)
    at EventEmitter.<anonymous> (C:\projects\sandbox\nx114-angular-app\node_modules\@angular\compiler-cli\ngcc\src\execution\cluster\master.js:287:32)
    at EventEmitter.emit (events.js:314:20)

@LayZeeDK LayZeeDK changed the title fix: expose SpectacularFeatureTestingRootModule fix(spectacular): expose SpectacularFeatureTestingRootModule to prevent NGCC error when using Nx Mar 2, 2021
Copy link
Member

@santoshyadavdev santoshyadavdev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@LayZeeDK LayZeeDK merged commit 764a3a8 into main Mar 2, 2021
@LayZeeDK LayZeeDK deleted the spectacular/fix/expose-root-testing-module branch March 2, 2021 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants