Hi I am trying to use JSDoc on a new project but it seems broken.
Step to reproduce the error.
Bootstrap a new project.
mkdir test-jsdoc
cd $_
touch index.js
npm install jsdoc
Then I edited the index.js file (using vi) :
/**
* #param {string} str
*/
function echo(str) {
console.log(str);
}
Check if JSDoc is installed
./node_modules/jsdoc/jsdoc.js -v
JSDoc 3.4.0 (Tue, 10 Nov 2015 00:28:09 GMT)
Call it over the file
./node_modules/jsdoc/jsdoc.js ./index.js
ERROR: Unable to parse a tag's type expression for source file /home/tvba5179/test-jsdoc/index.js with tag title "param" and text "{string} str": Invalid type expression "string": parse is not a function
ERROR: Unable to parse a tag's type expression for source file /home/tvba5179/test-jsdoc/index.js with tag title "param" and text "{string} str": Invalid type expression "string": parse is not a function
Any hint ?
Related
I'm trying out Tanka for k8s configs generation. Also, I'm using VS Code extension by Grafana Labs.
I've problems in VS Code with referencing Tanka configuration as described here. I'm using configuration to retrieve namespace, like so:
local k = import 'k.libsonnet';
local tk = import 'tk';
{
namespace: k.core.v1.namespace.new(tk.env.spec.namespace),
}
Initially, I was receiving an error: RUNTIME ERROR: Undefined external variable: tanka.dev/environment. I supposed that Tanka wants path to my environment, and so added it to VS Code settings:
{
"jsonnet.languageServer.extVars": {
"tanka.dev/environment": "environments/default"
}
}
Now I'm receiving another error in the k.core.v1.namespace.new(tk.env.spec.namespace) expression:
RUNTIME ERROR: Unexpected type string, expected number
<path to repo>/environments/default/main.jsonnet:7:38-49
<path to repo>/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.25/_gen/core/v1/namespace.libsonnet:51:35-39 thunk from <function <anonymous>>
<path to repo>/vendor/github.com/jsonnet-libs/k8s-libsonnet/1.25/_gen/core/v1/namespace.libsonnet:33:42-46 object <anonymous>
Field "name"
Field "metadata"
Field "namespace"
During manifestation
The error is quite confusing to me. What and where expects number?
both namespace and name are strings in my spec.json
according to the same configuration docs they should be strings
on line 33 of namespace.libsonnet there is a function withName which expects name argument of type d.T.string
tk works fine from the CLI
I suppose that I've set wrong tanka.dev/environment, but I can't find docs that say what should be set there.
Also, just to check if it helps, I tried setting "jsonnet.languageServer.tankaMode": true in VS Code settings to no avail.
Please, help me to resolve the error and if possible explain what's going on here.
I am trying to install shopware-pwa. I am following the steps in https://github.com/vuestorefront/shopware-pwa
But at the first step while initializing the project npx #shopware-pwa/cli init
While installing I used default option:
* Shopware instance address: · https://shopware6-demo.vuestorefront.io
* Shopware instance access token: · SWSCVJJET0RQAXFNBMTDZTV1OQ
* Which version you'd like to use: latest stable (recommended)
Error: Command failed: npx --ignore-existing create-nuxt-app#3.2.0 --answers "{\"name\":\"shopware-pwa-project\",\"description\":\"shopware-pwa-project description\",\"author\":\"Vue Storefront\",\"pm\":\"yarn\",\"ui\":\"none\",\"language\":\"js\",\"server\":\"none\",\"features\":[\"axios\",\"pwa\"],\"linter\":[\"prettier\",\"lintStaged\"],\"test\":\"jest\",\"mode\":\"universal\",\"target\":\"server\",\"devTools\":[],\"gitUsername\":\"\",\"ci\":\"none\"}"
npx: the --ignore-existing argument has been removed.
See `npm help exec` for more information
Trace: Error: Answers JSON could not be parsed (Unexpected token n in JSON at position 1)
at SAO.runGenerator (/home/user/.npm/_npx/059d932392171cf4/node_modules/sao/lib/index.js:126:15)
at SAO.run (/home/user/.npm/_npx/059d932392171cf4/node_modules/sao/lib/index.js:101:16)
at /home/user/.npm/_npx/059d932392171cf4/node_modules/create-nuxt-app/lib/cli.js:51:17
Does anybody come up with the issue?
I found issue #612 in the create-nuxt-app GitHub repository.
It seems that after the --answers argument you'd have to start with a sinqle quote (') and then paste your configuration as a JSON. The JSON must not contain any linefeeds/carriage returns and there must not be any whitespaces ( ) between the properties.
So in your case your bash command should look like this:
npx --ignore-existing create-nuxt-app#3.2.0 --answers '{"name":"shopware-pwa-project","description":"shopware-pwa-project description","author":"Vue Storefront","pm":"yarn","ui":"none","language":"js","server":"none","features":["axios","pwa"],"linter":["prettier","lintStaged"],"test":"jest","mode":"universal","target":"server","devTools":[],"gitUsername":"","ci":"none"}'
I've tried it on my machine just now and it worked. I only got a warning becausethe --ignore-existing argument has been removed.
hope that this solves your problem!
greetings
I'm writing a mongodb script file with the suffix .js:
// #ts-nocheck
/* eslint-disable no-undef */
// Add admin
use admin;
I get the following error though when I however over admin:
any
Parsing error: Unexpected token admineslint
';' expected.ts(1005)
Peek Problem
No quick fixes available
How does one write a mongodb script file so that eslint and typescript in vscode don't complain?
I'm following Mongoose webserver on Github (https://github.com/cesanta/mongoose) and I want to test the websocket sample code.
Here are the codes that I copied:
Unfortunately when I run the code, it returns the following errors:
websocket.obj : error LNK2001: unresolved external symbol _find_embedded_file
C:\ProjectFolder\WebsocketDemo.exe : fatal error LNK1120: 1 unresolved externals
Did I miss something?
The makefile of the examples explain what is missing
There is a rule that generate websocket_html.c that embeded the websocket.html inside a c file (it defines the missing find_embedded_file function).
websocket_html.c: websocket.html
perl mkdata.pl $< > $#
If you prefer to give access to the websocket.html file, this could be done modifying the websocket.c sample
Setting the document_root option
mg_set_option(server, "document_root", ".");
Not handle the html url in the user handler
static int send_reply(struct mg_connection *conn) {
if (conn->is_websocket) {
...
} else {
return MG_FALSE; // mongoose will open file specified by the url
}
}
I've been able to get JSDoc3 working with the default template, however, when I try to run another template (even the one that comes with it,haruki) I get the following error:
js: "/path/to/jsdoc/jsdoc.js", line 308: exception from uncaught JavaScript throw: Error: Unable to load template: Module "haruki/publish" not found.
I've tried several other templates and get the same thing. Goven my freshman status with JSDoc I'm assuming it's some config or call issue that's tripping me up.
try to set full path to template folder with publish.js file (not only template name)
for example command line parameter
-t templates/docstrap-master/template
or in config.json file
{ ...
"opts": {
...
"template": "templates/docstrap-master/template"
}
}
it works for this https://github.com/terryweiss/docstrap
for Haruki it seems to work too ./jsdoc -c conf.json -t templates/haruki but i have another error:
This template only supports output to the console. Use the option "-d
console" when you run JSDoc.
With -d console it prints result to console