question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not resolve @ng-toolkit/universal relative to app.module.ts..

See original GitHub issue

I’m submitting a…


[x] Bug report 
[ ] Feature request
[ ] Documentation issue or request

In package


[ ] @ng-toolkit/init
[ ] @ng-toolkit/serverless
[x] @ng-toolkit/universal
[ ] @ng-toolkit/pwa
[ ] @ng-toolkit/firebug

Current behavior

running ng add @ng-toolkit/universal will only create utils and serverless folders inside node_modules/@ng-toolkit on an existing project.

Expected behavior

running ng add @ng-toolkit/universal should install all dependencies required in app.module.ts

Minimal reproduction of the problem with instructions

  1. run ng add @ng-toolkit/universal on an existing angular 6 project
  2. run npm run build:prod
  3. This error will pop up:
ERROR in app/app.module.ts(121,1): Error during template compile of 'AppModule'
  Could not resolve @ng-toolkit/universal relative to /project/path/src/app/app.module.ts..
src/app/pages/post/post.component.ts(1,24): error TS2307: Cannot find module '@ng-toolkit/universal'.
src/app/layouts/header-nav/header-nav.component.ts(1,24): error TS2307: Cannot find module '@ng-toolkit/universal'.
src/app/layouts/slider-home/slider-home.component.ts(1,24): error TS2307: Cannot find module '@ng-toolkit/universal'.
src/app/layouts/header-nav-post/header-nav-post.component.ts(1,24): error TS2307: Cannot find module '@ng-toolkit/universal'.
src/app/directives/scrollable.directive.ts(1,24): error TS2307: Cannot find module '@ng-toolkit/universal'.
src/app/app.module.ts(1,36): error TS2307: Cannot find module '@ng-toolkit/universal'.

Example repository

I cannot provide this because company privacy policies, but i will send individual resources as requested

What is the motivation / use case for changing the behavior?

The simpliest workaround is to manually installing it with npm install --save @ng-toolkit/universal, but i think you should know this is happening.

Environment


Angular CLI: 6.2.3
Node: 8.11.3
OS: linux x64
Angular: 6.1.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router

Others:

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.7.5
@angular-devkit/build-angular     0.7.5
@angular-devkit/build-optimizer   0.7.5
@angular-devkit/build-webpack     0.7.5

@angular-devkit/core              0.7.5
@angular-devkit/schematics        0.8.3
@angular/cdk                      6.4.7
@angular/cdk-experimental         6.2.0
@angular/cli                      6.2.3
@angular/fire                     5.0.2
@angular/material                 6.4.7
@ngtools/webpack                  6.1.5
@schematics/angular               0.8.3
@schematics/update                0.8.3
rxjs                              6.3.3
typescript                        2.9.2
webpack                           4.9.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:13

github_iconTop GitHub Comments

1reaction
KingDarBojacommented, Nov 4, 2019

@psenechal @sudhir7890 @SwapnilSoni1999 A new version has been released, this should fix the build issue once for all 🙏

0reactions
SwapnilSoni1999commented, Nov 5, 2019

Awesome 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

won't compile app.module.ts from separate project or ...
I'm trying to turn my Angular app to Angular Universal SSR app. The project includes a separate application module in projects folder at...
Read more >
Angular CLI: "Module not found: Error: Can't resolve..."
In this article, I will walk you through how to fix a an error that many people are encountering with Angular CLI 6+....
Read more >
Angular App Shell - Boost Application Startup Performance
What is the relation between the App Shell and Angular Universal? ... in the app.server.module.ts file (and not on the main app.module.ts ): ......
Read more >
Build Faster JavaScript Web Apps with Angular Universal, a ...
This post will show you how to build fast Angular apps that use client and server resources efficiency while providing server-side rendering ( ......
Read more >
Upgrading from AngularJS to Angular
This not only makes components easy to navigate and find, but will also allow ... Next, create an app.module.ts file and add the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found