Getting error while creating hello world plugin
See original GitHub issueWhen I create a theia plugin I got errors as shown below.
_-----_
| | ╭──────────────────────────╮
|--(o)--| │ Welcome to the 'Theia │
`---------´ │ Plug-in' generator! │
( _´U`_ ) ╰──────────────────────────╯
/___A___\ /
| ~ |
__'.___.'__
´ ` |° ´ Y `
? What is the plug-in's name? dss-demo
? What type of plug-in do you want? Backend plug-in, it will run on the server side.
? Please, choose a template: Hello World plug-in
License is not specified. You can do it via --license parameter.
create dss-demo/package.json
create dss-demo/.gitignore
create dss-demo/README.md
create dss-demo/tsconfig.json
create dss-demo/tsfmt.json
create dss-demo/src/dss-demo-backend.ts
Installing dependencies with yarn...
yarn install v1.21.1
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
[5/5] Building fresh packages...
success Saved lockfile.
$ yarn run clean && yarn run build
yarn run v1.21.1
$ rimraf lib
Done in 0.58s.
yarn run v1.21.1
$ yarn run format-code && yarn run compile && theia-plugin pack
$ tsfmt -r
$ tsc
node_modules/@theia/plugin/src/theia-proposed.d.ts(618,34): error TS1005: ';' expected.
node_modules/@theia/plugin/src/theia-proposed.d.ts(618,47): error TS1011: An element access expression should take an argument.
node_modules/@theia/plugin/src/theia-proposed.d.ts(679,1): error TS1128: Declaration or statement expected.
node_modules/@types/node/assert.d.ts(3,68): error TS1144: '{' or ';' expected.
node_modules/@types/node/assert.d.ts(51,68): error TS1144: '{' or ';' expected.
node_modules/@types/node/assert.d.ts(60,94): error TS1144: '{' or ';' expected.
node_modules/@types/node/assert.d.ts(60,101): error TS1005: ';' expected.
node_modules/@types/node/assert.d.ts(60,104): error TS1005: ';' expected.
node_modules/@types/node/assert.d.ts(62,98): error TS1144: '{' or ';' expected.
node_modules/@types/node/assert.d.ts(62,105): error TS1005: ';' expected.
node_modules/@types/node/assert.d.ts(62,108): error TS1005: ';' expected.
node_modules/@types/node/assert.d.ts(70,47): error TS1144: '{' or ';' expected.
node_modules/@types/node/assert.d.ts(70,53): error TS1005: ';' expected.
node_modules/@types/node/assert.d.ts(70,56): error TS1005: ';' expected.
node_modules/@types/node/base.d.ts(10,1): error TS1084: Invalid 'reference' directive syntax.
node_modules/@types/node/base.d.ts(11,1): error TS1084: Invalid 'reference' directive syntax.
node_modules/@types/node/base.d.ts(12,1): error TS1084: Invalid 'reference' directive syntax.
node_modules/@types/node/base.d.ts(13,1): error TS1084: Invalid 'reference' directive syntax.
node_modules/@types/node/ts3.4/base.d.ts(10,1): error TS1084: Invalid 'reference' directive syntax.
node_modules/@types/node/ts3.4/base.d.ts(11,1): error TS1084: Invalid 'reference' directive syntax.
node_modules/@types/node/ts3.4/base.d.ts(12,1): error TS1084: Invalid 'reference' directive syntax.
node_modules/@types/node/ts3.4/base.d.ts(13,1): error TS1084: Invalid 'reference' directive syntax.
node_modules/@types/node/ts3.6/base.d.ts(10,1): error TS1084: Invalid 'reference' directive syntax.
node_modules/@types/node/ts3.6/base.d.ts(11,1): error TS1084: Invalid 'reference' directive syntax.
node_modules/@types/node/ts3.6/base.d.ts(12,1): error TS1084: Invalid 'reference' directive syntax.
node_modules/@types/node/ts3.6/base.d.ts(13,1): error TS1084: Invalid 'reference' directive syntax.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
_-----_ ╭───────────────────────╮
| | │ Bye from us! │
|--(o)--| │ Chat soon. │
`---------´ │ Yeoman team │
( _´U`_ ) │ http://yeoman.io │
/___A___\ /╰───────────────────────╯
| ~ |
__'.___.'__
´ ` |° ´ Y `
Then I try to add "skipLibCheck": true
in compilerOptions
of the tsconfig.json, It did not solve the problem when compiling. eclipse/theia-generator-plugin#24
{
"compilerOptions": {
"strict": true,
"experimentalDecorators": true,
"noUnusedLocals": true,
"emitDecoratorMetadata": true,
"downlevelIteration": true,
"module": "commonjs",
"moduleResolution": "node",
"target": "es6",
"lib": [
"es6",
"webworker"
],
"sourceMap": true,
"rootDir": "src",
"outDir": "lib",
"skipLibCheck": true,
},
"include": [
"src"
]
}
✘ oliver@OliverdeMacBook-Pro ~/Documents/dss-theia/dss-demo yarn run build
yarn run v1.21.1
warning package.json: License should be a valid SPDX license expression
warning dss-demo@0.0.1: The engine "theiaPlugin" appears to be invalid.
$ yarn run format-code && yarn run compile && theia-plugin pack
warning package.json: License should be a valid SPDX license expression
warning dss-demo@0.0.1: The engine "theiaPlugin" appears to be invalid.
$ tsfmt -r
warning package.json: License should be a valid SPDX license expression
warning dss-demo@0.0.1: The engine "theiaPlugin" appears to be invalid.
$ tsc
node_modules/@theia/plugin/src/theia-proposed.d.ts:618:34 - error TS1005: ';' expected.
618 readonly items: readonly TimelineItem[];
~~~~~~~~~~~~
node_modules/@theia/plugin/src/theia-proposed.d.ts:618:47 - error TS1011: An element access expression should take an argument.
618 readonly items: readonly TimelineItem[];
node_modules/@theia/plugin/src/theia-proposed.d.ts:679:1 - error TS1128: Declaration or statement expected.
679 }
~
node_modules/@types/node/assert.d.ts:3:68 - error TS1144: '{' or ';' expected.
3 function assert(value: any, message?: string | Error): asserts value;
~~~~~
node_modules/@types/node/assert.d.ts:51:68 - error TS1144: '{' or ';' expected.
51 function ok(value: any, message?: string | Error): asserts value;
~~~~~
node_modules/@types/node/assert.d.ts:60:94 - error TS1144: '{' or ';' expected.
60 function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
~~~~~~
node_modules/@types/node/assert.d.ts:60:101 - error TS1005: ';' expected.
60 function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
~~
node_modules/@types/node/assert.d.ts:60:104 - error TS1005: ';' expected.
60 function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
~
node_modules/@types/node/assert.d.ts:62:98 - error TS1144: '{' or ';' expected.
62 function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
~~~~~~
node_modules/@types/node/assert.d.ts:62:105 - error TS1005: ';' expected.
62 function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
~~
node_modules/@types/node/assert.d.ts:62:108 - error TS1005: ';' expected.
62 function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
~
node_modules/@types/node/assert.d.ts:70:47 - error TS1144: '{' or ';' expected.
70 function ifError(value: any): asserts value is null | undefined;
~~~~~
node_modules/@types/node/assert.d.ts:70:53 - error TS1005: ';' expected.
70 function ifError(value: any): asserts value is null | undefined;
~~
node_modules/@types/node/assert.d.ts:70:56 - error TS1005: ';' expected.
70 function ifError(value: any): asserts value is null | undefined;
~~~~
node_modules/@types/node/base.d.ts:10:1 - error TS1084: Invalid 'reference' directive syntax.
10 /// <reference lib="es2018" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/node/base.d.ts:11:1 - error TS1084: Invalid 'reference' directive syntax.
11 /// <reference lib="esnext.asynciterable" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/node/base.d.ts:12:1 - error TS1084: Invalid 'reference' directive syntax.
12 /// <reference lib="esnext.intl" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/node/base.d.ts:13:1 - error TS1084: Invalid 'reference' directive syntax.
13 /// <reference lib="esnext.bigint" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/node/ts3.4/base.d.ts:10:1 - error TS1084: Invalid 'reference' directive syntax.
10 /// <reference lib="es2018" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/node/ts3.4/base.d.ts:11:1 - error TS1084: Invalid 'reference' directive syntax.
11 /// <reference lib="esnext.asynciterable" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/node/ts3.4/base.d.ts:12:1 - error TS1084: Invalid 'reference' directive syntax.
12 /// <reference lib="esnext.intl" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/node/ts3.4/base.d.ts:13:1 - error TS1084: Invalid 'reference' directive syntax.
13 /// <reference lib="esnext.bigint" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/node/ts3.6/base.d.ts:10:1 - error TS1084: Invalid 'reference' directive syntax.
10 /// <reference lib="es2018" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/node/ts3.6/base.d.ts:11:1 - error TS1084: Invalid 'reference' directive syntax.
11 /// <reference lib="esnext.asynciterable" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/node/ts3.6/base.d.ts:12:1 - error TS1084: Invalid 'reference' directive syntax.
12 /// <reference lib="esnext.intl" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/node/ts3.6/base.d.ts:13:1 - error TS1084: Invalid 'reference' directive syntax.
13 /// <reference lib="esnext.bigint" />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
trying to create hello world plugin getting error when i run ...
[ERROR] Plugin com.atlassian.plugin:atlassian-spring-scanner-maven-plugin:1.2.13 or one of its dependencies could not be resolved: Failed to read artifact ...
Read more >Unable to run custom hello world SFDX plugin locally
This is because of a minor bug from sfdx plugins:generate . In the package.json file, you most likely have "commands": ".
Read more >Eclipse - C++ hello world project's error - Stack Overflow
You have to "Build" your project before you can "Run" it. When using Eclipse for Java, you simply click the "Run" icon, then...
Read more >Get an Error When Try to Run HelloWorld Example on New ...
After uninstalling/removing Android Studio I suggest that you check to see if you have a directory named ".AndroidStudio3.0" and if you do then ......
Read more >Errors with HelloWorld and myDaemon (running the Starter ...
Following the instructions I just opened Eclipse and checked out the HelloWorld program. But I'm immediately getting this Error: Plugin ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I was facing similar issue , changing the typescript version (tsc -v) in package.json fixed the build - “typescript”: “3.5.3”
Ouput- Packaging of plugin Packaging of plugin 🔍 Validating…✔️ 🗂 Getting dependencies…✔️ 🗃 Resolving files…✔️ ✂️ Excluding files…✔️ ✍️ Generating Assembly…✔️ 🎉 Generated plugin: first_plugin.theia Done in 9.53s. Done in 16.68s.
tsc -v
was the key in my case. I had an old system version of tsc somehow. So changing version in package.json did not change anything 🤯 👍😅