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] ng-packagr cannot load a less file from a component less file

See original GitHub issue

Type of Issue

[X ] Bug Report
[ ] Feature Request

Description

Importing a less or a CSS file contained in node_modules from a component cause a building error indicating “resource is missing”

    BUILD ERROR
    Ignoring local @import of "../../node_modules/sg-bootstrap/less/themes/standard/colors.less" as resource is missing

How To Reproduce

  1. Create a component with a less style file
  2. Import a less or css file provided in the node_modules folder
  3. Try to package the application

Expected Behaviour

A succesful build

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr: 2.4.2
@angular/*: 5.2.9
typescript: 2.5.3
node: 8.9.1
npm: 5.6.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
xmlkingcommented, Apr 30, 2018

If you are using angular-cli , @import '~filepond/dist/filepond.css'; works for ng serve without any modification Then problem is we cannot package using ng-packagr

1reaction
proAppleEatercommented, May 28, 2018

We had a similar issue. We fixed it. Posting in case this could help your case.

We had an import from bootstrap that is an node module. We had @import “~bootstrap/scss/mixins”; This caused an error when trying to package using ng-packgr In bootstrap, mixins is a folder AND a file (the file has a underscore _mixins.scss) By specifying the underscore, this solved our issue : @import “~bootstrap/scss/_mixins”;

Read more comments on GitHub >

github_iconTop Results From Across the Web

angular - Import a external less file into an app.component ...
Everything compiles fine, I just get an error for that variable in the inspector. Invalid Property Value. Here are my less-loaders: module: { ......
Read more >
The Best Way To Architect Your Angular Libraries
The ideas presented in this article are based on extensive experience from large enterprise environment (100 Angular SPAs and 30+ libs )…
Read more >
ng-packagr - npm
Let's walk through a getting started that'll build an Angular library from TypeScript sources and create a distribution-ready npm package: ...
Read more >
Angular compiler options
The configuration options from the base file are loaded first, ... the compiler does not look at the TypeScript version and does not...
Read more >
Building an Angular Library with multiple entry points | Articles
The file contains the public API of the library. ... your module and you should not export spec files. ng-packagr will throw an...
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