-
Notifications
You must be signed in to change notification settings - Fork 41
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
getting Error in angular 5.0 #175
Comments
Somewhat similar error but on angular
|
@Sathishchary I ran into the same problem after upgrading to Angular 5.x. If you go to node_modules\angular2-logger\app\core and remove all of the .ts files in there it will temporarily fix the problem. We need to get a build of this library without the source included in it to fully fix the problem. |
I'm not going to have time for a while to go into this, but I'll review PRs if receive any. However if angular was what got upgraded and then it started failing, then it sounds to me like an Angular issue. |
I will try and get some time this weekend to help out if I can. It appears that Angular is following Typescripts standards for tsconfig more strictly (blog entry) and there is also more conversation about the problem (as well as some things you can try and do to solve it) here. @langley-agm Thanks for putting this library together, I use it a ton, and am happy to help out if I can. |
Even I have the same error |
Probably related angular issue angular/angular-cli#8284 (comment)
|
"This really goes against how libraries should be packaged: libraries should never ship their source .ts files" I'm not so sure who started stating this crazy idea as a fact, but I'm pretty sure it only started until Typescript started making things harder by not defining standards, not only npm is way newer than other builders to call the shots at what the standard should be but I haven't seen a single source from them stating something like that and many other builders allow you to select whether you want the source included or not, why would this option exist if libraries should never ship their source files? For reference if you install RxJS you'll see the src files and Angular uses RxJS, or at least they did last time I checked. Just to clarify, I'm not against removing them, I don't believe that's the correct solution because I've found it incredibly helpful in the past to have the src files in my third party libraries, but I don't mind considering it if its affecting many people. However I do not have the time to research this atm to find a real solution and the fact that they keep changing the structure/standards every couple of months doesn't help. However, like I mentioned before anyone's welcome to publish a PR and I'll take a look at it even if it fixes it by removing the src files. |
As the error states, you need to include a reference to the Typescript files that are imported by angular2-logger so TypeScript is aware of them. Edit the tsconfig.json (or tsconfig.app.json if you're using the angular cli) to include the following snippet:
|
@Aitchy13 I tried this. Doesnt work for me. |
Worked for me. |
Hi, @Aitchy13 workaround worked for me too. Thanks a lot. |
Hi, thanks @Aitchy13, you saved me a lot of time ! |
@Aitchy13 's method is worked for "ng serve" for me ,but not for "ng --prod --aot". so i copy the code into my project |
@FreezeSoul Aitchy13's solution is worked for me,not only 'ng serve',but also 'ng build --prod --aot',maybe cause I add extra solution from stack overflow ,maybe it helps |
Solution that worked for me. in
change this to
You may have a different dir structure as dist is created during installation process. So the goal shouls be to point main to compiled core.js file. Change all the import statements for
Compile and run and stay happy. I don't know wheather this is a typo or delibrate decision, but this works even for |
Aitchy13 worked for me, your really help me |
Same issue here however I'd like to avoid workarounds. |
HI, I am converting my angular project form 4.3 to 5.0 ,, I installed the"angular2-logger": "^0.6.0",
but its not working in 5.0
I got below error.
can you please help.
The text was updated successfully, but these errors were encountered: