Runtime error using JoinTableOptions on #ManyToMany - typeorm

Having trouble trying to define a custom JoinTable on a ManyToMany relation in TypeORM.
Environment:
Node 16.13.0
TS 4.7.4
TypeORM 0.3.10
#ManyToMany(() => Series)
#JoinTable({
name: 'tv_group_series',
inverseJoinColumn: {
referencedColumnName: 'id',
name: 'tv_group_id'
},
joinColumn: {
referencedColumnName: 'id',
name: 'series_id'
}
})
shows: Series[];
Without the #JoinTable options provided above, the app runs, but when I add it I get the following error at runtime:
Uncaught M:\Code\MediaMogul\MediaMogulTwo\node_modules\typeorm\browser\index.js:3
compileFunction vm:352
wrapSafe loader:1031
Module._compile loader:1065
Module._extensions..js loader:1153
Module.load loader:981
Module._load loader:822
Module.require loader:1005
require helpers:102
(anonymous function) Group.ts:3
Module._compile loader:1101
Module._extensions..js loader:1153
Module.load loader:981
Module._load loader:822
Module.require loader:1005
require helpers:102
(anonymous function) TypeORMManager.ts:22
Module._compile loader:1101
Module._extensions..js loader:1153
Module.load loader:981
Module._load loader:822
Module.require loader:1005
require helpers:102
(anonymous function) www.ts:4
Module._compile loader:1101
Module._extensions..js loader:1153
Module.load loader:981
Module._load loader:822
executeUserEntryPoint run_main:81
(anonymous function) run_main_module:17
The "TypeORMManager.ts:22" line is just the import statement for the class. I wish there was a more descriptive error at the very least, and would love advice on how to get one. Clearly there's something gone wrong with the reflection on those decorators, but I can't debug what. It looks a lot like the working examples I've seen online.
Elsewhere in my code, I have working #Columns, #OneToMany, #ManyToOne relations, all with custom options as well.
Does anyone have any suggestions on how to debug this?
Thanks!

Nevermind. It turns out WebStorm auto-imported JoinTable from 'typeorm/browser' instead of 'typeorm'. Changed that, and it runs without issue.

Related

TypeError: undefined is not an object (evaluating 'Backbone.Wreqr.radio')

I am using Rails 4.2.6, Ruby 2.3.0, Backbone.js 1.3.3, MarionetteJS (Backbone.Marionette) v2.4.5, Underscore.js 1.8.3.
My application.js file is:
//= require jquery
//= require lib/underscore
//= require lib/backbone
//= require lib/marionette
//= require backbone/app
I am following the tutorial from backbonerails.com.
I am at the beginning of the chapter 5 and the app is empty, no footer, no header no main content.
I am getting this error:
TypeError: undefined is not an object (evaluating 'Backbone.Wreqr.radio')
_initChannel — marionette.self-5755e16504f179d152ad666130d554d6925cca98e4374dbad360dc6b42b17d74.js:3232
constructor — marionette.self-5755e16504f179d152ad666130d554d6925cca98e4374dbad360dc6b42b17d74.js:3100
(anonymous function) — app.self-a30509b2e8139de6bc6c843d616c92384df06b065083ad664d54a1bfa1e59250.js:4
(anonymous function) — app.self-a30509b2e8139de6bc6c843d616c92384df06b065083ad664d54a1bfa1e59250.js:16
global code — app.self-a30509b2e8139de6bc6c843d616c92384df06b065083ad664d54a1bfa1e59250.js:18
And this error, which I am assuming that is a consequence of the previous one:
ReferenceError: Can't find variable: Demo
(anonymous function) — localhost:24
fire — jquery.self-660adc51e0224b731d29f575a6f1ec167ba08ad06ed5deca4f1e8654c135bf4c.js:3233
fireWith — jquery.self-660adc51e0224b731d29f575a6f1ec167ba08ad06ed5deca4f1e8654c135bf4c.js:3363
ready — jquery.self-660adc51e0224b731d29f575a6f1ec167ba08ad06ed5deca4f1e8654c135bf4c.js:3583
completed — jquery.self-660adc51e0224b731d29f575a6f1ec167ba08ad06ed5deca4f1e8654c135bf4c.js:3618
Any clue what I am doing wrong here?

Uncaught TypeError: Cannot read property 'apply' of undefined - dart polymer

I'm a beginner with dart and polymer. When I run the web app in Chrome I get after a few seconds:
Uncaught TypeError: Cannot read property 'apply' of undefined js_dart2js.dart:310
JsObject.callMethod$2 js_dart2js.dart:310
_hookJsPolymer loader.dart:115
startPolymer loader.dart:55
initPolymer loader.dart:33
main init.dart:21
_IsolateContext.eval$1 isolate_helper.dart:432
startRootIsolate isolate_helper.dart:97
(anonymous function) arrrrivals.html_bootstrap.dart.js:24907
(anonymous function) arrrrivals.html_bootstrap.dart.js:24908
init.currentScript arrrrivals.html_bootstrap.dart.js:24886
(anonymous function) arrrrivals.html_bootstrap.dart.js:24899
(anonymous function) interop.dart:13
There are many similar questions for javascript but only one for dart: dart2js Uncaught TypeError cannot read property. However the answer there is just a request for more info. I have tried both 'pub build --mode=debug' and 'pub serve --mode=debug', as well as adding transformers in the pubspec.yaml, but I keep getting the feeling that my built code is minified. Arrrrivals is my app. How can I solve this?
---edited---
After perfecting my app in Dartium further, this error (for Chrome) changed:
Uncaught TypeError: Cannot read property 'element' of undefined prototype.js:205
f.findTypeExtension prototype.js:205
f.findTypeExtension prototype.js:206
f.registerPrototype prototype.js:190
f.register prototype.js:26
JsFunction.apply$2$thisArg js_dart2js.dart:337
_hookJsPolymer_registerDart.call$3 loader.dart:135
Primitives_applyFunction js_helper.dart:1066
_callDartFunction core_patch.dart:51
(anonymous function) js_dart2js.dart:103
d._register polymer-element.js:64
e.flush queue.js:128
e.ready queue.js:135
e.check queue.js:89
e.go queue.js:69
d.registerWhenReady polymer-element.js:53
d polymer.js:49
b polymer.js:36
JsFunction.apply$2$thisArg js_dart2js.dart:337
JsFunction.apply$1 js_dart2js.dart:339
Polymer_register instance.dart:170
main_closure50.call$0 arrrrivals.html_bootstrap.dart:165
startPolymer iterable.dart:310
initPolymer loader.dart:33
main init.dart:21
_IsolateContext.eval$1 isolate_helper.dart:432
startRootIsolate isolate_helper.dart:97
(anonymous function) arrrrivals.html_bootstrap.dart.js:26379
(anonymous function) arrrrivals.html_bootstrap.dart.js:26380
init.currentScript arrrrivals.html_bootstrap.dart.js:26358
(anonymous function) arrrrivals.html_bootstrap.dart.js:26371
(anonymous function) interop.dart:13
This issue was reported. The trick under comment #7 there let's me successfully build the javascript version on a one-off. Will be solved in Dart 1.6.

'undefined is not a function' from breeze insides, during basic setup

I assume it's extremely basic problem, but it caught me for two days, with no solution yet.
I'm creating a project with breeze, wrapped in requirejs, but I don't think that's the problem.
libraries loaded in dependencies are jquery, q, and datajs
breeze.config.initializeAdapterInstances({ dataService: "OData" });
var manager = new breeze.EntityManger('todo/Todos')
error Uncaught TypeError: undefined is not a function is thrown in second line above.
breeze.EntityManager is defined for sure, exception is thrown somewhere depeer in that function, stack trace from chrome below:
fire jquery.js?b=1394184954069:2913
self.add jquery.js?b=1394184954069:2959
jQuery.fn.jQuery.ready jquery.js?b=1394184954069:242
jQuery.fn.jQuery.init jquery.js?b=1394184954069:185
jQuery jquery.js?b=1394184954069:63
(anonymous function) main.coffee:186
context.execCb require.js:1635
Module.check require.js:871
(anonymous function) require.js:1112
(anonymous function) require.js:129
(anonymous function) require.js:1155
each require.js:57
Module.emit require.js:1154
Module.check require.js:925
(anonymous function) require.js:1112
(anonymous function) require.js:129
(anonymous function) require.js:1155
each require.js:57
Module.emit require.js:1154
Module.check require.js:925
Module.enable require.js:1142
Module.init require.js:779
callGetModule require.js:1169
context.completeLoad require.js:1549
context.onScriptLoad require.js:1656
Possibly there is a config line needed, I'm not aware of? Even when I removed the first line of two breeze.config.... error is still the same.
You are spelling Manager incorrectly
Manger - a long open box or trough for horses or cattle to eat from.
Manager - a person responsible for controlling or administering all or part of a company or similar organization.
Good luck!

Integrating bootstrap template with rails?

I bought a HTML/CSS bootstrap template from themeforest.net. And I'm trying to import it into rails so I could start editing it and developing further more.I followed all of the guides on how to add assets (js,images,fonts and css) into rails and rendering partials from application.html.erb , however, when I start rails site loads partially and when I check the Web developer console in Chrome it shows different errors with .js files. Here is the screenshot
Uncaught TypeError: Object [object Object] has no method 'superfish' script.js?body=1:2
(anonymous function) script.js?body=1:2
jQuery.fn.extend.addEventListener jquery.ui.map.js?body=1:341
jQuery.fn.(anonymous function) jquery.ui.map.js?body=1:370
(anonymous function) sliderhome.js?body=1:15
Uncaught ReferenceError: google is not defined jquery.ui.map.js?body=1:341
jQuery.fn.extend.addEventListener jquery.ui.map.js?body=1:341
jQuery.fn.(anonymous function) jquery.ui.map.js?body=1:370
(anonymous function) sliderhome2.js?body=1:15
Uncaught ReferenceError: google is not defined jquery.ui.map.js?body=1:341
jQuery.fn.extend.addEventListener jquery.ui.map.js?body=1:341
jQuery.fn.(anonymous function) jquery.ui.map.js?body=1:370
(anonymous function) sliderhome4.js?body=1:15
Uncaught ReferenceError: google is not defined jquery.ui.map.js?body=1:341
jQuery.fn.extend.addEventListener jquery.ui.map.js?body=1:341
jQuery.fn.(anonymous function) jquery.ui.map.js?body=1:370
(anonymous function) switcher.js?body=1:18
Uncaught ReferenceError: google is not defined jquery.ui.map.js?body=1:341
jQuery.fn.extend.addEventListener jquery.ui.map.js?body=1:341
jQuery.fn.(anonymous function) jquery.ui.map.js?body=1:370
(anonymous function) contact.js?body=1:6
l jquery.js?body=1:703
c.fireWith jquery.js?body=1:747
v.extend.ready jquery.js?body=1:514
A
Id very much appreciate any kind of help regarding this problem.
Thanks in advance
For theme integration from themeforest ..instead of remove gem and include bootstarp css file in assets/css folder you can also add custom css this way and as per your screenshot it seems that your js ordering is creating some problem so check out in application.js for your js includes ...

How do I include jQuery Mobile in my Emberjs Rails application

Today I encounter a puzzling issue and after several hours of searching I am not able to find what is the problem. I am trying to include jquery mobile into my rails application. I have tried both manually referencing the library files and also using jquery_mobile_rails gem. Both method works as far as inserting the library into my application, however as soon as I add jquery mobile, my app no longer loads. When refreshing the page, it will not load. There are three errors in console:
1st:
Uncaught TypeError: Object <Ember.ArrayResourceController:ember141> has no method '_resourceRequest'
Jimux.appsMetaController.Em.ArrayResourceController.create.findAll
newFunc
(anonymous function)
(anonymous function)
(anonymous function) jquery.js:566
jQuery.extend.globalEval jquery.js:567
jQuery.ajaxSetup.converters.text script jquery.js:8107
ajaxConvert jquery.js:7992
done jquery.js:7628
callback jquery.js:8367
send jquery.js:8373
jQuery.extend.ajax jquery.js:7835
(anonymous function) jquery.js:5858
jQuery.extend.each jquery.js:613
jQuery.fn.extend.domManip jquery.js:5855
jQuery.fn.extend.append jquery.js:5628
jQuery.fn.extend.wrapAll jquery.js:5585
(anonymous function) jquery.js:5603
jQuery.extend.each jquery.js:613
jQuery.fn.jQuery.each jquery.js:243
jQuery.fn.extend.wrapInner jquery.js:5598
$.extend.initializePage jquery.mobile-1.2.0.js:9063
(anonymous function) jquery.mobile-1.2.0.js:9142
fire jquery.js:976
self.fireWith jquery.js:1084
jQuery.extend.ready jquery.js:408
DOMContentLoaded
2nd:
Uncaught TypeError: Cannot call method 'set' of undefined
Ember.Application.registerInjection.injection
(anonymous function)
(anonymous function)
visit
DAG.topsort
Ember.Application.Ember.Namespace.extend.runInjections
Ember.Application.Ember.Namespace.extend.initialize
(anonymous function)
fire
self.fireWith
jQuery.extend.ready
3rd:
GET http://localhost:3000/assets/images/ajax-loader.gif 404 (Not Found)
As soon as I remove //= require jquery.mobile-1.2.0 from application.js, my app works as expected again -- without any of the above errors. I am just wondering what could be happening here. I guess there may be some namespace collision, but I am not sure if this is the case and how to identify and fix it.
Any help with debugging this issue will be appreciated. If you are using Embeejs+jQueryMobile in a rails project, I would love to know how you are including the two libraries into your rails application, and if/how you are dealing with any conflict.
I am using Ember 1.0pre1, and a slightly modified version of ember-rest.
If I recall correctly, jQuery Mobile manipulates the DOM a fair bit. That would likely be problematic with Ember, as Ember expects to not have other libraries manipulating DOM elements that it is tracking views or bindings for.

Resources