You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`
TypeError: _vm(...).SyntheticModule is not a constructor
at Runtime.loadCjsAsEsm (node_modules/jest-runtime/build/index.js:657:20)
at node_modules/src/auth/auth.ts:83:52
at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:402:30)
at ProxyZoneSpec.Object.<anonymous>.ProxyZoneSpec.onInvoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:3746:43)
at ZoneDelegate.Object.<anonymous>.ZoneDelegate.invoke (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:401:56)
at Zone.Object.<anonymous>.Zone.run (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:162:47)
console.log
before crash
at spec/tests/app/synthetic_module_fail.spec.ts:18:13
console.log
after crash
at spec/tests/app/synthetic_module_fail.spec.ts:20:13
console.error
Unhandled Promise rejection: TypeError: _vm(...).SyntheticModule is not a constructor
at Runtime.loadCjsAsEsm (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:657:20)
at Runtime.linkModules (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:619:17)
at importModuleDynamically (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:1363:23)
at importModuleDynamicallyWrapper (internal/vm/module.js:432:21)
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:37:14)
at C:\Lander\WS\acro-companion\node_modules\src\auth\auth.ts:83:52
at ZoneDelegate.Object..ZoneDelegate.invoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing
-bundle.umd.js:402:30)
at ProxyZoneSpec.Object..ProxyZoneSpec.onInvoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-tes
ting-bundle.umd.js:3746:43)
at ZoneDelegate.Object..ZoneDelegate.invoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing
-bundle.umd.js:401:56)
at Zone.Object..Zone.run (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing-bundle.umd.js:162:
47) ; Zone: ProxyZone ; Task: Promise.then ; Value: TypeError: _vm(...).SyntheticModule is not a constructor
at Runtime.loadCjsAsEsm (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:657:20)
at Runtime.linkModules (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:619:17)
at importModuleDynamically (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:1363:23)
at importModuleDynamicallyWrapper (internal/vm/module.js:432:21)
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:37:14)
at C:\Lander\WS\acro-companion\node_modules\src\auth\auth.ts:83:52
at ZoneDelegate.Object..ZoneDelegate.invoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing
-bundle.umd.js:402:30)
at ProxyZoneSpec.Object..ProxyZoneSpec.onInvoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-tes
ting-bundle.umd.js:3746:43)
at ZoneDelegate.Object..ZoneDelegate.invoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing
-bundle.umd.js:401:56)
at Zone.Object..Zone.run (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing-bundle.umd.js:162:
47) undefined
at Object.api.onUnhandledError (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:1104:29)
at handleUnhandledRejection (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:1132:17)
at _loop_2 (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:1123:21)
at Object.api.microtaskDrainDone (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:1127:17)
at drainMicroTaskQueue (node_modules/zone.js/bundles/zone-testing-bundle.umd.js:629:22)
console.error
Error: Uncaught [TypeError: _vm(...).SyntheticModule is not a constructor]
at reportException (C:\Lander\WS\acro-companion\node_modules\jest-environment-jsdom\node_modules\jsdom\lib\jsdom\living\helpe
rs\runtime-script-errors.js:62:24)
at Timeout.task [as _onTimeout] (C:\Lander\WS\acro-companion\node_modules\jest-environment-jsdom\node_modules\jsdom\lib\jsdom
\browser\Window.js:396:9)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7) TypeError: _vm(...).SyntheticModule is not a constructor
at Runtime.loadCjsAsEsm (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:657:20)
at Runtime.linkModules (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:619:17)
at importModuleDynamically (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:1363:23)
at importModuleDynamicallyWrapper (internal/vm/module.js:432:21)
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:37:14)
at C:\Lander\WS\acro-companion\node_modules\src\auth\auth.ts:83:52
at ZoneDelegate.Object..ZoneDelegate.invoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing
-bundle.umd.js:402:30)
at ProxyZoneSpec.Object..ProxyZoneSpec.onInvoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-tes
ting-bundle.umd.js:3746:43)
at ZoneDelegate.Object..ZoneDelegate.invoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing
-bundle.umd.js:401:56)
at Zone.Object..Zone.run (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing-bundle.umd.js:162:
47)
at VirtualConsole.<anonymous> (node_modules/jest-environment-jsdom/node_modules/jsdom/lib/jsdom/virtual-console.js:29:45)
This discussion was converted from issue #2691 on December 10, 2020 02:51.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Version info
AngularFire 6.1.1
Firebase 8.1.1
Angular 11.0.1
Jest 26.6.3
I'm also referencing this issue, that is the predecessor:
#2549
failing unit test
Running this unit test:
`
import { TestBed } from '@angular/core/testing';
import { AngularFireModule } from '@angular/fire';
import { environment } from '../../../src/environments/environment';
import { AngularFireAuth, AngularFireAuthModule } from '@angular/fire/auth';
let normalUserEmail: string = '[email protected]';
let normalUserPass: string = 'some_password';
describe.only('Test', () => {
beforeEach(async () => {
TestBed.configureTestingModule({
imports: [AngularFireModule.initializeApp(environment.firebaseConfig), AngularFireAuthModule],
});
await TestBed.compileComponents();
});
it('Example 1', async (done) => {
console.log('before crash');
let angularFireAuth = TestBed.inject(AngularFireAuth);
console.log('after crash');
await angularFireAuth.signInWithEmailAndPassword(normalUserEmail, normalUserPass);
done();
});
});
`
logging
Will create this error:
`
TypeError: _vm(...).SyntheticModule is not a constructor
console.log
before crash
console.log
after crash
console.error
Unhandled Promise rejection: TypeError: _vm(...).SyntheticModule is not a constructor
at Runtime.loadCjsAsEsm (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:657:20)
at Runtime.linkModules (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:619:17)
at importModuleDynamically (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:1363:23)
at importModuleDynamicallyWrapper (internal/vm/module.js:432:21)
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:37:14)
at C:\Lander\WS\acro-companion\node_modules\src\auth\auth.ts:83:52
at ZoneDelegate.Object..ZoneDelegate.invoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing
-bundle.umd.js:402:30)
at ProxyZoneSpec.Object..ProxyZoneSpec.onInvoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-tes
ting-bundle.umd.js:3746:43)
at ZoneDelegate.Object..ZoneDelegate.invoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing
-bundle.umd.js:401:56)
at Zone.Object..Zone.run (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing-bundle.umd.js:162:
47) ; Zone: ProxyZone ; Task: Promise.then ; Value: TypeError: _vm(...).SyntheticModule is not a constructor
at Runtime.loadCjsAsEsm (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:657:20)
at Runtime.linkModules (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:619:17)
at importModuleDynamically (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:1363:23)
at importModuleDynamicallyWrapper (internal/vm/module.js:432:21)
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:37:14)
at C:\Lander\WS\acro-companion\node_modules\src\auth\auth.ts:83:52
at ZoneDelegate.Object..ZoneDelegate.invoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing
-bundle.umd.js:402:30)
at ProxyZoneSpec.Object..ProxyZoneSpec.onInvoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-tes
ting-bundle.umd.js:3746:43)
at ZoneDelegate.Object..ZoneDelegate.invoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing
-bundle.umd.js:401:56)
at Zone.Object..Zone.run (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing-bundle.umd.js:162:
47) undefined
console.error
Error: Uncaught [TypeError: _vm(...).SyntheticModule is not a constructor]
at reportException (C:\Lander\WS\acro-companion\node_modules\jest-environment-jsdom\node_modules\jsdom\lib\jsdom\living\helpe
rs\runtime-script-errors.js:62:24)
at Timeout.task [as _onTimeout] (C:\Lander\WS\acro-companion\node_modules\jest-environment-jsdom\node_modules\jsdom\lib\jsdom
\browser\Window.js:396:9)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7) TypeError: _vm(...).SyntheticModule is not a constructor
at Runtime.loadCjsAsEsm (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:657:20)
at Runtime.linkModules (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:619:17)
at importModuleDynamically (C:\Lander\WS\acro-companion\node_modules\jest-runtime\build\index.js:1363:23)
at importModuleDynamicallyWrapper (internal/vm/module.js:432:21)
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:37:14)
at C:\Lander\WS\acro-companion\node_modules\src\auth\auth.ts:83:52
at ZoneDelegate.Object..ZoneDelegate.invoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing
-bundle.umd.js:402:30)
at ProxyZoneSpec.Object..ProxyZoneSpec.onInvoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-tes
ting-bundle.umd.js:3746:43)
at ZoneDelegate.Object..ZoneDelegate.invoke (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing
-bundle.umd.js:401:56)
at Zone.Object..Zone.run (C:\Lander\WS\acro-companion\node_modules\zone.js\bundles\zone-testing-bundle.umd.js:162:
47)
`
Expected behavior
That the test would not crash
Actual behavior
the test crashes
Beta Was this translation helpful? Give feedback.
All reactions