-
Notifications
You must be signed in to change notification settings - Fork 158
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
error TS2339: Property 'openStream' does not exist on type 'URL'. #593
Comments
Any suggestion on how to proceed. We are stuck and do not know how to resolve the issue. |
Umm... That is intriguing. I am trying it out. |
After a closer look, it seems that the generated code is wrong. It should use the URL's full qualified name:
Looks like a unwanted type mapping... did you add any adapter or extra configuration (extension)? I will take a deeper look ASAP. |
I did not add any mappings or any extra extensions. By the way I could only get the J4TS to compile It fails when I use the transpiler 2.3.6 and 2.37. |
Ok. I have good news. I have managed to reproduce the problem. Looks like a type mapping legacy issue... A real bug anyway. Less good news is that I need some time to replay the tests and make a release because such a fix might have side effects... If you are in a hurry and would like to apply the fix yourself (at your own risks), you may want to try the following steps:
|
the getHosts method also has the same problem. |
Yes, of course. All the methods in I know it is confusing, because they have the same name and represent the same thing, but a The fix I have provided will remove the mapping of |
Where is the source located? |
We are getting the following errors. With transpiler: 2.3.7, jsweet.core.version: 602. We are using the URL definition in the JSweet j4ts GIT Repo. It has openStream function defined on the URL class. It is unclear why we are getting this error. I do not have access to Stack Over flow forums from my firm. I would appreciate any suggestions to work around this issue.
Error:
2020-05-29 08:27:16.016 INFO TypeScript2JavaScriptWithTscTranspiler:90 - EspBus.ts(264,58): error TS2339: Property 'openStream' does not exist on type 'URL'.
2020-05-29 08:27:16.016 ERROR output:55 - property 'openStream' does not exist on type 'URL' at EspBus.java(455)
EspBus.ts
262 let urlStr : string = this.root.toString();
263 let url : URL = new URL(urlStr);
264 let inStream : java.io.InputStream = url.openStream();
265 this.loop(inStream);
EspBus.java
450 String urlStr = this.root.toString();
451 final URL url = new URL( urlStr );
455 InputStream inStream = url.openStream ();
456 loop ( inStream );
j4ts Code
public InputStream openStream() {
XMLHttpRequest request = makeConnection();
The text was updated successfully, but these errors were encountered: