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

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

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.)

uncaught promise rejection: failed to eval source for module 'nanoid': node_modules/nanoid/index.cjs

I'm trying to use nanoid (https://www.npmjs.com/package/nanoid/v/2.1.2)
exports = async function(){
const nanoid = require("nanoid");
const uid = nanoid(10);
}
From within MongoDB realm runtime, but it throws:
uncaught promise rejection: failed to eval source for module 'nanoid': node_modules/nanoid/index.cjs: Line 9:7 Unexpected identifier (and 16 more errors)
And this is about all the error I can see from the Realm Dashboard.
What could be missing?
The solution that worked for me:
Install a lower version nanoid
npm i nanoid#2.1.2
Then upload the package to MongoDB Realm functions through the dashboard.

Angular 8 - Getting Runtime compiler not loaded error

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.

Fix an import error and TypeError: ActiveDirectory is not a constructor

I want to use active directory in a Vue.js web app but once the module is install, I try to run my app several errors appears...
After installing the module: npm install activedirectory --save
I do have a form with login/password, and while I submit, activedirectory module is launched:
var ActiveDirectory = require("activedirectory");
var config = {
host: "147.156.182.39",
port: "452",
baseDN: "dc=juice,dc=fr",
username: "anfinsol_save#juice.fr",
password: "password123"
};
Errors while first click:
[Vue warn]: Error in v-on handler: "TypeError: unknown stream type "undefined""
found in
---> <AthentComponent> at src/components/subcomponents/AuthentComponent.vue
<MainPage> at src/views/Accueil.vue
<App> at src/App.vue
<Root> vue.runtime.esm.js:619
VueJS 7
TypeError: "unknown stream type "undefined""
addStream bunyan.js:620
Logger bunyan.js:470
Logger bunyan.js:469
createLogger bunyan.js:1618
<anonymous> activedirectory.js:16
<anonymous> activedirectory.js:1901
js app.js:925
__webpack_require__ app.js:767
fn app.js:130
<anonymous> index.js:1
js app.js:914
__webpack_require__ app.js:767
fn app.js:130
submit AuthentComponent.vue:52
Second click error:
[Vue warn]: Error in v-on handler: "TypeError: ActiveDirectory is not a constructor"
found in
---> <AthentComponent> at src/components/subcomponents/AuthentComponent.vue
<MainPage> at src/views/Accueil.vue
<App> at src/App.vue
<Root> vue.runtime.esm.js:619
TypeError: "ActiveDirectory is not a constructor"
submit AuthentComponent.vue:57
VueJS 3
Use activedirectory properly with no errors, I already tryed several versions and uninstall/install the module but still not working.

Unable to pass dependency in Restangular config function(AngularJs)

I have the following code:
function configRestangular(RestangularProvider, BASE_URL) {
RestangularProvider.setBaseUrl(BASE_URL);
RestangularProvider.setDefaultHeaders({ 'Content-Type': 'application/json' });
RestangularProvider.setErrorInterceptor(
function (response, deferred) {
if (response.status === 401 || response.status === 403) {
//$state.go('login');
}
});
}
core.config(configRestangular);
When I pass $localStorage to function configRestangular(RestangularProvider, BASE_URL), application throws an exception.
Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module app.core due to:
Error: [$injector:unpr] Unknown provider: $localStorage
http://errors.angularjs.org/1.4.0-rc.2/$injector/unpr?p0=%24localStorage
I have registered the ngStorage module in main module. ngStorage.js file is also added in my main page. $localStorage service is working in all controllers except this config function.
I am using https://github.com/gsklee/ngStorage module for localStorage.
You also have to add 'ngStorage' and 'RestangularProvider' as a dependency for your application:
var app = angular.module('MyApp', ['ngStorage','RestangularProvider']);

Categories