Skip to content

Ionic 4 library build - BUILD ERROR error TS5060: Option 'paths' cannot be used without specifying '--baseUrl' option. #16298

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
ebeling opened this issue Nov 12, 2018 · 5 comments
Labels

Comments

@ebeling
Copy link

ebeling commented Nov 12, 2018

I like to build a library for sharing it with team. Since Angular 6 this is possible. So I created a new blank ionic project with:
ionic start myApp blank --cordova
Then I created a library with:
ng generate library xxxlib
if I try to package the library with:
ionic build --project xxxlib
an error occures:

...
Building Angular Package
Building entry point 'xxxlib'
Compiling TypeScript sources through ngc

BUILD ERROR
error TS5060: Option 'paths' cannot be used without specifying '--baseUrl' option.

I found following bug and fix for angular-cli:
angular/angular-cli#11258

This is not the same problem, because here was speaking about a migration but can it be, that the ionic starter script is also not writing the necessary baseUrl to tsconfig.json ?

ionic info

Ionic:

ionic (Ionic CLI) : 4.3.1 (/usr/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.0.0-beta.15
@angular-devkit/build-angular : 0.8.6
@angular-devkit/schematics : 0.8.6
@angular/cli : 6.2.6
@ionic/angular-toolkit : 1.1.0

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : none
Cordova Plugins : no whitelisted plugins (0 plugins total)

System:

NodeJS : v8.12.0 (/usr/bin/node)
npm : 6.4.1
OS : Linux 3.16

@ionitron-bot ionitron-bot bot added the triage label Nov 12, 2018
@paulstelzer
Copy link
Contributor

Thanks for your issue! I think you missed something. Could you please create a new Ionic 4 project?

Keep i mind to update the ionic cli to the latest version before!

@paulstelzer
Copy link
Contributor

paulstelzer commented Dec 7, 2018

UPDATE: I saw you try to create a library, this is a feature of Angular. So if I am right, this is not supported by Ionic. If you need library support, please open this a Feature Request and tell us the use case and more information about it!

@ebeling
Copy link
Author

ebeling commented Dec 7, 2018

I implement services, which I like to use in more than one ionic project. That's why I need library support.
And the problem above I solved with adding a compilerOption in tsconfig.json:
"compilerOptions": { "baseUrl": "./projects", ... }

It should be possible to add this automatically while generating Ionic project!

@paulstelzer
Copy link
Contributor

paulstelzer commented Dec 7, 2018

@ebeling Thanks for clarify! Could you please open a feature request for it? That would be great :) PS: I think that feature request should be added at the ionic/cli -> https://github.com/ionic-team/ionic-cli

@ionitron-bot
Copy link

ionitron-bot bot commented Jan 6, 2019

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jan 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants