Dev mode giving multiple errors but everything works I use for example {{ craft.config.baseUrl }} where baseUrl is a custom variable in general.php

This works fine. But when I enable devMode it gives a template error 'craft variable unknown'.

I also get other template errors such as variable 'entry' unknown but I don't have a variable called entry in that template. These errors happen in my _layout template.

Weird thing is that with devMode false everything works fine.

I'm on mobile now but can post detailed code tomorrow if necessary.
One of the things Dev Mode does is put Twig into a strict mode where it will throw an error any time a variable is referenced that isn’t defined. So that explains why you’re only getting these errors when Dev Mode is enabled. The errors should also show the part of your template code where the error occurred.

If you are certain that this is a bug, please send in a ticket from your Dashboard, including your DB backup and template files, so we can look into it.