eclipse-theia / generator-theia-extension

A Yeoman generator for extensions to the Theia IDE
Other
55 stars 40 forks source link

Generation of Hello World fails with multiple errors TS1005 #199

Closed cgudrian closed 2 months ago

cgudrian commented 2 months ago

Generating a "Hello World" extension using Yeoman with yo theia-extension and then selecting "Hello World" fails with this error:

lerna ERR! Error: Command failed: npm run prepare
lerna ERR! warning package.json: No license field
lerna ERR! warning package.json: No license field
lerna ERR! error Command failed with exit code 2.
lerna ERR! npm ERR! Lifecycle script `prepare` failed with error: 
lerna ERR! npm ERR! Error: command failed 
lerna ERR! npm ERR!   in workspace: hello-world@0.0.0 
lerna ERR! npm ERR!   at location: /home/christian/devel/tests/theia/hello-world/hello-world 
lerna ERR! 
lerna ERR! 
lerna ERR! > hello-world@0.0.0 prepare
lerna ERR! > yarn run clean && yarn run build
lerna ERR! 
lerna ERR! yarn run v1.22.22
lerna ERR! $ rimraf lib
lerna ERR! Done in 0.09s.
lerna ERR! yarn run v1.22.22
lerna ERR! $ tsc
lerna ERR! ../node_modules/@types/lodash/common/object.d.ts(1026,46): error TS1005: '?' expected.
lerna ERR! ../node_modules/@types/lodash/common/object.d.ts(1031,46): error TS1005: '?' expected.
lerna ERR! ../node_modules/@types/lodash/common/object.d.ts(1041,46): error TS1005: '?' expected.
lerna ERR! ../node_modules/@types/node/stream/web.d.ts(469,56): error TS1005: '?' expected.
lerna ERR! info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! 
lerna ERR!     at /home/christian/devel/tests/theia/hello-world/node_modules/execa/index.js:236:11
node:internal/process/promises:289
            triggerUncaughtException(err, true /* fromPromise */);
            ^

I'm on Fedora 40 using Node 20.8.1.

cgudrian commented 2 months ago

Updating typescript to version ~5.6.0 in the extension workspace resolves this issue.

JonasHelming commented 2 months ago

Thank you for reporting this and for providing a solution. Two questions:

  1. Is there a particular reason for selecting 5.6.0? If not, I would go for the same version that Theia the framework uses, which would be 5.4.5 (and works for me)
  2. Are you interested in contributing this fix? Would be here If you do not want to take the overhead of opening a PR, I am very happy to do it myself, but I do not want to take your credits! :-)
cgudrian commented 2 months ago

Hi!

  1. Typescript version 5.6.0 was the version that was automatically offered in VSCode. I'm perfectly fine with 5.4.5.
  2. I'll try to prepare a PR.

Thanks!