ethereumjs-monorepo icon indicating copy to clipboard operation
ethereumjs-monorepo copied to clipboard

VM Nightly Tests fail

Open holgerd77 opened this issue 1 year ago • 4 comments

The VM nightly tests complely fail for some time, see here for a latest run.

The error sounds relatively generic, eventually "only" TypeScript releated, but nevertheless very much into the source code, here is an extract:

grafik

This should get some attention and should be adressed soon, this might point to something which should also be fixed for end users.

holgerd77 avatar Feb 12 '24 11:02 holgerd77

I will post my findings here.

I had trouble reproducing the CI. I tried first rm package-lock.json and then npm i. Then I tried npm run clean and rm package-lock.json. In order to reproduce (do not run this!) I had to delete my entire global npm cache using npm cache clean --force. I now get the same error. I isolated the CI in #3285 and will now try to fix it.

jochem-brouwer avatar Feb 15 '24 22:02 jochem-brouwer

Side question: I think we should add the "clean build" run to our CI. It does not have to run any tests, we simply just check if we can do a clean build. (That way we likely find this issue earlier than we did now, since I still don't get the notifications of these failing runs :( ). The downside of this (which we should discuss) is that once we have this "clean build" error, then all our PRs will fail by default until we fix it.

jochem-brouwer avatar Feb 15 '24 22:02 jochem-brouwer

The problem is caused by: https://github.com/isaacs/node-lru-cache/commit/1fb116729f28fb610285f5ae455cb383f2d3d3bf and the fact that we use @types/core-js.

@types/core-js defines the interface for Map as:

interface Map<K, V> {
    toJSON(): any;
}

However, Map does actually not have this toJSON method. Due to us loading in devDependencies the builder now thinks that the LRU-Cache should have a toJSON method (which it does not) since I assume that this new Map interface now overrides the actual interface of Map (if I comment this out in node the Map type does also not get the toJSON method in VSCode).

Not sure how to proceed, I will pin the LRU-Cache to the working version in the package for now. Should I report a bug at @types/core-js? Line is here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/core-js/index.d.ts#L68 and it is there for 8 years. EDIT: have opened a discussion there. https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/68655

jochem-brouwer avatar Feb 15 '24 22:02 jochem-brouwer

Great analysis 😃, thanks! 👍

holgerd77 avatar Feb 16 '24 14:02 holgerd77