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

Module build failed: <node_modules>/angular-library-seed/<module>.d.ts is missing from the TypeScript compilation #17

Open
mmayors opened this issue Jan 17, 2018 · 0 comments

Comments

@mmayors
Copy link

mmayors commented Jan 17, 2018

Hi,

Not sure if this is an issue with this package or just the way I'm using it but would appreciate any pointers. I have a custom Angular library that is packed in Angular Package Format using this example: https://github.com/trekhleb/angular-library-seed

Currently it only exports one module. I'm able to import the module and use it in my Angular CLI project.

I then used 'ng eject' to create a Webpack config I can customize, and added ng-router-loader to my Webpack config using the Webpack 1 example: https://shlomiassaf.github.io/ng-router-loader

{ "test": /\.ts$/, "loaders": [ "@ngtools/webpack", "ng-router-loader" ] }

When I try to build I get this error:

`
ERROR in ./node_modules/angular-library-seed/orders/orders.module.d.ts
Module build failed: Error: /Users/mmayors/Documents/parent/node_modules/angular-library-seed/orders/orders.module.d.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (/Users/mmayors/Documents/parent/node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:653:23)
at plugin.done.then (/Users/mmayors/Documents/parent/node_modules/@ngtools/webpack/src/loader.js:467:39)
at
at process._tickCallback (internal/process/next_tick.js:160:7)
@ ./src/$$_lazy_route_resource lazy
@ ./node_modules/@angular/core/esm5/core.js
@ ./src/main.ts
@ multi (webpack)-dev-server/client?http://localhost:4200 ./src/main.ts

ERROR in ./src/app/app-routing.module.ts
Module build failed: TypeError: this.call is not a function
at Object.loader (/Users/mmayors/Documents/parent/node_modules/ng-router-loader/index.js:29:14)
@ ./src/app/app.module.ts 9:0-56
@ ./src/main.ts
@ multi (webpack)-dev-server/client?http://localhost:4200 ./src/main.ts
`

In my routes config I've tried the following:
loadChildren: 'angular-library-seed#OrdersModule'
loadChildren: '../../node_modules/angular-library-seed#OrdersModule'

Let me know if I'm way off base here. Thanks

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

No branches or pull requests

1 participant