TypeError: Cannot read property 'name' error when upgrading to NestJs 5.1 - upgrade

I'm trying to upgrade my nestjs from 5.0.beta to 5.1.
At boottime I'm getting the following error. Not sure where to look for a solution. Thanks for any help.
TypeError: Cannot read property 'name' of undefined
at Module.addModuleAsComponent (myApp/node_modules/#nestjs/core/injector/module.js:72:45)
at Module.addCoreInjectables (myApp/node_modules/#nestjs/core/injector/module.js:56:14)
at new Module (myApp/node_modules/#nestjs/core/injector/module.js:24:14)
at NestContainer.addModule (myApp/node_modules/#nestjs/core/injector/container.js:35:24)
at DependenciesScanner.storeModule (myApp/node_modules/#nestjs/core/scanner.js:32:30)
at DependenciesScanner.scanForModules (myApp/node_modules/#nestjs/core/scanner.js:22:20)
at DependenciesScanner.scan (myApp/node_modules/#nestjs/core/scanner.js:17:20)
at exceptions_zone_1.ExceptionsZone.asyncRun (myApp/node_modules/#nestjs/core/nest-factory.js:75:43)
at Function.asyncRun (myApp/node_modules/#nestjs/core/errors/exceptions-zone.js:17:19)
at NestFactoryStatic.initialize (myApp/node_modules/#nestjs/core/nest-factory.js:74:52)
1: node::Abort() [/usr/local/Cellar/node/9.7.1_1/bin/node]
2: node::Chdir(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/Cellar/node/9.7.1_1/bin/node]
3: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [/usr/local/Cellar/node/9.7.1_1/bin/node]
4: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/usr/local/Cellar/node/9.7.1_1/bin/node]
5: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/usr/local/Cellar/node/9.7.1_1/bin/node]
6: 0x383450a842fd

It turned out that the problem disappeared after deleting and reinstalling node_modules

Related

Mat Dialog not displayed after upgrading to angular 13

I'm getting below 2 errors while trying to open mat dialog component. All the configuration is completely used as per the guidelines. But I'm not able to solve this error.
core.mjs:6485 ERROR Error: NG0203: inject() must be called from an injection context
at injectInjectorOnly (core.mjs:4759:1)
at ɵɵinject (core.mjs:4769:1)
at NodeInjectorFactory.InfoDialogComponent_Factory [as factory] (ɵfac.js? [sm]:1:1)
at getNodeInjectable (core.mjs:3565:1)
at instantiateRootComponent (core.mjs:10181:1)
at createRootComponent (core.mjs:12285:1)
at ComponentFactory.create (core.mjs:21638:1)
at ViewContainerRef.createComponent (core.mjs:22902:1)
at CdkPortalOutlet.attachComponentPortal (portal.mjs:535:38)
at MatDialogContainer.attachComponentPortal (dialog.mjs:174:35)
core.mjs:6485 ERROR TypeError: Cannot read properties of undefined (reading 'focusInitialElementWhenReady')
at MatDialogContainer._trapFocus (dialog.mjs:248:33)
at MatDialogContainer._onAnimationDone (dialog.mjs:338:22)
at MatDialogContainer_animation_dialogContainer_done_HostBindingHandler (dialog.mjs:371:100)
at executeListenerWithErrorHandling (core.mjs:15019:1)
at wrapListenerIn_markDirtyAndPreventDefault (core.mjs:15057:1)
at animations.mjs:189:34
at _ZoneDelegate.invoke (zone.js:372:1)
at Object.onInvoke (core.mjs:25592:1)
at _ZoneDelegate.invoke (zone.js:371:1)
at Zone.run (zone.js:134:1)

greater than symbol for find() method in php7 mongodb

I am developing a php-mongodb project. I have installed the php-mongodb driver using composer. connectivity is working fine.
used reference link for any guidance :
http://mongodb.github.io/mongo-php-library/tutorial/crud/#crud-operations
and http://php.net/manual/en/mongocollection.find.php
I could not find much reliable theory for php-7 except those.
How to fire a query with php-7 to get a result from database greater than specified number?
The code I tried is :
$rs=$collection->find(['$gte'=>['avg'=>50]]);
this is not working. The error it produced was:
Fatal error: Uncaught MongoDB\Driver\Exception\ConnectionException: unknown top level operator: $gte in /var/www/example.com/public_html/vendor/mongodb/mongodb/src/Operation/Find.php:180 Stack trace: #0 /var/www/example.com/public_html/vendor/mongodb/mongodb/src/Operation/Find.php(180): MongoDB\Driver\Server->executeQuery('training.tbl', Object(MongoDB\Driver\Query), Object(MongoDB\Driver\ReadPreference))#1 /var/www/example.com/public_html/vendor/mongodb/mongodb/src/Collection.php(437): MongoDB\Operation\Find->execute(Object(MongoDB\Driver\Server)) #2 /var/www/example.com/public_html/list.php(5): MongoDB\Collection->find(Array) #3 {main} thrown in /var/www/example.com/public_html/vendor/mongodb/mongodb/src/Operation/Find.php on line 180
found this answer from following here
// search for documents where 5 < x < 20
$rangeQuery = array('x' => array( '$gt' => 5, '$lt' => 20 ));
for above example the answer comes to be:
$rangeQuery = ['avg' => ['$gt' => '50' ]];
$rs=$collection->find($rangeQuery);

Fatal error: Class 'DOMDocument' not found and in my PHP Version 5.2.16

My Configure Command is
How can I fix this
'./configure' '--host=i686-redhat-linux-gnu' '--build=i686-redhat-linux-gnu' '--target=i386-redhat-linux' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--without-pear' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-wddx' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--without-mime-magic' '--without-sqlite' '--with-libxml-dir=/usr' '--enable-xml' '--with-system-tzdata' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--disable-dom' '--disable-dba' '--without-unixODBC' '--disable-pdo' '--disable-xmlreader' '--disable-xmlwriter' '--disable-json' '--without-pspell'
The class 'DomDocument' is apart of the DOM extension. Per the documentation:
This extension is enabled by default. It may be disabled by using the following option at compile time: --disable-dom
Remove the --disable-dom flag from your configure script and the extension should be available.

Is there a unicodedata module for IronPython?

I'm trying to get the generic sample code for the selenium2 Sauce OnDemand service working with IronPython, for some test work I'm doing, and I've run into a problem I can't quite figure out.
First, Here's the environment:
Windows 7 Home Premium, 64bit.
IronPython 2.7.0.40 on .Net 4.0.30319.225
My path:
>>> sys.path
['.', 'C:\\users\\me\\scripts\\python', 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\Extensions\\Microsoft\\IronStudio\\0.4\\Lib', 'C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\Extensions\\Microsoft\\IronStudio\\0.4\\DLLs', 'C:\\opt\\win\\ipy\\Lib', 'C:\\opt\\win\\ipy\\DLLs', 'C:\\opt\\win\\ipy']
I'm aware that IronPython has issues using compressed eggs, so I've extracted the following libraries into the \Lib directory on the sys.path:
selenium (2.0b4dev)
rdflib (3.1.0)
Now, the sample code from Sauce Labs:
import unittest
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
class Selenium2OnSauce(unittest.TestCase):
def setUp(self):
desired_capabilities = dict(platform="WINDOWS",
browserName="firefox",
version="3.6",
name="Hello, Selenium 2!")
self.driver = webdriver.Remote(
desired_capabilities=desired_capabilities,
command_executor="http://me:my-site-access-key#ondemand.saucelabs.com:80/wd/hub")
def test_sauce(self):
self.driver.get('http://example.saucelabs.com')
assert "Sauce Labs" in self.driver.title
def tearDown(self):
self.driver.quit()
if __name__ == '__main__':
unittest.main()
Here's the error I'm getting:
Traceback (most recent call last):
File "selenium2_test.py", line 3, in <module>
File "c:\opt\win\ipy\Lib\selenium\webdriver\__init__.py", line 18, in <module>
File "c:\opt\win\ipy\Lib\selenium\webdriver\firefox\webdriver.py", line 24, in <module>
File "c:\opt\win\ipy\Lib\selenium\webdriver\firefox\firefox_profile.py", line 23, in <module>
File "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\IronStudio\0.4\Lib\rdflib\__init__.py", line 65, in <module>
File "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\IronStudio\0.4\Lib\rdflib\namespace.py", line 282, in <module>
ImportError: No module named unicodedata
I've tried searching for packages with unicodedata in them (such as FePY), but none of them seem to work. I've tried copying the .pyd from my Python27 installation, but that didn't work either.
Is this something that's not yet available in IronPython 2.7? Alternatively, is there a library or namespace I can reference to accomplish the same task?
If not, I guess I'll have to go without selenium2 until the Iron guys get a unicodedata for IP27. :(
Thanks,
Greg.
Alas, the unicodedata module is currently not included in IronPython. But fear not! For the upcoming 2.7.1 release will have it, and all of your troubles shall be no more.
Sorry about that. As for when 2.7.1 will be released, I'm thinking early June. You can check https://github.com/IronLanguages/main/commit/5395af28b5794b0acf982ab87d17466925ab819f for the patch, but it's fairly large and fiddly because of the included Unicode database.
See #Micheal Greene's comments on the original question. Here is the module with the edits as directed:
# Copyright (c) 2006 by Seo Sanghyeon
# 2006-07-13 sanxiyn Created
# 2006-07-19 sanxiyn Added unidata_version, normalize
# Modified 2011 - Greg Gauthier - To provide needed functionality for rdflib
# and other utilities, in IronPython 2.7.0
unidata_version = '3.2.0'
# --------------------------------------------------------------------
# Normalization
from System import String
from System.Text import NormalizationForm
def normalize(form, string):
return String.Normalize(string, _form_mapping[form])
_form_mapping = {
'NFC': NormalizationForm.FormC,
'NFKC': NormalizationForm.FormKC,
'NFD': NormalizationForm.FormD,
'NFKD': NormalizationForm.FormKD,
}
# --------------------------------------------------------------------
# Character properties
from System.Globalization import CharUnicodeInfo
def _handle_default(function):
def wrapper(unichr, default=None):
result = function(unichr)
if result != -1:
return result
if default is None:
raise ValueError()
return default
return wrapper
decimal = _handle_default(CharUnicodeInfo.GetDecimalDigitValue)
digit = _handle_default(CharUnicodeInfo.GetDigitValue)
numeric = _handle_default(CharUnicodeInfo.GetNumericValue)
def category(unichr):
uc = CharUnicodeInfo.GetUnicodeCategory(unichr)
return _category_mapping[int(uc)]
_category_mapping = {
0: 'Lu',
1: 'Ll',
2: 'Lt',
3: 'Lm',
4: 'Lo',
5: 'Mn',
6: 'Mc',
7: 'Me',
8: 'Nd',
9: 'Nl',
10: 'No',
11: 'Zs',
12: 'Zl',
13: 'Zp',
14: 'Cc',
15: 'Cf',
16: 'Cs',
17: 'Co',
18: 'Pc',
19: 'Pd',
20: 'Ps',
21: 'Pe',
22: 'Pi',
23: 'Pf',
24: 'Po',
25: 'Sm',
26: 'Sc',
27: 'Sk',
28: 'So',
29: 'Cn',
}
# added for rdflib/ironpython
def decomposition(unichr):
return String.Normalize(unichr.ToString(), NormalizationForm.FormD)

Problem setting Zend_Form_Element ID to "id"

I find that when I try doing
$this->addElement('hidden', 'id');
And run, I get something like
Fatal error: Call to a member function getOrder() on a non-object in D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Form.php on line 3318
Call Stack:
0.0002 329712 1. {main}() D:\Projects\Tickle\public\index.php:0
0.0726 1393760 2. Zend_Application->run() D:\Projects\Tickle\public\index.php:26
0.0726 1393760 3. Zend_Application_Bootstrap_Bootstrap->run() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Application.php:366
0.0727 1393816 4. Zend_Controller_Front->dispatch() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Application\Bootstrap\Bootstrap.php:97
0.1787 2026520 5. Zend_Controller_Dispatcher_Standard->dispatch() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Controller\Front.php:954
0.1860 2144464 6. Zend_Controller_Action->dispatch() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Controller\Dispatcher\Standard.php:295
0.2089 2771352 7. Zend_Controller_Action_HelperBroker->notifyPostDispatch() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Controller\Action.php:523
0.2090 2772208 8. Zend_Controller_Action_Helper_ViewRenderer->postDispatch() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Controller\Action\HelperBroker.php:277
0.2091 2772208 9. Zend_Controller_Action_Helper_ViewRenderer->render() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Controller\Action\Helper\ViewRenderer.php:957
0.2099 2772400 10. Zend_Controller_Action_Helper_ViewRenderer->renderScript() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Controller\Action\Helper\ViewRenderer.php:918
0.2099 2772400 11. Zend_View_Abstract->render() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Controller\Action\Helper\ViewRenderer.php:897
0.2100 2813576 12. Zend_View->_run() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\View\Abstract.php:880
0.2103 2814016 13. include('D:\Projects\Tickle\application\views\scripts\projects\edit.phtml') D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\View.php:108
0.2103 2814016 14. Zend_Form->__toString() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Form.php:0
0.2103 2814016 15. Zend_Form->render() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Form.php:2916
0.2117 2825200 16. Zend_Form_Decorator_FormElements->render() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Form.php:2900
0.2120 2827128 17. Zend_Form->rewind() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Form.php:0
0.2120 2827128 18. Zend_Form->_sort() D:\ResourceLibrary\Frameworks\PHPFrameworks\Zend\Form.php:3225
When I try doing
$this->addElement('hidden', 'id2');
it works
My Zend_Form http://pastie.org/1425012 for reference
Finally direcovered =)
Change your property name $id to $_id (and also the references $this->_id). Zend form make use of the property name when you define the element. So, always use an underline or something else to diferenciate the names.
protected $_minimalMode;
protected $_id;