-
-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Typescript 5.0] TypeError: value.replace is not a function #2000
Comments
Workaround $ npm exec -- tsc --showConfig > tsconfig.tsnode.json
$ npm exec -- ts-node --project tsconfig.tsnode.json --esm --swc ./reproduce.mts |
Note that if you have a |
It would be awesome if ts-node could release a fix for this! A package that I use (Cypress) uses ts-node internally, and the old @tsconfigs in the projects that I work on are incompatible with TypeScript 5 because they have some options that are no longer supported. So until ts-node is fixed and Cypress uses that new version, the projects that I work on will have to stick with TypeScript 4 and the old @tsconfigs. |
Yep, this is kind of urgent for me too 😞 |
Any news on this ? |
Workaround From #1977 (comment)
|
Can we please get a 10.9.2 with just this fix? Is there any ETA? What is the benefit of waiting? |
Agreed. It seems absurd that a primary package in the TS ecosystem hasn't released an update (that's already merged) to support the current version of the TS language. Is this project no longer being actively maintained? |
Does someone have a workaround about this issue ? And i've got the same issue when i try to get the next dev release My workarround : leave only one element on the extends ( |
@StevenDouillet did you try the workaround by @loynoir #2000 (comment) It outputs a If it helps I've used it in this repo I have 2 cli scripts that use it. "tsc:ts-node-config": "tsc --showConfig > tsconfig.tsnode.json",
"ts-node": "ts-node-esm --project tsconfig.tsnode.json", Then for any other script I do "dev": "pnpm run ts-node --require dotenv/config src/index.ts",
"codegen": "pnpm run ts-node -T bin/codegen/index.ts",
"download": "pnpm run ts-node -T bin/download/index.ts" |
Same here. It is breaking everything. |
As a definitive solution, you can migrate to @swc/register. Also, It can be easily used by jest, mocha, etc... |
In what way is this a solution? It looks like this just binds SWC to be used when importing files with |
@gspetrou the solution is to migrate to another library (like @swc/register). This is a critical issue, in a critical library (in ts ecosystem) and there is still no solution (the issue was created on April 24) There is nothing we can do to fix this issue, other than wait for the maintainers. |
In my project , change |
This worked for me as well. Thanks! |
@chenxxzhe, the reason for the thumbs down is that the whole point of this issue is that folks are hoping for support for |
@ahollenbach What's the reason why the maintainers haven't issued a new release for more than one year? |
I would consider porting to an alternative like SWC if you require TypeScript v5 support. Maintainers of open-source repositories don't owe their users answers to questions like this. |
@muratgozel does |
no |
Then it’s not a like for like replacement for ts-node. |
@gspetrou does it support composite TS projects with project references? Thanks! |
I don’t know why you’d say that. |
https://www.npmjs.com/package/tsx was the best choices for me! I had a lot of pain with ts-node, and either |
Thanks. This worked for me. They really need to fix this issue in this package, though. |
|
and cleanup test script spec Note: test:mocha-ts* are not usable per no ts-node release to address TypeStrong/ts-node#2000 where tsconfig extends multiple files.
test:mocha-ts* are not usable per several issues with ts-node (10.9.2 or earlier): - TypeStrong/ts-node#2000 no tsconfig extends multiple files support - TypeStrong/ts-node#1967 lack of .ts + ESM understanding - failure to resolve .js extensions using CommonJS
- fix explicit paths for full ESM - address lodash imports - various corrections from more strict tsc options with tests including testing LZ4PropertyTree not previously tested. ## remove mocha-ts scripts test:mocha-ts* are not usable per several issues with ts-node (10.9.2 or earlier): - TypeStrong/ts-node#2000 no tsconfig extends multiple files support - TypeStrong/ts-node#1967 lack of .ts + ESM understanding - failure to resolve .js extensions using CommonJS --------- Co-authored-by: Sonali Deshpande <48232592+sonalideshpandemsft@users.noreply.github.com> Co-authored-by: Jason Hartman <jasonha@microsoft.com>
But the whole point is to be able to extend from multiple configs. That workaround is only good for those inheriting from just one config. |
Are you saying By the way, congrats on having this issue fixed for over a year now in main without releasing it in npm 👏🏼👏🏼👏🏼 |
No, I misquoted, see edit. |
heyo, any update for the best way to handle this? using in an |
To anyone running into this issue on Expo from trying to import a TS file in // app.config.ts
import "@swc-node/register"; // <-- insert this line
import { SomeValue } from "./your-ts-module";
export default ({ config }: ConfigContext): ExpoConfig => ({
...
}); |
OMG it worked |
WHY IS THIS NOT AVAILABLE THROUGH NPM ? |
@mp3por Please don't use ts-node, it's not maintained and actually there is much better solutions right now. |
@top-kat thank you - however nodemon uses ts-node. I don't know how to configure it otherwise. All I want is to auto compile and restart my TS app on file change |
I use nodemon with bun and tsx all the time
For example. Of course can use If you're watching multiple typescript files or different types of files you have to use the |
Search Terms
Expected Behavior
No error.
Actual Behavior
Debug
errrlog
Steps to reproduce the problem
Minimal reproduction
Specifications
Additional
https://www.npmjs.com/package/@tsconfig/node18-strictest-esm
https://github.com/tsconfig/bases#what-about-combined-configs
https://devblogs.microsoft.com/typescript/announcing-typescript-5-0-rc/#supporting-multiple-configuration-files-in-extends
The text was updated successfully, but these errors were encountered: