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>
Related
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.
I am having trouble accessing some functionality of Highcharts when using webpack to bundle my code/dependencies.
When I try to extend Highcharts like this:
import * as HC from "highcharts";
HC.Highcharts.Pointer.prototype.reset = function () {
return undefined;
};
console.log("Hello World!");
I get the following error:
Uncaught TypeError: Cannot read property 'Pointer' of undefined
at Object.<anonymous> (bundle.js:1)
at i (bundle.js:1)
at bundle.js:1
at bundle.js:1
All other functionality of Highcharts works without problems, but the above is not possible.
Without webpack it works, but I want to bundle my libraries.
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
I get
Uncaught TypeError occurs (Uncaught TypeError: Cannot read property
'__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined)
when I am using React JS
<script src="res/build/react-min.js"></script>
<script src="res/build/react-dom.min.js"></script>
The error is thrown because the react-dom cannot find an instance of React. I suppose this has something to do with the fact you are using res/build/react-min.js instead of res/build/react.min.js
Kudos for the function name in the react-dom tho:
(function(React) {
return React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
});
Yesterday I ran meteor update and updated to 1.0.3.1 and it broke what I was working on.
I'm not sure what broke, but even the hello world project that ships with meteor is broken. When I do:
meteor create test
cd test
meteor run
I get these errors:
minimongo.js:3193 Uncaught SyntaxError: Unexpected end of input
ddp.js:3557 Uncaught SyntaxError: Unexpected end of input
follower-livedata.js:24 Uncaught TypeError: Cannot read property 'DDP' of undefined
application-configuration.js:24 Uncaught TypeError: Cannot read property 'DDP' of undefined
mongo.js:1000 Uncaught SyntaxError: Unexpected end of input
autoupdate.js:25 Uncaught TypeError: Cannot read property 'DDP' of undefined
livedata.js:22 Uncaught TypeError: Cannot read property 'DDP' of undefined
observe-sequence.js:24 Uncaught TypeError: Cannot read property 'LocalCollection' of undefined
blaze.js:28 Uncaught TypeError: Cannot read property 'ObserveSequence' of undefined
ui.js:22 Uncaught TypeError: Cannot read property 'Blaze' of undefined
templating.js:23 Uncaught TypeError: Cannot read property 'Blaze' of undefined
spacebars.js:25 Uncaught TypeError: Cannot read property 'Blaze' of undefined
global-imports.js:9 Uncaught TypeError: Cannot read property 'DDP' of undefined
template.test.js:2 Uncaught ReferenceError: Template is not defined
test.js:5 Uncaught ReferenceError: Template is not defined
The test.js:5 points here:
(function(){if (Meteor.isClient) {
// counter starts at 0
Session.setDefault('counter', 0);
Template.hello.helpers({ // <-error here
counter: function () {
return Session.get('counter');
}
});
I don't understand why this is causing an error.
The .html reads:
<template name="hello">
<button>Click Me</button>
<p>You've pressed the button {{counter}} times.</p>
</template>
which looks fine but maybe I am missing something.
UPDATE:
What I have tried so far:
I ran rm -rf .meteor then ran meteor rebuild and I got:
this is your first time using Meteor! Installing a Meteor distribution in your home directory.
######################################################################## 100.0%
Packages rebuilt.
which sounded good so I ran meteor run:
=> Started proxy.
=> Started MongoDB.
=> Started your app.
=> App running at: http://localhost:3000/
and still got the same errors. actually looks like it works!