Structure errors

Hello,

A few days ago, I received some help from Tünde Keller in this thread.

I tested the code he provided, and everything was working nicely. Then earlier today I decided to try and implement that test code into a working project. Unfortunately, I was not getting the results I was expecting, even though I was using the exact same code which was already working for me in the test project.

I had to open up the debugging console on my browser to track down the problem. It was telling me that it couldn't read a certain property, etc etc. The exact error message was "Uncaught TypeError: Cannot read property 'digest' of undefined HashTest.js"

The strange thing is that the code is compiling with no errors. But I'm always seeing things that are underlined in red by code editor. And they're also showing up as Structure Errors (as you can see from the attached screenshot).

So I was thinking that something got corrupted with either my Delphi installation or with WEB Core. To try and figure out where the problem was originating, I decided to go to a clean VM. New installation of Windows 10, new installation of Delphi 10.3, and new installation of WEB Core 1.5.5.0. No other components have been installed. Everything is running from a clean install, and I'm still seeing the errors in the screenshot.

Can somebody please tell me what I'm supposed to do before I start pulling my hair out?

I had similar issues (different error messages of course).

Check your system path, project search paths etc for earlier versions of Delphi - and earlier versions of WEB Core - I had some Rio paths left over after I upgraded to Sydney.

As per what Bruno suggested to me at the time: Uninstall WEB Core using the windows application uninstaller.

After that uninstall, I hunted down and deleted any TMSWebCorePkgXXXX.bpl files I found.

I reinstalled Web Core and all was well again.

As I mentioned in my original post, this can't possibly be a path issue or old BPL files or anything like that.

This was in a new virtual machine with a clean Windows install, and a clean Delphi install, and a clean WEB Core install.

If I'm seeing structure errors on a completely new installation, the only logical explanation is that the problem is within WEB Core itself. Either the WEB Core installer is doing something wrong, or is not doing something that it should be doing.

This is not a case of user error.

Sorry Steve, I read as far as "Everything is running from a clean install" and missed the last bit where you indicated "I'm still seeing..."

So, "reader error" - apologies.

I just created the same test program in Delphi 10.4 I'm also getting an "error" about WEBLIB.Crypto, but it compiles and runs (which is absolutely no use to you, I know - sorry).

struct

EdB

Yeah, that's the most frustrating part about all of this, is that everything compiles. It claims it can't find "WEBLIB.Crypto". Well, if you can't find the file, how are you possibly compiling it? I really hate stupid nonsensical errors.

But this isn't the first time I'm seeing these kinds of errors. They're always there every time I open up any of my projects. There are always a bunch of things that are underlined with red, and the only way I can fix it is to right-click on one of the unit file names in the Uses section. As soon as the file is opened in the editor, the red underlines go away. Well, most of them go away. Some will never go away, such as the "JSValue" declarations.

I don't know if this is a Delphi problem or a WEB Core problem. If it's a Delphi problem, then it's definitely an ongoing issue because I have the exact same problem with my main 10.1 installation, as well as my 10.3 clean install test.

This may not be the issue but check to see it the 'Name' property is there with relevant components.

Because of Delphi quirks I had unintentionally deleted the value in the 'Name' property and then spent hours upon hours trying to figure out what was wrong as the program compiled without any errors, but at Run-Time of course it behaved badly.

Thankfully, my eyes happened to see the word 'Unnamed' and I spotted it.

Maybe it's something similar for you.

Regards.

Do you see the unit WEBLib.Crypto.pas in the subfolder "Component Library Source" under the TMS WEB Core install folder and is this folder added in your Delphi Win32 library path?

Hi Bruno,

Yes, all the source files are exactly where they should be. If any files were missing, the project could not possibly compile.

I tested this with a clean installation. All files are exactly where the installer put them, and the paths are exactly how the installer configured them.

And that brings us to another problem. If it's critical to have "Component Library Source" added to the Win32 library path, why is the WEB Core installer not doing this?

The only thing that the installer added to my Win32 library path is "WEB Core\RSXE12". Nothing else.

Update: I manually added "WEB Core\RSXE12\Component Library Source" to the Win32 library path. Then I closed Delphi and started it again. The structure errors are still there.

We will revisit the installer script to ensure the subfolder "Component Library Source" is automatically added to the IDE Win32 library path.

When it is added to the Win32 library path and the IDE is still somehow not picking this up, this must be an IDE issue. Do you have the latest IDE update packs installed?

Yes, both systems have the latest updates.

My primary development environment is Delphi 10.1 (Berlin) with update 2 (all of my components are installed).

Then I also have my clean install test system with Delphi 10.3 (Rio) with update 3 (only TMS WEB Core is installed).

Both versions of Delphi are behaving exactly the same.

And it can't be just me who is encountering this issue. A few hours ago, by coincidence, I was browsing through Wagner's online courses, and in one of his free sample videos, even he is experiencing this problem! It starts at time index 3:52 (immediately when he introduces a TJSArray into the code). And when he made that video, he was using WEB Core 1.0.5.3, so this isn't some new issue that just recently appeared.

Just FYI: I checked my lib paths - (Delphi 10.4) - it didn't have "Component Library Source" either.

Oddly enough, it had many copies of the other paths:
tmspaths

The RSX13 and RSX13\Win32 paths were also in there in 3 other places.

I've downloaded (but not installed) 1.5.5.2 - I'm going to do a "windows uninstall" of Web Core, delete all the lib path entries (and .bpl files), then install 1.5.5.2 and see what it does.

It's going to be a couple of hours before I can get to do this though, so - Bruno, if there's anything else in particular you want me to look for let me know.

(Although, at the rate you folks are advancing with web core, 1.5.5.3 might be out before I get home tonight!)

EdB

Hi Ed,

Thanks for offering to help out.

Much appreciated.

No problem Steve - I'm happy to at least try and help sort this out - particularly since every time I've had an issue, Bruno or Wagner would sort me out very quickly (I once posted an issue and Bruno replied with the solution in under 4 minutes).

Support like that deserves a little extra effort in return.

At any rate, I did the following:

  • uninstall WEB core with "windows installer"
  • deleted TMSWEBCorePkgXXX.bpl (and the .dcp files)
  • started Sydney, checked lib path:
    lib-path1

You can see the Component Library Source is grayed out (folder gone).
I had added this manually based on this topic's information.
I'm thinking it wasn't removed because the installer wasn't responsible for it being added.

  • deleted the invalid Component Library Source path
  • checked to make sure no web core packages were visible
  • closed Delphi
  • used regedit to purge all TMSWebCorexxx references
  • started and closed Delphi
  • installed (with subscription manager) Web Core 1.5.5.2
  • started Delphi - only ...RSXE13 and ...RSXE13\Win32 in Library paths
  • opened the test program that used WELIB.Crypto
    lib-path2
  • compiled and successfully ran the web app
  • added ...\Component Library Source to library pathlib-path3
  • compiled and successfully ran the web app

So - on my machine (VMWare virtual machine: Win10Home-64, RADStudio Enterprise 10.4) installing Web core does not add Component Library Source to the library paths.

When I add it manually, the LSP error goes from "could not find used unit..." to "Could not compile used unit..."

That's all I have to offer - but let me know if there's anything else I might be able to test on this machine...

EdB