ReferenceError: p is not defined [SOLVED]

#1

I have a project breaking error that I can’t figure out which just randomly started appearing. Here is some background information:

OS: Windows 10
Ionic-CLI Version: 4.0.6
Node version 6.9.4
Build Target: Browser/Web

Yesterday, my project was working fine with npm run start. Today, without making any changes to the code, when I try to compile it, I get the following error on the browser screen log:

ReferenceError: p is not defined
at http://localhost:8100/build/vendor.js:12331:1
at Object. (http://localhost:8100/build/vendor.js:12469:2)
at Object.webpack_exports.c (http://localhost:8100/build/vendor.js:19713:30)
at webpack_require (http://localhost:8100/build/vendor.js:55:30)
at Object. (http://localhost:8100/build/vendor.js:79851:72)
at webpack_require (http://localhost:8100/build/vendor.js:55:30)
at Object.214 (http://localhost:8100/build/main.js:1307:92)
at webpack_require (http://localhost:8100/build/vendor.js:55:30)
at webpackJsonpCallback (http://localhost:8100/build/vendor.js:26:23)
at http://localhost:8100/build/main.js:1:1

I had no idea what the random p was, so I tracked it down in developer mode in the browser and ended up finding this:

  RendererAdapter.prototype.listen = /**
     * @param {?} renderElement
     * @param {?} name
     * @param {?} callback
     * @return {?}
     */
    function (renderElement, name, callback) {
        return this.delegate.listen(renderElement, name, /** @type {?} */ (callback));
    };
p   /**
     * @param {?} target
     * @param {?} name
     * @param {?} callback
     * @return {?}
     */
    RendererAdapter.prototype.listenGlobal = /**
     * @param {?} target
     * @param {?} name
     * @param {?} callback
     * @return {?}
     */

That’s literally a random p in the middle of nowhere, which I can’t account for.

The console log was a little more detailed.

Uncaught ReferenceError: p is not defined
at core.js:11957
at Object. (core.js:12095)
at Object.webpack_exports.c (core.js:19337)
at webpack_require (bootstrap 06eb7fe7a52aeceec8e0:54)
at Object. (vendor.js:79851)
at webpack_require (bootstrap 06eb7fe7a52aeceec8e0:54)
at Object.214 (overview.module.ts:13)
at webpack_require (bootstrap 06eb7fe7a52aeceec8e0:54)
at webpackJsonpCallback (bootstrap 06eb7fe7a52aeceec8e0:25)
at main.js:1

Based off this information, I checked my overview.module.ts file, and it is as follows:

import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { OverviewPage } from './overview';

@NgModule({
  declarations: [
    OverviewPage
  ],
  imports: [
    IonicPageModule.forChild(OverviewPage)
  ]
})
export class OverviewPageModule {}

Line 13 is the line that says export class etc. I see nothing wrong with this code, as all my other modules look that way. When I comment out this module and exclude the page from my file, the console error changes to this:

Uncaught ReferenceError: p is not defined
at core.js:11957
at Object. (core.js:12095)
at Object.webpack_exports.c (core.js:19337)
at webpack_require (bootstrap 020c11d4aee50a9c4754:54)
at Object. (vendor.js:79850)
at webpack_require (bootstrap 020c11d4aee50a9c4754:54)
at Object.213 (main.js:1316)
at webpack_require (bootstrap 020c11d4aee50a9c4754:54)
at webpackJsonpCallback (bootstrap 020c11d4aee50a9c4754:25)
at main.js:1

I’m extremely confused because I have a few other ionic projects on my computer and I tried compiling them after and none of them are giving me this error, only this one, which makes me suspect its something I did and not an Ionic problem, but I can’t place it. I’m genuinely lost as to what to do and would greatly appreciate help, thanks in advance!

#2

Transfer your code to a fresh new working project step by step or in full

If that solves it, forget about the issue

#3

This fixed my problem, thank you. Still curious as to why though.