question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeScript version is old ^3.4.5

See original GitHub issue

Do you want to request a feature or report a bug? Feature? But feels like a bug to me

What is the current behaviour? can’t use the latest version of typescript, which is suggested in the preact docs themselves, because preact-cli specifies an old typescript version of ^3.4.5

If the current behaviour is a bug, please provide the steps to reproduce.

  • yarn add preact-cli typescript
  • Put "jsxImportSource": "preact" as the preact docs tell you to for TypeScript support with modern typescript
  • try to compile with tsc, you get an error: Unknown compiler option 'jsxFragmentFactory'.
  • can’t follow the docs on Preact!

What is the expected behaviour?

It works and uses the newer version of typescript

If this is a feature request, what is motivation or use case for changing the behaviour?

I want to use modern features

Please mention other relevant information.

Environment Info:
  System:
    OS: macOS 11.2
    CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
  Binaries:
    Node: 14.3.0 - /var/folders/ct/hs211d3n09nb3d6nkmv7j7g80000gn/T/yarn--1612505637634-0.13322901752400163/node
    Yarn: 1.22.5 - /var/folders/ct/hs211d3n09nb3d6nkmv7j7g80000gn/T/yarn--1612505637634-0.13322901752400163/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v14.3.0/bin/npm
  Browsers:
    Chrome: 88.0.4324.146
    Firefox: 80.0.1
    Safari: 14.0.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
rschristiancommented, Feb 14, 2022

Preact itself has no dependencies. Those are all devDeps.

Some of those dependencies cannot be touched in Preact-CLI, no. We’re on Webpack 4 still, though a PR is open for 5 (see #1645)

Upgrading TS in CLI would do nothing. You should be providing your own install of TS.

0reactions
cdogcommented, Feb 14, 2022

Hey Ryan, all clear. I have listed it in my package now. Using a multi-package repository setup with Lerna, where one of the packages is a Preact app. Already had specific versions in root package, however seems not to resolve correctly. After being specific within module it started working.

Root package has: “typescript”: “~4.4.4”, Preact app module was supposed to share dependency from root, however was building with 4.2.4 instead.

Perhaps is a Lerna issue. Thanks again.

On Mon, Feb 14, 2022, 20:27 Ryan Christian @.***> wrote:

In general, you shouldn’t be using a dependency of a dependency directly. If you need to access/run/whatever it, it should be listed as a dependency in your project.

TS 4.2.4 fits our needs in the CLI just fine. If you have different needs, rather than overriding that as listed above (this is very hacky and could break things), you should have a separate install.

Edited the above, some can be touched but they’re minor version bumps, so it really doesn’t matter if they’re slightly outdated. It’s not going to cause anyone problems.

— Reply to this email directly, view it on GitHub https://github.com/preactjs/preact-cli/issues/1529#issuecomment-1039468432, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFITV2QQCJIPMAYHG6FVL3U3FJQ3ANCNFSM4XEFWSRQ . You are receiving this because you commented.Message ID: @.***>

Read more comments on GitHub >

github_iconTop Results From Across the Web

3.4.5 - typescript - npm
TypeScript is a language for application scale JavaScript development. Latest version: 4.9.4, last published: 18 days ago.
Read more >
Documentation - TypeScript 3.5
TypeScript 3.5 improves on 3.4's incremental build mode, by saving information about how the state of the world was calculated - compiler settings,...
Read more >
The Angular Compiler requires TypeScript >=3.4.0 and <3.5.0 ...
It seems like you have the latest version (v3.5.3) of TypeScript installed. You should be installing TypeScript v3.4.5 instead, which is the ...
Read more >
typescript | Yarn - Package Manager
Important: This documentation covers modern versions of Yarn. For 1.x docs, see classic.yarnpkg.com. Yarn.
Read more >
How do I Fix a TypeScript Version Mismatch when Upgrading ...
Jeffry Houser's Blog: How do I Fix a TypeScript Version Mismatch when ... tells me node to install 3.4.5, why was a later...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found