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.

Bug with `scss` reference during `aot` build

See original GitHub issue

I’m submitting a … (check one with “x”)

[x] bug report => search github for a similar issue or PR before submitting

Current behavior

With the SCSS refactor https://github.com/swimlane/ngx-charts/commit/034d9774f86abfe9b64678dbaf6876fadb7a9665, lots of scss files were created and referenced in the ts files (which is fine).

But when the module is published, that reference is still there and no scss file released.

https://github.com/swimlane/ngx-charts/blob/master/release/common/tooltip/tooltip.component.js#L72

So its giving the following errors:

screen shot 2017-01-28 at 10 16 09 am

Expected behavior

scss files should be compiled and the css should be inlined during the build / publishing process in both component.js and umd files. (ideally)

OR

scss files should be released too (i think this would work also but it would be a workaround, since if somebody gets a hold of just the umd file, it still holds references in it)

Reproduction of the problem

Happens when trying to use aot with the angular-cli. (Didnt use to happen on previous releases since css was added differently)

Please tell us about your environment:

  • angular-cli: 1.0.0-beta.26

  • ngx-charts version: 4.0.1

  • Angular version: 2.4.5

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
amcdnlcommented, Jan 31, 2017

Packaging libraries for external usage in Angular2 is nearly impossible right now.

  • Webpack -> Handles complex steps and packages but AoT doesn’t work well and doesn’t produce Type Defs
  • CLI -> No packaging support
  • TypeScript -> Handles Type Defs but not scsc/html build steps
  • Rollup -> Same issues as Webpack.
1reaction
dhcdatacommented, Jan 30, 2017

same. my workaround is to simply copy

src/common/base-chart.component.scss
src/common/legend/advanced-legend.component.scss
src/common/legend/legend.component.scss
src/common/legend/scale-legend.component.scss
src/common/timeline/timeline.component.scss
src/common/tooltip/tooltip.component.scss
src/force-directed-graph/force-directed-graph.component.scss
src/gauge/gauge.component.scss
src/gauge/linear-gauge.component.scss
src/pie-chart/advanced-pie-chart.component.scss
src/pie-chart/pie-chart.component.scss
src/pie-chart/pie-grid.component.scss
src/tree-map/tree-map.component.scss

over to release

Read more comments on GitHub >

github_iconTop Results From Across the Web

DomSanitizer - Angular
DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing values to be safe to use in the different DOM contexts.
Read more >
Error when trying to inject a service into an angular ...
So it's a kind of a circular dependency, although it isn't since the property / method is static. Probably a bug that occurs...
Read more >
A complete guide to Angular libraries - Will Taylor Blog
In this article, I will walk you the key elements of developing Angular libraries: Common use cases for Angular libraries. Creating a library ......
Read more >
Angular 8 - Bazel Walkthrough - Bits and Pieces - Bit.dev
Before we start — When building NG apps, it's better to share your ... final solution here which uses Bazel for build, for...
Read more >
Top 40+ Angular Interview Questions and Answers for 2023
The Ahead-of-time (AOT) compiler converts the Angular HTML and TypeScript code into JavaScript code during the build phase, i.e., ...
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