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.
Related
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.
On the online JDL-studio, I create a JDL file without any errors. After importing it, I get an error "TypeError: cannot read property 'charCodeAt" of undefined". How to find out the cause?
Error running generator entities: TypeError: Cannot read property 'charCodeAt' of undefined
TypeError: Cannot read property 'charCodeAt' of undefined
at module.exports (/Users/me/Documents/workspace/myapp/node_modules/ret/lib/index.js:75:54)
at new RandExp (/Users/me/Documents/workspace/myapp/node_modules/randexp/lib/randexp.js:26:19)
at new RandexpWithFaker (/Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/utils/faker.js:26:5)
at Faker.faker.createRandexp (/Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/utils/faker.js:61:41)
at Object.field.createRandexp (/Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/utils/field.js:360:37)
at generateFakeDataForField (/Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/utils/field.js:101:29)
at Object.field.generateFakeData (/Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/utils/field.js:365:16)
at /Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/generators/database-changelog-liquibase/index.js:136:28
at Array.forEach (<anonymous>)
at module.exports.prepareFakeData (/Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/generators/database-changelog-liquibase/index.js:120:18)
at Object.<anonymous> (/Users/me/Documents/workspace/myapp/node_modules/yeoman-generator/lib/index.js:1024:25)
at /Users/me/Documents/workspace/myapp/node_modules/run-async/index.js:49:25
at new Promise (<anonymous>)
at /Users/me/Documents/workspace/myapp/node_modules/run-async/index.js:26:19
at runLoop.add.once.once (/Users/me/Documents/workspace/myapp/node_modules/yeoman-generator/lib/index.js:1025:11)
at Immediate.<anonymous> (/Users/me/Documents/workspace/myapp/node_modules/grouped-queue/lib/subqueue.js:48:34)
ERROR! Cannot read property 'charCodeAt' of undefined
TypeError: Cannot read property 'charCodeAt' of undefined
at module.exports (/Users/me/Documents/workspace/myapp/node_modules/ret/lib/index.js:75:54)
at new RandExp (/Users/me/Documents/workspace/myapp/node_modules/randexp/lib/randexp.js:26:19)
at new RandexpWithFaker (/Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/utils/faker.js:26:5)
at Faker.faker.createRandexp (/Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/utils/faker.js:61:41)
at Object.field.createRandexp (/Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/utils/field.js:360:37)
at generateFakeDataForField (/Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/utils/field.js:101:29)
at Object.field.generateFakeData (/Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/utils/field.js:365:16)
at /Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/generators/database-changelog-liquibase/index.js:136:28
at Array.forEach (<anonymous>)
at module.exports.prepareFakeData (/Users/me/Documents/workspace/myapp/node_modules/generator-jhipster/generators/database-changelog-liquibase/index.js:120:18)
at Object.<anonymous> (/Users/me/Documents/workspace/myapp/node_modules/yeoman-generator/lib/index.js:1024:25)
at /Users/me/Documents/workspace/myapp/node_modules/run-async/index.js:49:25
at new Promise (<anonymous>)
at /Users/me/Documents/workspace/myapp/node_modules/run-async/index.js:26:19
at runLoop.add.once.once (/Users/me/Documents/workspace/myapp/node_modules/yeoman-generator/lib/index.js:1025:11)
at Immediate.<anonymous> (/Users/me/Documents/workspace/myapp/node_modules/grouped-queue/lib/subqueue.js:48:34)
I find that its cause is the following email pattern:
email String required minlength(6) maxlength(255) pattern(/^\w+([-+.']\w+)*#\w+([-.]\w+)*\.\w+([-.]\w+)*$/) unique,
Now, a question would be what is the acceptable email pattern for JHipster.
"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?
/Users/mac/page/node_modules/mongodb/lib/mongodb/connection/base.js:246
throw message;
^
TypeError: undefined is not a function
It's right there... Where it says TypeError: undefined is not a function.
That's the error.
I installed easysoap but get this reference error
/Users/frank/Documents/NodeJs/node_modules/easysoap/node_modules/promise/index.js:82
throw err
^ ReferenceError: error is not defined
at /Users/frank/Documents/NodeJs/node_modules/easysoap/lib/easysoap.js:90:60
at Object._onImmediate (/Users/frank/Documents/NodeJs/node_modules/easysoap/node_modules/promise/core.js:34:15)
at processImmediate [as _immediateCallback] (timers.js:330:15)
Is this caused by a mistake i did make, or is anyone else also getting this error?
Is there any documantation on the web?
Looks like a bug on easysoap's side to me. From the source code:
request.get(params, this.opts)
.done(function(data) {
// ...
}, function(err) {
that.emit('error', 'fail to get wsdl', error);
});
The error variable indeed doesn't exist, and should have been err. You should report this bug to easysoap's maintainer.