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.

FESM5 error: 'defineInjectable' not found in @angular/core

See original GitHub issue

Type of Issue

[x] Bug Report…?
[ ] Feature Request

Description

After building an Angular 6.0.0-rc.0 Library and importing into an Angular 5.2.0 app, I get this error:

WARNING in ./node_modules/my_library_name/fesm5/my_library_name.js
19:66-82 "export 'defineInjectable' was not found in '@angular/core'

webpack: Compiled with warnings.

How To Reproduce

Attempt to use an ng6 Library in an ng5 app.

Expected Behaviour

Successfully using an ng5 library in an ng6 app.

Version Information

ng-packagr: 4.1.0
@angular/*: 5.2.0
typescript: 2.6.0
rxjs: 6.2.0
node: 8.9.4
npm/yarn: 5.6.0

Are ng6 packages/libraries backwards-compatible? Any help/expertise would be greatly appreciated! Thanks.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
JoostKcommented, Sep 19, 2018

Thanks. It looks like you’re using the providedIn feature of @Injectable, which is new in NG 6 and hence not backwards compatible with NG 5.

If you want your library to work in 5, you must not rely on any of the features that are only available since 6, as that won’t work of course.

1reaction
maksof-kashifcommented, Jul 8, 2019

For Angular 7 or greater version use npm install ng2-charts@2.2.3 --save npm install chart.js --save

Read more comments on GitHub >

github_iconTop Results From Across the Web

export 'ɵɵinject' was not found in '@angular/core'
I did this but now get: Error: StaticInjectorError(AppModule)[ScullyLibModule -> IdleMonitorService]: StaticInjectorError(Platform: core)[ ...
Read more >
defineInjectable - Angular
This API should be used only by generated code, and that code should now use ɵɵdefineInjectable instead. const defineInjectable: <T>( ...
Read more >
Angular CLI: "Module not found: Error: Can't resolve..."
In this article, I will walk you through how to fix a an error that many people are encountering with Angular CLI 6+....
Read more >
export 'ɵɵdefineInjectable' was not found in '@angular/core'
Removing the character ^ from "ngx-mqtt": "^6.6.0" resolved the problem. ... WARNING in ./node_modules/@agm/core/fesm5/agm-core.
Read more >
UNPKG - @angular/core
The CDN for @angular/core. ... @angular/core/fesm5/core.js.map ... {\n return key;\n }\n }\n throw Error('Could not find renamed property on target object.
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