we have a project that’s using Node v12 and Angular 7. when i try to build the project with ng build i get An unhandled exception occurred: Object prototype may only be an Object or null: undefined
lots of people on the internet have this problem. there are a few dozen stackoverflow answers, and there are issues on both webpack and typescript the blame each other. it seems to have something to do with circular dependencies, but i’ve run madge --circular --extensions ts ./
which claims to find circular deps but it says none are found. in fact, if i delete all of the page source code other than the entry point, the error still occurs. so this seems to be a bug with the angular build system. i’ve hooked up a debugger and tried to step through the stack but i haven’t found anything useful.
a lot of people say “ok, run ng update.
” well, that doesn’t seem to do anything useful. i’ve tried updating to just node v14 and v16, i’ve tried running node-check-updates
to update dependencies. warping ahead to Angular 14 causes hundreds of errors in the project.