-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Dependency on CommonJS module 'flat' causing Angular 10 warnings #301
Comments
@timbru31 This is a change introduced in angular-cli v10. |
I'm aware what caused the issue and that I can suppress the issue (which is what we currently do) 😄 - I wanted to raise an issue for your awareness. Feel free to close it, but at least others will find a solution in the comments. Sadly, I do not have enough spare time to submit a PR inlining the flattening. |
I would like to work on this but do not really understand how to develop/test inside This is what I have so far but it is not "safe". import { paths } from 'deepdash-es/standalone';
import { get } from 'lodash-es';
export function flatten(obj: Translation): Translation {
return paths(obj).reduce((a, b) => ((a[b.toString()] = get(obj, b)), a), {});
} |
to fix this issue on terminal |
A fix for this issue has been merged in the flat lib, but they're failing to release it for months. Not sure if having a dependency on a package that's maintained so sparingly makes sense for transloco. |
@DmitryEfimenko there is another issue that's open related to flat. |
I'm submitting a...
Current behavior
When building or starting the Angular App the following warning is displayed:
Expected behavior
No warning is displayed.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
While it's only a warning, it would be nice if it's fixed or suppressed.
The offending file is the
helpers.ts
(https://github.com/ngneat/transloco/blob/153682a4c4f3268ee20146c5f94f1baaa965008b/projects/ngneat/transloco/src/lib/helpers.ts#L2) because the flat package (https://github.com/hughsk/flat) is a CommonJS module.Possible solutions are changing the flat package to something that uses proper ES6 modules or the inline the flat function into this package given the fact that the code is not complex or really big.
Environment
The text was updated successfully, but these errors were encountered: