Serial undeclared error in 2.0.0.beta7

When I compile a sketch that run fine with ide 1.8.15, I become waves under Serial.begin etc.
The sketch still runs fine but I like to loose these waves...

See Still a lot of "undeclared" Arduino keywords

that don't give me a solution...

There is no solution at the moment. Arduino IDE 2.x is currently in the beta development phase. It is primarily only intended for use by those who are interested in beta testing and contributing to the development of this free open source software.

If you are only looking for a stable user experience, then you should be using Arduino IDE 1.8.15 until the production release of Arduino IDE 2.0.0 comes out.

I see the benifits of 2.0 so I will wait. Thanks

Post #6 in the link gave some details and (maybe between the lines) indicated that it's a bug.

It's definitely a bug. We already have one or two formal bug reports in the issue tracker about this specific problem, which I suspect will be sufficient to enable the developers to make an investigation.

But there are surely plenty of other bugs that haven't yet been reported, or ideas for enhancements that haven't yet been requested, so feedback is very much welcome.