Angular 8 - Getting Runtime compiler not loaded error - javascript

I need to dynamically create lazy loaded routes. When I use import syntax, e.g. loadChildren: () => import(`./pages/${module.moduleName}/${module.moduleName}.module`).then(m => m[childModuleName]), it works on JIT but when running on AOT, it throws this error:
ERROR Error: Uncaught (in promise): Error: Runtime compiler is not loaded as per https://github.com/angular/angular-cli/issues/10582 the solution would be to use the old string syntax:
```` loadChildren: ./pages/${module.moduleName/${module.moduleName}.module#${childModuleName},
I get this error:
``` ERROR Error: Uncaught (in promise): Error: Cannot find module './pages/client-migration/client-migration.module.ngfactory' ```

import the module name into your module.ts.

Related

"Uncaught Error: Cannot find module 'url"' by using matrix-js-sdk

The error is:
Uncaught Error: Cannot find module 'url'
I my only code is:
import sdk from 'matrix-js-sdk';
const client = sdk.createClient("https://matrix.org");
client.login("m.login.password", {"user": "Jak2k", "password": localStorage.getItem("pass")}).then((response) => {
console.log(response.access_token);
});
Before that, I just installed it with npm.(Maybe it's important, that I use react in the same package.)

error: A hook (`userconfig`) failed to load and module export

info: Winston logger has been started on Ridepal
error: A hook (userconfig) failed to load!
error: Failed to lift app: Error: When using aggregate, modules must export dictionaries. But module (scala\route-matcher) is invalid:function matchesRoute(testRoute) { console.log("testRoute", testRoute); return routes.some((route) => route.match(testRoute)); }enter image description here

Can't find variable: __TEST__

I'm new at Nativescript. Whenever I try to compile a project on my iPhone; It gives me this exception.
My phone on 14.0 and Nativescript on 7.0.11
Log is there:
2020-12-01 00:12:26.786 nsplaydev[49332:2731673] JavaScript error:
file:///app/tns_modules/react-nativescript/dist/nativescript-vue-next/runtime/registry.js:61:14: JS ERROR
ReferenceError: Can't find variable: _TEST_
2020-12-01 00:12:26.788 nsplaydev[49332:2731673] PlayLiveSync: Uncaught Exception
NativeScript encountered a fatal error: ReferenceError: Can't find variable: _TEST_
at
anonymous(file:///app/tns_modules/react-nativescript/dist/nativescript-vue-next/runtime/registry.js:61:14)

Failing to instantiate module due some error happening inside angular.js file, even thou the module is defined within package.json

I have this piece of code written and for some reason after I made some changed it complains within data obj css property.
The error says that the concat is not defined, even thou I have it on my packages.json defined.
.state('signup-facebook', {
url: '/students/signup',
templateUrl: MODULE_PATH + 'become/authentication/signup/connect-facebook.client.view.html',
controller: 'StudentAuthenticationController',
controllerAs: 'StudentAuthentication',
data: {
step: 1,
animate: true,
css: cssModules.students.concat(cssModules.users), // This line of code showing error
cssModuleName: 'students'
}
})
I just dont understand why this is not working.
Here you have the full error that Chrome displays:
Uncaught Error: [$injector:modulerr] Failed to instantiate module
coderstrust due to: Error: [$injector:modulerr] Failed to instantiate
module students due to: TypeError: Cannot read property 'concat' of
undefined
at config (http://localhost:3000/modules/students/client/config/students.become.client.routes.js:23:45)
at Object.invoke (http://localhost:3000/lib/angular/angular.js:4708:19)
at runInvokeQueue (http://localhost:3000/lib/angular/angular.js:4601:35)
at http://localhost:3000/lib/angular/angular.js:4610:11
at forEach (http://localhost:3000/lib/angular/angular.js:322:20)
at loadModules (http://localhost:3000/lib/angular/angular.js:4591:5).....
What is cssModules.students? The problem is not with concat. The problem is with cssModules.students which is undefined and when you will try to perform any method on undefined you will get an error.
Hope this helps :)
Happy Learning

How can I install the standalone ember router?

I'm having trouble installing this -> https://github.com/tildeio/router.js in my MVC project.
I first just loaded these two scripts:
vendor/deps/route-recognizer.js
dist/router.js
Added the line:
var router = new Router();
I ended up with the following console errors:
Uncaught ReferenceError: define is not defined ***route-recognizer.js:1***
Uncaught TypeError: Cannot read property 'Promise' of undefined ***router.js:2084***
Uncaught ReferenceError: Router is not defined
I then loaded these scripts:
vendor/loader.js
vendor/deps/backburner.js
vendor/deps/rsvp.js
vendor/deps/route-recognizer.js
dist/router.js
I get these errors:
Uncaught TypeError: Cannot read property 'Promise' of undefined ***router.js:2084***
Uncaught ReferenceError: Router is not defined
This is code where the 'Promise' error occurs:
define("route-recognizer", [], function() { return {"default": RouteRecognizer}; });
define("rsvp", [], function() { return RSVP;});
-->define("rsvp/promise", [], function() { return {"default": RSVP.Promise}; });
Is there a promise.js I need as well? I found a promise.js in the RSVP.js package but loading gives me another error.
Was having the same problem.
There seem to be a code change according to this post for router.js to work as a standalone.
Grab the laters rsvp, route-recognizer and router and create a router object like so
<script src="routerjs/rsvp-latest.js"></script>
<script src="routerjs/route-recognizer.js"></script>
<script src="routerjs/router.min.js"></script>
<script>
var router = new Router["default"]();
</script>

Categories