Code Monkey home page Code Monkey logo

Comments (16)

nightpool avatar nightpool commented on June 28, 2024

Using -t node_modules/tsd-jsdoc/lib instead leads to this error:

Generating output files...
node_modules/dts-dom/bin/index.js:385
            switch (e.kind) {
                     ^

TypeError: Cannot read property 'kind' of null
    at writeReference (node_modules/dts-dom/bin/index.js:385:22)
    at writeParameter (node_modules/dts-dom/bin/index.js:485:9)
    at writeDelimited (node_modules/dts-dom/bin/index.js:494:13)
    at writeFunction (node_modules/dts-dom/bin/index.js:473:9)
    at writeDeclaration (node_modules/dts-dom/bin/index.js:650:28)
    at Object.emit (node_modules/dts-dom/bin/index.js:229:5)
    at Emitter.emit (node_modules/tsd-jsdoc/lib/Emitter.js:65:24)
    at Object.publish (node_modules/tsd-jsdoc/lib/publish.js:25:39)
    at Object.module.exports.cli.generateDocs (node_modules/jsdoc/cli.js:430:39)
    at Object.module.exports.cli.processParseResults (node_modules/jsdoc/cli.js:383:20)
    at module.exports.cli.main (node_modules/jsdoc/cli.js:227:14)
    at Object.module.exports.cli.runCommand (node_modules/jsdoc/cli.js:180:5)
    at node_modules/jsdoc/jsdoc.js:103:9
    at Object.<anonymous> (node_modules/jsdoc/jsdoc.js:104:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)

from tsd-jsdoc.

nightpool avatar nightpool commented on June 28, 2024

i should note that I'm using the latest 2.0.0-beta.1 from npm

from tsd-jsdoc.

englercj avatar englercj commented on June 28, 2024

Hmm, looks like jsdoc expects the publish.js file to be in the root folder of the template directory. I assumed it used the main property of the package.json but I guess not. Can you try doing -t tsd-jsdoc instead of specifying -t node_modules/...?

As for the e.kind is null error, can you give me a js block that reproduces it?

from tsd-jsdoc.

nightpool avatar nightpool commented on June 28, 2024

For the first, I get a very similar error: FATAL: Unable to load template: Cannot find module 'tsd-jsdoc/publish

For the second, here's a minimal reproduction:

/**
 * Duplicates the passed string
 * @param  {string} foo - the string to duplicate
 * @return {string} the duplicated string
 */
function dupeStr(foo) {
    return foo + foo;
}

from tsd-jsdoc.

nightpool avatar nightpool commented on June 28, 2024

also I can't get the tests to work at all.....

from tsd-jsdoc.

englercj avatar englercj commented on June 28, 2024

Thanks for trying that, I'll move the publish script around.

There aren't any "tests" yet, all npm test does is run on the js files in there and output a file that I can look at manually. No automated testing yet. When you say "I can't get the tests to work all all" can you tell me what that means? Are you running on a cloned repo or the installed package? The installed package doesn't include the tests or anything.

I am able to reproduce the error you are getting though when used with the example you provided and no other code. Looking into that now.

from tsd-jsdoc.

nightpool avatar nightpool commented on June 28, 2024

I mean that if I clone the repo, do npm install, npm build, and npm test, I get an error.

lib/Emitter.js:349
                    dom.create.indexSignature('key', indexTypeStr, this._resolveTypeString(valueTypeStr, doclet, obj))
                               ^

TypeError: dom.create.indexSignature is not a function
    at Emitter._resolveTypeString (lib/Emitter.js:349:32)
    at Emitter._resolveType (lib/Emitter.js:318:29)
    at Emitter._resolveObjects (lib/Emitter.js:184:33)
    at Emitter.parse (lib/Emitter.js:57:14)
    at new Emitter (lib/Emitter.js:49:14)
    at Object.publish (lib/publish.js:10:21)
    at Object.module.exports.cli.generateDocs (node_modules/jsdoc/cli.js:430:39)
    at Object.module.exports.cli.processParseResults (node_modules/jsdoc/cli.js:383:20)
    at module.exports.cli.main (node_modules/jsdoc/cli.js:227:14)
    at Object.module.exports.cli.runCommand (node_modules/jsdoc/cli.js:180:5)
    at node_modules/jsdoc/jsdoc.js:103:9
    at Object.<anonymous> (node_modules/jsdoc/jsdoc.js:104:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)

from tsd-jsdoc.

nightpool avatar nightpool commented on June 28, 2024

Also, to be clear, I reduced down the minimal test case I provided earlier from ~1,000 lines of module code. The problem is clearly not that it's standalone.

from tsd-jsdoc.

englercj avatar englercj commented on June 28, 2024

The problem is clearly not that it's standalone.

When I ran it with all my other code it worked, I only got the error when I ran it on only this code piece. Turns out it was due to a logic error in how I handle the "private" config which is probably different in your config than in the repo's.

I get an error.

Can you share what the error is?


This should be fixed now in v2.0.0-beta.2.

from tsd-jsdoc.

nightpool avatar nightpool commented on June 28, 2024

@englercj the error is in the comment

from tsd-jsdoc.

englercj avatar englercj commented on June 28, 2024

So the original error you got running on your code, was also the same error you got when running the tests?

Sorry, see that you edited the post.

from tsd-jsdoc.

nightpool avatar nightpool commented on June 28, 2024

No, that's a different error.

from tsd-jsdoc.

nightpool avatar nightpool commented on June 28, 2024

image

from tsd-jsdoc.

englercj avatar englercj commented on June 28, 2024

Looks like dts-dom hasn't released my additions that add support for indexSignature. I'm locally using HEAD and not the tagged release, which is why it works for me.

Hopefully they release it soon. RyanCavanaugh/dts-dom#16

from tsd-jsdoc.

englercj avatar englercj commented on June 28, 2024

Ok, released, as long as you have 0.0.15 installed it should be good to go. Let me know if you have any more issues, open as many as you want. I appreciate you trying out the beta.

from tsd-jsdoc.

Nols1000 avatar Nols1000 commented on June 28, 2024

@englercj This error occures in version 2.0.0-beta.5 again.

from tsd-jsdoc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.