-
Notifications
You must be signed in to change notification settings - Fork 12
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 errors in index.html #97
Comments
I think it's because of angular/language-service which is now consumed inside HTML file. Could you share please your project (or a part of you rproject) with node_modules etc which causes problem? Thanks. Could you try to create a new Angular project to check if you have this problem? |
I'm experiencing the same behavior. Just created a new Angular project with latest version from http://oss.opensagres.fr/angular2-eclipse/1.3.0-SNAPSHOT/ For example in index.html: Line1: <!doctype html> Line1: [ts] Cannot find type 'doctype'. |
Thanks @rubensa for your info. I think the problem is because you are using AngulaCLI 1.0.0 which doesn't install To fix this issue you should do
at hand. After that you will not error in your HTML files and you will benefit with completion, validation, hover, hyperlink inside your HTML Angular templates |
Hello @angelozerr I issued (version 2.3.4 installed after that): Then (version 4.2.6 installed after that): Refreshed project but same behavior as before... Should I close and reopen Eclipse o something like that? Or is that only going to work if installed globally? Thanks. |
It should be
I think your tsserver is not stopped. To stop it, you can add space in your tsconfig.json and save it. |
Ok, started again from clean Eclipse Oxigen JEE version. |
Save behavior using Angular CLI 1.1.3 |
tsconfig.json must b eupdated too with :
But it seems that problem comes from the But for your HTML Angular template it should work, no? I must study more if problem comes from my integration of |
Ok, think I'm missing something... I checked https://github.com/angelozerr/tsserver-plugins , so done a:
then added to tsconfig.json:
And from terminal run:
Now It seems that there are no more error on app.comonent.html (still errors on index.html -think those are what you are talking about-). So... I thought that I didn't need to do any of this steps to have intellisense and autocompletion... thought It was available by default only by installing the plugins in Eclipse... |
Ummm... confused... Stopped tsserver-plugins, keept tsconfig.json modifications and seems that app.component.html still validates... |
For the moment none solution. We must wait for angular/vscode-ng-language-service#43 (comment) |
Two comments:
I have attempted the above comments from rubensa with no success getting my component html to validate. |
@lornewilson please see angular/vscode-ng-language-service#43 (comment) I'm waiting for work of TypeScript to fix this problem, or perhaps we should disable language service for HTML for the moment? |
An ugly fix I have found is to edit the
In other words, add this previous code like this:
|
Hi @angelozerr I tried your workaround and it worked. A side note to newcomers (like me): Please note that if using Embedded TypeScript runtime you must modify tsserver.js from workspace/.metadata/.plugins/ts.respository/repositories/2.4.1/node_modules/typescript/lib/tsserver.js, not from project node_modules. |
Hi @angelozerr, I think you meant typescript/lib/tsserver.js ? - but yes, it worked and index.html only has a unknown-tag warning now. Hi @rubensa - that was helpful. I used Embedded and your suggestion worked. |
It seems that fix I have given, breaks the completion, validation etc for HTML Angular template. Here a new fix which is should work: Update
like this:
Thanks @rubensa for your comment.
Yes it is that. |
Hello @angelozerr I think that you are right and the provided solution didn't work (as simple disabled TypeScript for all .html files). I tried the new fix (un-doing the previous) and code completion seems to be working. But, why I'm getting "Unknown template directive event 'ngif'" warning (among other "Undefined attribute name (attributename)" or "Undefined ng property binding 'propertyname'") , in the following html file, on lines 9 and 10? O the "Unknown tag (tagname)" on lines 9, 13 and 17 in this html file? NOTE: The application in the screen-shots is working as expected (so I think that It's not a codding problem). Sorry if this is a very "basic" question... |
@rubensa Did you try to do a AOT-Build using |
Yes it's normal. Thoses errors comes from my Angular validator that I have developed and WTP Validator (Undefined attribute name (attributename)) but I would like desactivate it when Angular Language Service is activated. My big problem is I don't know on client side if HTML file is an angular template or not (it's the TypeScript plugin of Angular language service which know that) |
Can you tell which fix you have tried that worked. It will be very helpful
for me too.
…On Jul 12, 2017 2:33 PM, "rubensa" ***@***.***> wrote:
Hello @angelozerr <https://github.com/angelozerr>
I think that you are right and the provided solution didn't work (as
simple disabled TypeScript for all .html files).
I tried the new fix (un-doing the previous) and code completion seems to
be working.
But, why I'm getting "*Unknown template directive event 'ngif'*" warning
(among other "*Undefined attribute name (attributename)*" or "*Undefined
ng property binding 'propertyname'*") , in the following html file, on
lines 9 and 10?
[image: screenshot from 2017-07-12 10-44-57]
<https://user-images.githubusercontent.com/1469340/28109742-71786d86-66f0-11e7-8221-78b4e68efd85.png>
O the "*Unknown tag (tagname)*" on lines 9, 13 and 17 in this html file?
[image: screenshot from 2017-07-12 10-58-38]
<https://user-images.githubusercontent.com/1469340/28109939-13af87f6-66f1-11e7-823f-317c1faf800f.png>
*NOTE*: The application in the screen-shots is working as expected (so I
think that It's not a codding problem).
Sorry if this is a very "basic" question...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#97 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AcotI7_WJ9Uyy_dRRk6I8c8zpfatthSAks5sNIvFgaJpZM4OSJgI>
.
|
Second solution you provided for tsserver.js worked. Thank you. |
Hi @Springrbua
Just tried ng build --prod and works as expected (so no code problem). Seen @angelozerr comment:
seems that It's a known issue not yet solved.
The second solution provided by @angelozerr :
|
To fix with clean mean this issue, we must wait for microsoft/TypeScript#17151 |
@angelozerr I am looking at trying your second solution, but I dont have the path you mentioned in my workspace directory. I can only find the file in the following path. |
To avoid seeing those red underlines and red marks, is there any way to ignore all the errors? Any option to disable the validation of html files? |
its a discussion of a year. and the error still seems to be here. what is the latest/best solution i should use? |
i see good news:
|
@tibistibi without fix of microsoft/TypeScript#17151 I cannot do nothing |
darn it is set on milestone 2.9 now :( |
the errors seems the be gone after i did this: edit this file:
as mentioned above making this:
|
i could not find from eclipse which tsserver.js file was used so i tried a couple of them this last one seems to have done the trick |
should i still have code completion? |
@tibistibi |
I am facing the same issue and I can approve that @tibistibi workaround works. |
😄 any progress on this? |
Waiting for microsoft/TypeScript#17151 |
even second solution also not working for me.. |
They just keep moving the fix to the next release, and then the next again :( |
thanks for the update.... |
After installing Angular 1.3 support in my eclipse (oxygen). I am getting errors in my index.html for all the tags like for head, title etc..
getting error ts cannot identified these tags. i checked setting in preferences window also but there is n o issue in that.
Can you suggest a solution for this.
The text was updated successfully, but these errors were encountered: