Bug Report or Feature Request (mark with an x)
- [x ] bug report -> please search issues before submitting
- [ ] feature request
Versions
Node v10.2.1
NPM 6.1.0
macOS High Sierra
Repro steps
ng new ng-shared
cd ng-shared
ng generate library shared
ng build shared
import in app.module.ts and add to imports
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { SharedModule } from 'shared';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
SharedModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Works fine.
The issue is when I try and npm install or npm link this to another project. Within the same directory ng-shared is now in. (sibling directory to ng-shared)
ng new ng-project
cd ng-project
npm install ../ng-shared/dist/shared/
(I've also tried with npm link)
Add to app.module.ts just like before but in this project.
and then:
The log given by the failure
Only messages are warnings:
4826:15-36 Critical dependency: the request of a dependency is an expression
WARNING in ../ng-shared/node_modules/@angular/core/fesm5/core.js
4838:15-102 Critical dependency: the request of a dependency is an expression 「wdm」: Compiled with warnings.
But I get this error in the browser console:
Error: StaticInjectorError(AppModule)[LocationStrategy -> PlatformLocation]:
StaticInjectorError(Platform: core)[LocationStrategy -> PlatformLocation]:
NullInjectorError: No provider for PlatformLocation!
at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:951)
at resolveToken (core.js:1195)
at tryResolveToken (core.js:1140)
at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:1035)
at resolveToken (core.js:1195)
at tryResolveToken (core.js:1140)
at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:1035)
at resolveNgModuleDep (core.js:8071)
at _callFactory (core.js:8139)
at _createProviderInstance$1 (core.js:8091)
Desired functionality
I would like it work the same way as when you use the library within the project you generated it from, and if you were to install it as a published npm. For example I copied the shared directory into node_modules and it works perfectly.
Does the CLI have an issue with symlinks?
Bug Report or Feature Request (mark with an
x)Versions
Node v10.2.1
NPM 6.1.0
macOS High Sierra
Repro steps
importin app.module.ts and add toimportsWorks fine.
The issue is when I try and
npm installornpm linkthis to another project. Within the same directoryng-sharedis now in. (sibling directory tong-shared)(I've also tried with
npm link)Add to app.module.ts just like before but in this project.
and then:
The log given by the failure
Only messages are warnings:
But I get this error in the browser console:
Desired functionality
I would like it work the same way as when you use the library within the project you generated it from, and if you were to install it as a published npm. For example I copied the
shareddirectory intonode_modulesand it works perfectly.Does the CLI have an issue with symlinks?