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
Errors in tsx since upgrading to 1.0.0 #980
Comments
Wild Web Developer uses the typescript-language-server to provide analysis. And this (and its transitive dependencies) gets updates frequently. Some updates bring new features. |
Ok, were I can find the from which to what version of language-server this 1.0.0 upgrade brings in? |
in the install location, eclipse/plugins/org.eclipse.wildwebdeveloper_*/package-lock.json.
Thanks, this is very relevant! Indeed "client doesn't set languageId correctly". this needs to be fixed in Wild Web Developer. The fix would be similar to 1ed945d#diff-39186773eb7c359cf334445a924d91bdb589ea566a6eba995f06cdf7af1e7d18 but applied to the jsts language server binding. Would you be interested in trying to submit a fix as a PR? |
I can try, but I don't have a setup for this - so someone has to review und test the changes. By-the-way: In the error-log I found this line
Might it be, that this is the reason for the new errors I see? As far as I could figure out previously typescript 4.6.4 was bundled and I'm using 4.7.4 in my package.json. If the new version 4.8.4 used by WWD 1.0.0 shows stuff as an error which wasn't an error before would be a possible explaination. So, I asked myself why is the bundled version of typescript used and not the version of my project. Typescript is evolving fast and it is a common situation on customers projects to fix bugs or implement minor features without upgrading the entire code base due to a newer typescript version. I do Java/Maven-based projects and I use maven-frontend-plugin to avoid this situation at build-time. It would be great to avoid this also at edit-time! For example: If the project's tsserver.js could be used by scanning the right path-hierarchy of a ts-file opened until the next package.json is found (e.g. |
Please submit a PR, I'll try to test it. |
As far as I understand, this is already in place: Sorry, if I'm wrong and didn't get it. Since this is already fixed in 1.0.1 I updated but now I get other errors: Unfortunately, the previous problems were solveable by just adding an import. This one I need to investigate what that means and how to workaround. I guess, I will try to downgrade the WWD because all that stuff blocks me. I tried to upgrade typescript in my package.json but it compiles well - no errors. If this new error is caused by the next typescript upgrade to 4.9.4 according to he Changelog, then I really vote for project-specific typescript versions. |
I googled for this error and 90% is about "rename file from .ts to .tsx" but in my case it is already .tsx and it worked with WWD 1.0.0 |
I have the same issue. I guess not so many people is using Eclipse for tsx development :S
The same is happening for me with Eclipse 2022-09 and Wild Web Developer with the following versions: @stephanpelikan did you find a workaround? |
Unfortunately not. I downgraded the plugin. Meanwhile I had a bunch of updates and my current version is which is working fine. Since I need a running IDE without worries I do not update any more. Maybe in future I will give it another try. Independent from this, Wild Web Developer uses that bundled typescript version instead of the version given in each project's package.json. As long as your projects do fine with this its OK, but especially maintaining older code is a problem. So, at the moment the setup and the projects I'm working on are matching fine, but yes I'm worried about the future. |
Hey! Thanks! Sorry to ask too many questions, but how did you downgrade? I'm trying to find version 1.0.0 in the repos and I cannot find it. Just 1.3.0 and 1.4.0, which has the same problems. Thanks in advance! |
@sinhote : No problem. I removed WWW manually. To do so, got to Afterwards I added this repo https://download.eclipse.org/wildwebdeveloper/releases/1.0.0 at |
@stephanpelikan Thanks! It worked! I actually had to provide a manual solution because there were conflicts with the dependencies and other installed components. Fortunately, it all boiled down to an m2e dependency, and since I don't use Maven at all, I could simply uninstall it. Thanks again for the help. I hope they can sort this issue out in the next releases. |
If people who face the issue roll back to older versions instead of contributing to its resolution, then it's even less likely to be fixed. |
I meant no disrespect here. I'm glad that this plugin exists and it's great we can use it for free, but I'd be more glad if it worked well when that can be fixed. I don't think I came here demanding that someone fixed it for me, I just came looking to find a workaround. This was not a complaint. Not everybody has the time and not everybody who has the ability and knowledge to use a piece of software has the ability to improve it. I know this is obvious but I was not the one who started posting platitudes. I wish I could support other projects, but I don't have the time and, frankly, I don't think I need to justify that to anybody that is so quick to draw conclusions. Thanks for your work as a contributor but that does not give your the right to have that attitude. Have a nice day. |
@stephanpelikan you may want to try setting the languageId also for the contentTypeBinding that are related to the eslint language server. |
@mickaelistria: I tried that but at the moment my workspace is broken. I developed a React app and everything was fine. I needed to duplicate this app as a template for a second app. This messed up everything. I don't see any typescript errors or warnings any more, code completion is not working and error log shows: |
I tried to get insides by enable logging to console and get this:
Unfortunately, logging to file shows the same 😞 |
Please install latest release or latest snapshot of LSP4E to get proper logging. |
I updated and that changed the behavior: A lot of tsx files are now treated fine (code-completion, hovers, etc.) but there are still some files which seem not to be recognized as a tsx file showing the error above. Then I enabled log to console and after restart none of the tsx file where recognized any more. Disabling logs brought back tsx-recognition only for a couple of files, but the majority is not treated as a tsx any more. Would could cause that unpredictable behavior? |
Every time I restart Eclipse other files are recognized: I have a file open and hovers, code-completion, etc. works fine. I restart Eclipse without closing the file. After coming back errors are shown ( |
Since the current version of WWW and LSP4J does not work I retried to use my old Eclipse (having WWW 1.0.0 installed) and on importing the second project (which is a copy of a previous project, so having the same directory structure and also same and similar files) into a new workspace every works fine. Does that give you a hint? |
I've been encountering the same issues described here, where editing React Typescript tsx files is effectively broken in current versions. I had a dig around in the code and config for the plugin and its dependencies to try and identify the cause but I ultimately had to roll back to version 1.0.0 as stephanpelikan described. |
Can someone please share a very minimal project that reproduces the issue? |
Yes, I'm working on that. I use Java Maven multi-module projects, so there is a hierarchy of projects: root
I experienced that in the files were found multiple times:
When I do CTRL-left-mouse-click in ts/tsx files to follow code-references I always jumps to the Thank you for hanging on! |
OK, I have now a manual for all the problems I'm facing. I refers to a Open-Source project I'm currently working on: Preparation:
Problems:
All these errors I don't get using Eclipse 2022-09 (4.25.0) using WWW 1.0.0! But there are other problems I'm facing because I need to stick to an old version of WWW:
Another issue I'm facing but for which no solution may be developed yet: On using Maven all pom.xml files are analysed and it is checked if there is a project in the open projects which implements a given dependency of another project. The effect of this is that I can do CRTL + mouse click on a component and it redirects to the source file of that component instead of the type-definition found in node_modules. An example:
I hope you can reproduce all the thing I reported! Thank you for your support! 😃 By-the-way: The title of the issue may be a little-bit missleading. Should we create another issue for all this or is it OK to stick to this issue? |
This example is fairly complicated to reproduce and ideally automate as a test case as it involves unrelated components (m2e, JDT...). Would it be possible to trim it to a plain typescript example? |
As the problems can not be found on every ts or tsx file I don't want to build a random application hoping to get all the errors I find in the project given. Maybe the structure is the reason for those errors? In that case I wouldn't be able to reproduce those errors. As a user of WWW I do not know what causes the errors. I even cannot copy/paste the existing code because as mentioned the applications relies on the libraries part of it and even the libraries rely on other libraries part of it. I totally understand that it would be easier have a simple test scenario but what I provide is the way people use WWW to develop UIs and the errors are reproducable. I guess if a simple project would bring the same errors you would have found it before releasing 1.0.2 !? |
That's too optimistic, reality is different: most of the main contributors only rarely do typescript development so it's easy for issues to be missed ;) |
I managed to track that down. This worked for me. change languageId from
Also I had to delete this folder as somehow it is caching the original value: |
@kascaks great! would you mind submitting a PR with this change? |
This PR recovers some changes made pn content type mappings in https://github.com/eclipse/wildwebdeveloper/pull/1009/files#diff-39186773eb7c359cf334445a924d91bdb589ea566a6eba995f06cdf7af1e7d18
This PR recovers some changes made pn content type mappings in https://github.com/eclipse/wildwebdeveloper/pull/1009/files#diff-39186773eb7c359cf334445a924d91bdb589ea566a6eba995f06cdf7af1e7d18
This PR recovers some changes made pn content type mappings in https://github.com/eclipse/wildwebdeveloper/pull/1009/files#diff-39186773eb7c359cf334445a924d91bdb589ea566a6eba995f06cdf7af1e7d18
Works for me too. |
Since upgrading to 1.0.0 (using Eclipse 4.25.0) I see these errors in my React tsx files:
In one file of my project, after working on other issues, this error is permanently gone without following the advice to add the import. All other tsx files I open show that error.
How can I get rid of this?
I see also other errors which were also suddenly highlighted after upgrading to 1.0.0. Some of them are right and need to be resolved. But why they were not highlighted before?
Additionally, the production build does not highlight those "new" errors.
I'm using
"typescript": "^4.7.4"
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-jsx": "^1.0.0",
and this is my tsconfig.json
The text was updated successfully, but these errors were encountered: