Skip to content Skip to sidebar Skip to footer

Ionic 3: Build In “prod” Mode: Cannot Find Module “.”

we have a large Ionic app that we’re trying to build in production mode since it’s almost ready. The first issue we found is that we were getting a “JavaScript heap out of me

Solution 1:

I found the problem. In my package.json I was using:

"typescript":"^2.9.1",

Decreasing the version to ~2.6.2 fixed it for me.

Solution 2:

Removing ^ from @ionic/app-scripts and typescript works for me as follows:

"devDependencies": {
    "@ionic/app-scripts": "3.1.9",
    "typescript": "2.8.3"
  }

Solution 3:

I had a similar problem, but the wrong typescript package was getting pulled in from a combination of other dependent projects as well as VS Code. I resolved it by pinning the exact version (no ^ or ~) of @ionic/app-scripts and typescript to what I needed.

"devDependencies": { "@ionic/app-scripts": "3.1.9", "typescript": "2.6.2" }

Solution 4:

For me work using

"@ionic/app-scripts": "3.2.3",
"typescript": "2.7.1",

if do you want to use typescript v3, you can try to build disabling aot (that I think is the problem of using prod tag) with other adicional options

--release --aot false --environment prod --output-hashing all --sourcemaps false --extract-css true --named-chunks false --build-optimizer true --minifyjs=true --minifycss=true --optimizejs=true

If not, I recommend you to move to ionic4/5

Solution 5:

Got this error with a new version and I checked the ionic-angular imports and it's fine.

package.json

"typescript":"3.1.6"

Ionic info

ionic (Ionic CLI)  : 4.4.0IonicFramework    : ionic-angular3.9.2
   @ionic/app-scripts : 3.2.0Cordova:

   cordova (Cordova CLI) : 8.1.1 (cordova-lib@8.1.0)
   CordovaPlatforms     : android7.0.0, browser5.0.3CordovaPlugins       : nowhitelistedplugins (0 plugins total)

error

vendor.js:138159 Uncaught Error: Cannot find module"."
    at webpackMissingModule(vendor.js:138159)
    at vendor.js:138159
    at Object.<anonymous> (vendor.js:138168)
    at __webpack_require__(vendor.js:55)
    at Object.<anonymous> (main.js:16031)
    at __webpack_require__(vendor.js:55)
    at webpackJsonpCallback(vendor.js:26)
    at main.js:1

Post a Comment for "Ionic 3: Build In “prod” Mode: Cannot Find Module “.”"