ModalDirective causing error in Angular Universal - ngx-bootstrap

I have a ModalDirective from ngx-bootstrap version 1.9.3 and am using Angular 4. When a call is made to show() when code is executing on the server side (I am using Angular Universal), I am getting the following exception:
Cannot read property 'body' of undefined
TypeError: Cannot read property 'body' of undefined
at ModalDirective.checkScrollbar (ClientApp\dist\main-server.js:49156:105)
at ModalDirective.show (ClientApp\dist\main-server.js:48977:14)
at ConfirmModalComponent.show (ClientApp\dist\main-server.js:48086:27)
at SafeSubscriber._error (ClientApp\dist\main-server.js:87270:41)
at SafeSubscriber.module.exports.SafeSubscriber.__tryOrUnsub (ClientApp\dist\vendor.js:574:16)
at SafeSubscriber.module.exports.SafeSubscriber.error (ClientApp\dist\vendor.js:533:26)
at Subscriber.module.exports.Subscriber._error (ClientApp\dist\vendor.js:464:26)
at Subscriber.module.exports.Subscriber.error (ClientApp\dist\vendor.js:438:18)
at MapSubscriber.module.exports.Subscriber._error (ClientApp\dist\vendor.js:464:26)
at MapSubscriber.module.exports.Subscriber.error (ClientApp\dist\vendor.js:438:18)
Is the code not built to support Angular Universal or is there something I need to do in order to get this working?

Please update ngx-bootstrap to 2.0.0-beta.8, it supports Angular Universal.

Related

Unable to locate a class or view for component, livewire - jetstreem

I had a net project in laravel 8, i just installed jetstream:livewire but when i try to call some compose for example:
<x-jet-dropdown>
It throws me the following error that I can't solve
Seem to be a typo.
In your error message is says jet-dropdowm <- with "m".

FullCalendar Angular 13 error when importing npm library

I have an npm library which imports Angular FullCalendar v5 and everything works fine there. When i try to import my project library to another project and try access the full calendar frontend I got a warning and a message error in my browser console:
- Warning: main.js:7358 Unknown option 'default'
- Error: core.mjs:6476 ERROR TypeError: Language ID should be string or object.
at new DateTimeFormat (<anonymous>)
at buildNativeFormattingFunc (main.js:1218)
at NativeFormatter.buildFormattingFunc (main.js:1211)
at NativeFormatter.buildFormattingFunc (main.js:1009)
at NativeFormatter.format (main.js:1154)
at NativeFormatter.formatRange (main.js:1169)
at DateEnv.formatRange (main.js:3984)
at CalendarDataManager.buildTitle (main.js:6909)
at CalendarDataManager.buildTitle (main.js:1009)
at CalendarDataManager.updateData (main.js:7113)
I can't figure it out why but i know it's in this line of code at main.js (#fullcalendar/common/main.js)
Line 1218 -> var normalFormat = new Intl.DateTimeFormat(context.locale.codes, standardDateProps); The error is that the variable context.locale.codes is undefined.
Can anyone help?
I've just had the same error. Not that I was importing a project library of my own but I was importing the Fullcalendar library (from node_modules). I had enabled localization using the locale property of the calendar options but I always got this error Language ID should be string or object.
Two things was wrong:
I was importing the locale code incorrectly which resulted in this error. The current version of Fullcalendar (6.0.0) has all its locale code under #fullcalendar/core/locales.
I was using dynamic import like this: import("#fullcalendar/core/locales/da") and it worked fine but I had to access the default property of the exported object. Using async/await syntax it becomes:
const localeModule = await import("#fullcalendar/core/locales/da");
const calendar = new Calendar(someElement, {
(...),
locale: localeModule.default
});
Not directly answering your question but it sounds like you're using locale, too, and your other project is importing your project library in a way that makes the default property of the module containing the locale code undefined.

Missing Template Arguments for pcl::gpu::EuclideanClusterExtraction in PCL-1.12

I am trying this example to use PCL with GPU and get the error
~/gpu-pcl/main.cpp:85: error: missing template arguments before ‘gec’
pcl::gpu::EuclideanClusterExtraction gec;
I have tried that example with pcl-1.11.1 and it worked well .But when updated to pcl-1.12.1, I get that error.
My work environment:
Ubuntu 18.04,
with Cmake version 3.20,
Is there anything that I have missed out??
In the documentation of pcl1.12:
template
class pcl::gpu::EuclideanClusterExtraction< PointT >
EuclideanClusterExtraction is a template class, thus the type of point of the point cloud is needed in the position of PointT, for example, PointXYZ.[https://pointclouds.org/documentation/classpcl_1_1gpu_1_1_euclidean_cluster_extraction.html#details]

The 'graphlib' utility is a mandatory dependency

I am using joint js 3.1.1 version and graphlib 2.1.8 version.
I have a code in my app to check cyclic reference in graph. For that purpose I have written below code
graphlib.alg.findCycles(graph.toGraphLib())
This line gives following error
Uncaught Error: The the "graphlib" utility is a mandatory dependency.
at Object.toGraphLib (joint.min.js?de6d:8)
at child.He.toGraphLib (joint.min.js?de6d:8)
at RestrictCyclicConnection (links.js?2d1e:46)
at child.eval (businessobjectdesigner.vue?b25b:856)
at triggerEvents (backbone.js?ab5c:338)
at triggerApi (backbone.js?ab5c:322)
at eventsApi (backbone.js?ab5c:110)
at child.Events.trigger (backbone.js?ab5c:312)
at child.notify (joint.min.js?de6d:8)
at child._notifyConnectEvent (joint.min.js?de6d:8)
I have imported graphlib in my file also. But still getting following error.
I have imported graphlib as
import graphlib from 'graphlib'
You can try by passing graphlib as a part of the options object, as follows-
graph.toGraphLib({graphlib: graphlib})

Cannot find module 'casper' with 1.1 beta

This command was working:
/usr/local/Cellar/casperjs/1.0.2/libexec/bin/casperjs myfile.coffee
Now I want to use 1.1 like so:
/usr/local/Cellar/casperjs/1.1-beta3/libexec/bin/casperjs myfile.coffee
But now I get this error:
Error: Cannot find module 'casper'
phantomjs://bootstrap.js:289
phantomjs://bootstrap.js:254 in require
People reporting this error are trying to invoke casper by running phantomjs, but as you see I am running casperjs directly. What gives?
UPDATE
In case it provides a clue, when I call require = patchRequire(require) on the first line of my script, I get this error:
TypeError: 'undefined' is not an object (evaluating 'require.patched')
/usr/local/Cellar/casperjs/1.1-beta3/libexec/bin/bootstrap.js:197 in patchRequire