Build/Serve Error

Hi there,
i just passed from an MacBook with HighSierra and XCode9 to a iMac with Mojave and XCode11
i noticed that after the new installation of ionic and npm, the new version and the old one are different

I cloned a git project in my new mac
I typed ionic repair to get my old resources
When i ionic serve this happen

[ng] ERROR in ./node_modules/@ionic/core/dist/esm-es5/loader.mjs 4:11-19
[ng] Can't import the named export 'a' from non EcmaScript module (only default export is available)
[ng] ERROR in ./node_modules/@ionic/core/dist/esm-es5/loader.mjs 6:8-21
[ng] Can't import the named export 'b' from non EcmaScript module (only default export is available)
[ng] ERROR in ./node_modules/@ionic/core/dist/esm-es5/loader.mjs 5:8-15
[ng] Can't import the named export 'g' from non EcmaScript module (only default export is available)
[ng] ERROR in ./node_modules/@ionic/core/dist/esm-es5/index.mjs 7:0-205
[ng] Can't reexport the named export 'a' from non EcmaScript module (only default export is available)
[ng] ERROR in ./node_modules/@ionic/core/dist/esm-es5/index.mjs 7:0-205
[ng] Can't reexport the named export 'b' from non EcmaScript module (only default export is available)
[ng] ERROR in ./node_modules/@ionic/core/dist/esm-es5/index.mjs 7:0-205
[ng] Can't reexport the named export 'c' from non EcmaScript module (only default export is available)
[ng] ERROR in ./node_modules/@ionic/core/dist/esm-es5/index.mjs 7:0-205
[ng] Can't reexport the named export 'l' from non EcmaScript module (only default export is available)
[ng] ERROR in ./node_modules/@ionic/core/dist/esm-es5/index.mjs 7:0-205
[ng] Can't reexport the named export 'm' from non EcmaScript module (only default export is available)
[ng] ERROR in ./node_modules/@ionic/core/dist/esm-es5/index.mjs 7:0-205
[ng] Can't reexport the named export 'p' from non EcmaScript module (only default export is available)
[ng] ERROR in ./node_modules/@ionic/core/dist/esm-es5/index.mjs 7:0-205
[ng] Can't reexport the named export 't' from non EcmaScript module (only default export is available)
[ng] ERROR in ./node_modules/@ionic/core/loader/index.mjs 21:0-47
[ng] Can't reexport the namespace object from non EcmaScript module (only default export is available)
[ng] ERROR in ./node_modules/@ionic/core/dist/esm-es5/overlays-10640d86.js 177:37
[ng] Module parse failed: Unexpected token (177:37)
[ng] You may need an appropriate loader to handle this file type.
[ng] |             case 1:
[ng] |                 _a.trys.push([1, 4, , 5]);
[ng] >                 return [4 /*yield*/, import('./index-69c37885.js')];
[ng] |             case 2:
[ng] |                 mod = _a.sent();
[ng] ERROR in ./node_modules/@ionic/core/dist/esm-es5/core-57385ee8.js 69:11
[ng] Module parse failed: Unexpected token (69:11)
[ng] You may need an appropriate loader to handle this file type.
[ng] |         return module[exportName];
[ng] |     }
[ng] >     return import(
[ng] |     /* webpackInclude: /\.entry\.js$/ */
[ng] |     /* webpackExclude: /\.system\.entry\.js$/ */
[ng] ERROR in ./node_modules/@ionic/core/dist/esm/polyfills/index.js 7:18
[ng] Module parse failed: Unexpected token (7:18)
[ng] You may need an appropriate loader to handle this file type.
[ng] | 
[ng] |   if (!win.customElements || (win.Element && (!win.Element.prototype.closest || !win.Element.prototype.matches || !win.Element.prototype.remove))) {
[ng] >     promises.push(import('./dom.js'));
[ng] |   }
[ng] | 
[ng] ℹ 「wdm」: Failed to compile.

how can i solve it???
please help :wink:

thank you all! :slight_smile:
nice answers

135 views, NO REPLIES

1 Like

I just have same problem,

Don’t know why but, “have you tried turning it off and on again” trick works for me :stuck_out_tongue:

Remove your node_modules, your package-lock.json and execute npm i.

If it doesn’t work for you, you can read this issue at github for help: https://github.com/microsoft/TypeScript/issues/22321

already done that. no changes

Any updates, I see the same issue?

no dude. same issue…

Are you using jspdf by chance? What is your full ionic info command give? I have come to the conclusion that it is jsPDF v 1.5.3 that is causing the issue in my case, it appears to be the same error. So it is jsPDF or one of the transitive dependencies of it

Hi,

I experienced this one also. I fixed it by upgrading to angular 8.