angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

angular-cli support npm linked libraries still not working

Open ghost opened this issue 9 years ago • 22 comments

Please provide us with the following information:

OS?

Mac OSX El Capitan

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here: ng version angular-cli: 1.0.0-beta.22-1 node: 6.5.0 os: darwin x64

Repro steps.

  • I have a package library (dlabs-web-components) that will be shared with many applications.
  • The package library has package to host a set of styles used by all applications. It works just fine when not using npm link, and it is relatively simple:
// Settings file
@import "partials/variables";

// 3rd Party Libraries
@import "~bootstrap/scss/bootstrap";
@import "~bourbon/app/assets/stylesheets/bourbon"; // Place this AFTER bootstrap to avoid some conflicts

// Global partials
@import "partials/mixins";

// Misc partials
@import "partials/animations";
@import "partials/buttons";
@import "partials/contentFooter";
@import "partials/contentHeader";
@import "partials/layout";
@import "partials/loading";
@import "partials/misc";
@import "partials/nodes";
@import "partials/sideNav";
@import "partials/sparkline";
@import "partials/typography";
  • I hap a trainer app, created an app using angular-cli (dlabs-web-components-app), used to illustrate the packages usage.
  • dlabs-web-components-app has a dependency on dlabs-web-components
  • ng build and ng serve work fine.
  • _ Use npm link to connect dlabs-web-components-app to dlabs-web-components
npm link /Users/silveir/Projects/dlabs/dlabs-web-components/
/usr/local/lib/node_modules/dlabs-web-components -> /Users/silveir/Projects/dlabs/dlabs-web-components
/Users/silveir/Projects/dlabs/dlabs-web-components-app/node_modules/dlabs-web-components -> /usr/local/lib/node_modules/dlabs-web-components -> /Users/silveir/Projects/dlabs/dlabs-web-components
  • Now, although ng build works, ng serve_ fails with the following meessage:
_Uncaught SyntaxError: Unexpected token :     styles.bundle.map:formatted:1 _

The log given by the failure.

Normally this include a stack trace and some more information.

Mention any other details that might be useful.

I run into this problem this past late Summer and discovered #1875, decided to wait until it was fixed; upon noticing that it was fixed when I upgraded to [email protected] I decided to give it a whirl. Unfortunately I found the exact same problem. This time, I decided to report it.


Thanks! We'll be in touch soon.

ghost avatar Jan 06 '17 01:01 ghost

I have the same problem but with Angular 5 and angular-cli 1.5.0

gios avatar Nov 28 '17 16:11 gios

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.