I have a soap xml api project but I can't use soap module.
enter image description here`
error - TypeError: Cannot read properties of undefined (reading 'create')
at new HttpClient (C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\soap\lib\http.js:40:59)
at Object.open_wsdl (C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\soap\lib\wsdl\index.js:1270:48)
at openWsdl (C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\soap\lib\soap.js:70:16)
at C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\soap\lib\soap.js:48:13
at _requestWSDL (C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\soap\lib\soap.js:76:9)
at Object.createClient (C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\soap\lib\soap.js:94:5)
at handler (webpack-internal:///(api)/./src/pages/api/identity.js:16:39)
at Object.apiResolver (C:\Users\Datch\Masaüstü\sigorateklifim-github\node_modules\next\dist\server\api-utils\node.js:367:15)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
page: '/api/identity'
}
`
I have an app that dynamically loads individual smaller files into module.export at runtime, it has been working well for a couple of years.
This is the main part of the code that iterates folders, reads them, and then appends them to the desired module.exports after a bit of validation.
var path = module.path+"/lib";
require('async').eachSeries(require('fs').readdirSync(path),function(file,next){
require('fs').readFile(path+'/'+file,'utf8',function(err,code){
var id = file.split('.')[0];
if(id in module.exports) module.exports._errs.push({'lib':id,'err':'mod/'+module.name+'/lib/'+file.replace(/\.obj|\.fnc|\.str/,'.xxx')+' filename duplicated.'});
try{module.exports[id] = eval('false ||'+code);}
catch(err){
module.exports[id]={'_err':err.message};
module.exports._errs.push({'lib':id,'err':err.message})
}
next();
})
},function(){
This all works, but the issue is when there is an error generated, it appears that all of the files / objects / functions are loaded anonymously which make it impossible to determine from the stack trace errors exactly which function failed, as all appear to be anonymous.
Is it possible to either modify the code so that they are non-anonymous or alternatively modify the stack trace error reporting to show the code (& preferably variables) that actually caused the crash ??
TypeError: Cannot read property 'replace' of undefined
at eval (eval at <anonymous> (eval at <anonymous> (/snapshot/src/x3-bin/source/mod/va/index.js:1:462)), <anonymous>:1:1642)
at Query.<anonymous> (/snapshot/src/x3-bin/source/lib/mysql.js:1:2474)
at Query.<anonymous> (/snapshot/src/x3-bin/source/node_modules/mysql/lib/Connection.js:502:10)
at Query.domain [as _callback] (/snapshot/src/x3-bin/source/node_modules/mysql/lib/Connection.js:468:16)
at Query.Sequence.end (/snapshot/src/x-bin/source/node_modules/mysql/lib/protocol/sequences/Sequence.js:83:24)
at Query._handleFinalResultPacket (/snapshot/src/x3-bin/source/node_modules/mysql/lib/protocol/sequences/Query.js:139:8)
at Query.EofPacket (/snapshot/src/x3-bin/source/node_modules/mysql/lib/protocol/sequences/Query.js:123:8)
at Protocol._parsePacket (/snapshot/src/x-bin/source/node_modules/mysql/lib/protocol/Protocol.js:278:23)
at Parser.write (/snapshot/src/x3-bin/source/node_modules/mysql/lib/protocol/Parser.js:76:12)
at Protocol.write (/snapshot/src/x-bin/source/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket.<anonymous> (/snapshot/src/x3-bin/source/node_modules/mysql/lib/Connection.js:91:28)
at Socket.<anonymous> (/snapshot/src/x-bin/source/node_modules/mysql/lib/Connection.js:502:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at addChunk (_stream_readable.js:263:12)
at readableAddChunk (_stream_readable.js:250:11)
As you can see, the info to identify the source of the problem is very vague (eval at ) and impossible to identify exactly which module.exports function was the cause ?
TypeError: Cannot read property 'replace' of undefined
at eval (eval at <anonymous> (eval at <anonymous> (/snapshot/src/x3-bin/source/mod/va/index.js:1:462)), <anonymous>:1:1642)
Is it possible to either modify the code so that they are non-anonymous
Well, function(err,code){...} is an anonymous function, function NotAnonymous(err, code){...} is not. See this example Node session:
> (function() { eval("let x; x.replace;"); })()
Uncaught TypeError: Cannot read properties of undefined (reading 'replace')
at eval (eval at <anonymous> (REPL9:1:15), <anonymous>:1:10)
at REPL9:1:15
> (function NotAnonymous() { eval("let x; x.replace;"); })()
Uncaught TypeError: Cannot read properties of undefined (reading 'replace')
at eval (eval at NotAnonymous (REPL10:1:28), <anonymous>:1:10)
at NotAnonymous (REPL10:1:28)
> (function NotAnonymous() { eval("(function AlsoNicelyNamed() {let x; x.replace;})()"); })()
Uncaught TypeError: Cannot read properties of undefined (reading 'replace')
at AlsoNicelyNamed (eval at NotAnonymous (REPL11:1:28), <anonymous>:1:39)
at eval (eval at NotAnonymous (REPL11:1:28), <anonymous>:1:49)
at NotAnonymous (REPL11:1:28)
Note how the second and third versions contain the snippet eval at NotAnonymous.
The other occurrence of <anonymous> (<anonymous>:1:10 in my example, <anonymous>:1:1642 in yours) is due to the fact that strings that get evaled don't have a file name. To get change that, you'd have to stop using eval. The line/column information should be accurate though (at least, it is when I put an \n into a test string); so it looks like the file you loaded in this particular example was minified and had at least 1642 characters on its first line.
impossible to identify exactly which module.exports function was the cause ?
You already have that information: in
module.exports._errs.push({'lib':id,'err':err.message}),
id is the export that caused the problem.
Aside from that, it really depends on what's in the files you're evaling. If there are anonymous functions in there, then of course they'll show up as "anonymous", and you'd have to fix that in there by providing names for all functions.
When connecting to an OPCUA Server using an endpoint (opc.tcp://{serverIP:port}/OPCUASserver), I am getting an error that I do not know how to interpret.
I create an OPCUAClient using:
let client = OPCUAClient.create(clientOptions);
Then call connect
try {
await client.connect(connection.endpoint);
} catch (err) {
console.log('opcuaClient: connection error: ', err);
Here is the log message that gets printed to console:
opcuaClient: connection error: Error: Invalid position : buf.length=0 pos =0
at readTag (/node_js/app/node_modules/node-opcua-crypto/dist/source/asn1.js:36:15)
at Object.split_der (/node_js/app/node_modules/node-opcua-crypto/dist/source/crypto_explore_certificate.js:569:47)
at OPCUAClientImpl.getCertificate (/node_js/app/node_modules/node-opcua-common/dist/opcua_secure_object.js:37:52)
at OPCUAClientImpl.<anonymous> (/node_js/app/node_modules/node-opcua-client/dist/verify.js:106:34)
at Generator.next (<anonymous>)
at /node_js/app/node_modules/node-opcua-client/dist/verify.js:8:71
at new Promise (<anonymous>)
at __awaiter (/node_js/app/node_modules/node-opcua-client/dist/verify.js:4:12)
at OPCUAClientImpl.performCertificateSanityCheck (/node_js/app/node_modules/node-opcua-client/dist/verify.js:104:12)
at OPCUAClientImpl.<anonymous> (/node_js/app/node_modules/node-opcua-client/dist/private/client_base_impl.js:569:62)
at Generator.next (<anonymous>)
at /node_js/app/node_modules/node-opcua-client/dist/private/client_base_impl.js:8:71
at new Promise (<anonymous>)
at __awaiter (/node_js/app/node_modules/node-opcua-client/dist/private/client_base_impl.js:4:12)
at /node_js/app/node_modules/node-opcua-client/dist/private/client_base_impl.js:566:122
at Object.<anonymous> (/node_js/app/node_modules/#ster5/global-mutex/dist/source/index.js:194:26)
I am not sure what this error means.
Thanks!
"element-ui": "2.4.6"
"#vue/test-utils": "^1.0.0-beta.29"
I want to bind Element-ui to mount so at the beginning i wirite as:
import { mount, createLocalVue, shallowMount, config } from '#vue/test-utils'
import Element from 'element-ui'
const localVue = createLocalVue()
localVue.use(Element)
And my primary code:
const wrapper = mount(List, {
localVue
})
setTimeout(() => {
expect(wrapper.contains(OperationColumn)).toBe(true)
done()
})
And after running i got:
TypeError: Cannot read property '$el' of undefined
at VueComponent.mounted (F:\workspace\HaiShangEdit\node_modules\element-ui\lib\select.js:1280:54)
at invokeWithErrorHandling (F:\workspace\HaiShangEdit\node_modules\vue\dist\vue.runtime.common.dev.js:1843:57)
at callHook (F:\workspace\HaiShangEdit\node_modules\vue\dist\vue.runtime.common.dev.js:4157:7)
at Object.insert (F:\workspace\HaiShangEdit\node_modules\vue\dist\vue.runtime.common.dev.js:3108:7)
at invokeInsertHook (F:\workspace\HaiShangEdit\node_modules\vue\dist\vue.runtime.common.dev.js:6266:28)
at VueComponent.patch [as __patch__] (F:\workspace\HaiShangEdit\node_modules\vue\dist\vue.runtime.common.dev.js:6483:5)
at VueComponent.Vue._update (F:\workspace\HaiShangEdit\node_modules\vue\dist\vue.runtime.common.dev.js:3886:19)
at VueComponent.updateComponent (F:\workspace\HaiShangEdit\node_modules\vue\dist\vue.runtime.common.dev.js:4007:10)
at Watcher.get (F:\workspace\HaiShangEdit\node_modules\vue\dist\vue.runtime.common.dev.js:4405:25)
at new Watcher (F:\workspace\HaiShangEdit\node_modules\vue\dist\vue.runtime.common.dev.js:4394:12)
at mountComponent (F:\workspace\HaiShangEdit\node_modules\vue\dist\vue.runtime.common.dev.js:4014:3)
at VueComponent.Object.<anonymous>.Vue.$mount (F:\workspace\HaiShangEdit\node_modules\vue\dist\vue.runtime.common.dev.js:8327:10)
at mount (F:\workspace\HaiShangEdit\node_modules\#vue\test-utils\dist\vue-test-utils.js:8649:21)
at Object.<anonymous> (F:\workspace\HaiShangEdit\test\pictureLibrary\list.spec.js:45:22)
at Object.asyncJestTest (F:\workspace\HaiShangEdit\node_modules\jest-jasmine2\build\jasmine_async.js:108:37)
at resolve (F:\workspace\HaiShangEdit\node_modules\jest-jasmine2\build\queue_runner.js:56:12)
at new Promise (<anonymous>)
at mapper (F:\workspace\HaiShangEdit\node_modules\jest-jasmine2\build\queue_runner.js:43:19)
at promise.then (F:\workspace\HaiShangEdit\node_modules\jest-jasmine2\build\queue_runner.js:87:41)
at process._tickCallback (internal/process/next_tick.js:68:7)
console.error node_modules/#vue/test-utils/dist/vue-test-utils.js:1421
[vue-test-utils]: update has been removed from vue-test-utils. All updates are now synchronous by default
And after google i find it was a bug from Element-ui so i change my part code like:
const wrapper2 = mount(List, {
localVue,
sync: true,
stubs: {
transition: false
}
})
But it still failed with more errors:
[Vue warn]: Error in callback for watcher "options": "TypeError: Cannot read property 'querySelectorAll' of undefined"
TypeError: Cannot read property 'querySelectorAll' of undefined
at VueComponent.options (F:\workspace\HaiShangEdit\node_modules\element-ui\lib\element-ui.common.js:8577:29)
TypeError: Cannot set property 'documentHandler' of undefined
at update (F:\workspace\HaiShangEdit\node_modules\element-ui\lib\utils\clickoutside.js:64:29)
[Vue warn]: Error in created hook: "TypeError: Cannot read property '_transitionClasses' of undefined"
TypeError: Cannot read property '_transitionClasses' of undefined
at Array.updateClass (F:\workspace\HaiShangEdit\node_modules\vue\dist\vue.runtime.common.dev.js:6733:28)
I'm quite confused about vue/test-utils cause i'm a new learner,so it would be grateful if anyone can help me solve this problem.By the way, should i learn jest before i start to write vue unit test with vue/test-utils?
Hi friends I have just setup the Intern Js, when i trying to run the functional test it is giving me below mentioned error:
Listening on 0.0.0.0:9000
Transformation error; return original code
[TypeError: undefined is not a function]
Transformation error; return original code
[TypeError: undefined is not a function]
Transformation error; return original code
[TypeError: undefined is not a function]
Transformation error; return original code
[TypeError: undefined is not a function]
Transformation error; return original code
[TypeError: undefined is not a function]
Transformation error; return original code
[TypeError: undefined is not a function]
Transformation error; return original code
[TypeError: undefined is not a function]
Transformation error; return original code
[TypeError: undefined is not a function]
Transformation error; return original code
[TypeError: undefined is not a function]
Transformation error; return original code
[TypeError: undefined is not a function]
Transformation error; return original code
[TypeError: undefined is not a function]
ReferenceError: __cov_VQFOzwnac8hdvD0fpGS2FQ is not defined
at Object.<anonymous> </Users/rmiglani/Downloads/intern-tutorial-master/internjs/node_modules/intern/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-node.js:5:0>
at Module._compile <module.js:460:26>
at Object.Module._extensions.(anonymous function) [as .js] <internjs/node_modules/intern/node_modules/istanbul/lib/hook.js:107:24>
at Module.load <module.js:355:32>
at Function.Module._load <module.js:310:12>
at Module.require <module.js:365:17>
at require <module.js:384:17>
at Object.load <internjs/node_modules/intern/node_modules/dojo/node.ts:56:11>
at injectPlugin <internjs/node_modules/intern/node_modules/dojo/loader.ts:711:6>
at injectModule <internjs/node_modules/intern/node_modules/dojo/loader.ts:733:3>
Please help me to resolve this, please let me know where i have could have done the mistakes
Intern is trying to map the coverage reports from Istanbul back to the source code, but is failing to do so. It is hard to diagnose your exact problem without seeing your Intern config file, but my guess is you are missing an excludeInstrumentation option. If that option is in fact missing from your config, I recommend using the value provided in the example config.