You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it might be, due to recent upgrade of Chokidar to v4 in PR #1211. Perhaps the new glob (from tinyglobby) should add the { dot: true } option? cc @SuperchupuDev
I'm encountering the same issue, but it seems the onSuccess CLI option is what's causing the problem.
When I run npx tsup ./src/main.ts --watch from the terminal, I get the line CLI Watching for changes in "." and a compile event occurs on every save. Whereas, if I run npx tsup ./src/main.ts --watch --onsuccess="node dist/main.js", it doesn't have the watching changes line and does nothing further on save.
Reacted by Amjath Husain, Dolly Singh, sei and Majimay
I've reviewed the source and I think I've found the cause. I added a bunch of log statements to the JS files in the node_modules dist folder and I found that there's a point where the code no longer progresses.
Which, ultimately was updated with this PR which lines up with the timeframe for the last 2 versions not working correctly: 4dd5bfe
If I comment this line out in my dist folder (which, unfortunately, is elsewhere, because it's been transpiled), watch runs as normal.
I will provide a PR soon as a band-aid solution. Even if it's NOT the solution, it would behoove us to figure out what that goal is for the await statement, considering it breaks the functionality as listed in the documentation
Just use Esbuild. Tsup is just a wrapper around it.
Not really. tsup does post-processing similarly to vite, wherein treeshaking is performed by rollup and swc exists at some-point. There are also various features that help alleviate pain-points when writing modern tooling, esp node tooling. (see #806 for more on that).
My workaround for this is to manually specify the folder that TSUP should watch in the defineConfig function during development, instead of using the --watch flag in the CLI.
BTW, this is a free open-source software, and we're maintaining the project without any reward. Please be considerate and provide as much information as possible to help us fix issues quickly. Assuming we owe you this service doesn't help and discourages those who are willing to support the project.
Reacted by Sigurd Fosseng, Titouan Launay and Loni Kuang
BTW, this is a free open-source software, and we're maintaining the project without any reward. Please be considerate and provide as much information as possible to help us fix issues quickly. Assuming we owe you this service doesn't help and discourages those who are willing to support the project.
To be fair, I identified the cause of the issue and provided a PR to fix this issue exactly 2 months ago. No one from the project saw fit to respond until today. Thats definitely not quick.
Moreover, that's work I did, to support this project without reward, acknowledgement or even gratitude. In my opinion, it's tone deaf to complain about people's attitudes when those actually doing work to solve the issue (I.e. me) are reprimanded instead of thanked.
Reacted by Kirill Neruchev, Herberth, Supertiger, ΝΙΚΟΛΑΣ, heyitzkamal, Majimay and 阿梦freedom
To clarify, I am one of the project maintainers. I occasionally check for obvious bugs that need fixing. Providing a minimal reproduction is the quickest way for us to identify issues. This is why PRs on this issue haven't been easily merged for a long time. Continuously pinging maintainers or asking "any news" doesn't help.
We are grateful to all authors, maintainers, contributors, and everyone who provides valuable information for this project. Open source projects rely on community effort; maintaining a positive attitude and avoiding blame benefits everyone.
If asking for reproductions of common issues is unwelcome, I might leave the problems for others to solve. 😔
The efforts of maintainers are appreciated, but this issue has been evident for months. I'm not alone in choosing projects developed or maintained by egoist + collaborators, primarily to support brilliant developers and their innovative tools, while also chipping in where one can.
This choice fosters innovation and helps relatively small, code-efficient projects like tsup to become self-sustaining. The community has been quick to address features and the majority of issues are from contributions, so the project itself is largely one of community-driven support.
BTW, this is a free open-source software, and we're maintaining the project without any reward. Please be considerate and provide as much information as possible to help us fix issues quickly. Assuming we owe you this service doesn't help and discourages those who are willing to support the project.
I've followed this issue, and the discourse has generally been proactive. The discouragement, I would argue, stems more from dormant PRs that address pressing issues rather than from the community's engagement.
We are grateful to all authors, maintainers, contributors, and everyone who provides valuable information for this project. Open source projects rely on community effort; maintaining a positive attitude and avoiding blame benefits everyone.
This project isn't your typical OSS offering; I'd argue that many choose to use tsup out of appreciation rather than necessity, given the results can be achieved with similar tooling in the nexus. Those with high expectations are in the minority here, AFAICT. Unnecessary comments/mentions can be avoided with just a bit of communication.
The last thing I think anyone here wants to do is stress out maintainers, we truly appreciate the time and efforts. I'll shoot a donation over this week and maybe some others here can spare a coffee for collaborators. We care about the project but also those behind it.
Thank you for sharing your thoughts. I appreciate your patience and engagement, and I’d like to clarify a few points to avoid any misunderstanding.
First, my earlier comments about maintaining a positive attitude were directed at those who react negatively (e.g., by downvoting) when I request a reproduction. This kind of reaction doesn't contribute to solving the issue and, in fact, can escalate frustrations without offering useful information.
I understand how frustrating it can be when a PR isn’t merged for an extended period—I’ve experienced it myself. Unfortunately, this is sometimes unavoidable in open-source projects. No one can guarantee when or if a PR will be processed, even my own. If the project seems inactive and you believe you have the capacity to take it further, GitHub’s open nature allows you to fork the project or reach out to the maintainers about contributing more directly.
That said, providing a minimal reproduction is one of the best ways to ensure issues are resolved more efficiently. My intent was to emphasize the importance of actionable input to move things forward, not to undervalue the contributions of anyone involved.
Lastly, I want to reaffirm that I deeply value all contributors’ efforts. My earlier message was meant as a reminder to those who may continuously demand more while expressing dissatisfaction. I believe maintaining kindness and constructive communication benefits everyone and keeps this community thriving.
Thank you again for your understanding, support, and thoughtful feedback—it’s contributors like you who help this project grow and succeed.
Reacted by Ivan Tanev, seth, Madeline Gurriarán, Majimay and Ghislain B.
I am getting an error from picomatch, which is called from tinyglobby, which is called from chokidar while tsup is in watch mode.
@xxxx/core:dev: /Users/michaelsholty/dev/project/node_modules/.pnpm/picomatch@4.0.2/node_modules/picomatch/lib/utils.js:45
@xxxx/core:dev: if (output.startsWith('./')) {
@xxxx/core:dev: TypeError: output.startsWith is not a function
Sorry I can't share the project - it's private. So, I don't have steps to reproduce. It looks like just a version mismatch problem. I was able to resolve it by downgrading to version 8.3.0. I just wanted to share that here in case anyone else runs into this problem.
Thank you tsup library maintainers for all the work you do to maintain this project and other open source projects. For every 1 whiner in here, there are 1000 people like me appreciating the work you do.
Reacted by Titouan Launay and René Bannat-Mucheyer
@msholty-fd For me, that issue is caused by micromatch/picomatch#144. One of my dependencies has a directory called "constructor", which breaks picomatch parsing.
Activity
[-]Watch mode not working on v8.3.5[/-][+]Watch mode not working on v8.3.4 / v8.3.5[/+]ghiscoding commentedon Nov 2, 2024
it might be, due to recent upgrade of Chokidar to v4 in PR #1211. Perhaps the new
glob(from tinyglobby) should add the{ dot: true }option? cc @SuperchupuDevSuperchupuDev commentedon Nov 2, 2024
could be, would have to check how chokidar v3 did globbing
r-rayns commentedon Nov 14, 2024
I'm having the same issue. I had version
8.3.5installed in a project which was running Express.When I run the project I do not see the typical watch mode message, which looks something like:
The project does not reload on changes.
However! If I stop my Express server from running:
Removing this line of code and restarting my app, I see the expected watch mode message and my project does reload on changes.
Downgrading to
8.3.0works whether my Express server is running or not. So that is what I've done for now.Hope this extra bit of information helps!
methompson commentedon Nov 25, 2024
I'm encountering the same issue, but it seems the
onSuccessCLI option is what's causing the problem.When I run
npx tsup ./src/main.ts --watchfrom the terminal, I get the lineCLI Watching for changes in "."and a compile event occurs on every save. Whereas, if I runnpx tsup ./src/main.ts --watch --onsuccess="node dist/main.js", it doesn't have the watching changes line and does nothing further on save.methompson commentedon Nov 25, 2024
I've reviewed the source and I think I've found the cause. I added a bunch of log statements to the JS files in the node_modules dist folder and I found that there's a point where the code no longer progresses.
I'm pretty sure it's related to this line: https://github.com/egoist/tsup/blame/cd03e1e00ec2bd6676ae1837cbc7e618ab6a2362/src/index.ts#L357
Which, ultimately was updated with this PR which lines up with the timeframe for the last 2 versions not working correctly: 4dd5bfe
If I comment this line out in my dist folder (which, unfortunately, is elsewhere, because it's been transpiled), watch runs as normal.
I will provide a PR soon as a band-aid solution. Even if it's NOT the solution, it would behoove us to figure out what that goal is for the await statement, considering it breaks the functionality as listed in the documentation
methompson commentedon Nov 25, 2024
PR: #1253
SupertigerDev commentedon Nov 30, 2024
almost a month with no fix 😭 is there a better tsup alternative?
methompson commentedon Nov 30, 2024
Just use Esbuild. Tsup is just a wrapper around it.
SupertigerDev commentedon Dec 1, 2024
Oh wow, I didn't know that. Thanks!
methompson commentedon Dec 13, 2024
@ocavue Any chance we can get some eyes on the PR above?
panoply commentedon Dec 20, 2024
Yeah, this issue is major headache. Personally, I'd like to see chokidar swapped out for https://github.com/parcel-bundler/watcher. Chokidar v4 has been a hassle.
Not really. tsup does post-processing similarly to vite, wherein treeshaking is performed by rollup and swc exists at some-point. There are also various features that help alleviate pain-points when writing modern tooling, esp node tooling. (see #806 for more on that).
I'll have a look at a PR.
herberthobregon commentedon Jan 21, 2025
Any update?
methompson commentedon Jan 21, 2025
No one on the project has written to me.
@egoist @ocavue @sxzz Any chance we get some eyes on this issue? I have a PR that resolves the issue.
stychu commentedon Jan 22, 2025
Just discovered this in our projects too. Had to downgrade tsup. Can we get the PRs merged in already? 👀 👀 👀
2 remaining items
piusidev commentedon Jan 23, 2025
My workaround for this is to manually specify the folder that TSUP should watch in the
defineConfigfunction during development, instead of using the --watch flag in the CLI.sxzz commentedon Jan 25, 2025
Please provide a reproduction repo to help us identify the issue and speed up the PR merge. Thanks.
Why reproduction is required
SupertigerDev commentedon Jan 25, 2025
Just load up any project in watch mode and make a change.
methompson commentedon Jan 25, 2025
https://github.com/methompson/tsup_issue_repro
Run
npm run dev, make a save in main.js and observe that the project does not recompile / restart on change.sxzz commentedon Jan 25, 2025
Fixed, and it will be released soon.
BTW, this is a free open-source software, and we're maintaining the project without any reward. Please be considerate and provide as much information as possible to help us fix issues quickly. Assuming we owe you this service doesn't help and discourages those who are willing to support the project.
methompson commentedon Jan 25, 2025
To be fair, I identified the cause of the issue and provided a PR to fix this issue exactly 2 months ago. No one from the project saw fit to respond until today. Thats definitely not quick.
Moreover, that's work I did, to support this project without reward, acknowledgement or even gratitude. In my opinion, it's tone deaf to complain about people's attitudes when those actually doing work to solve the issue (I.e. me) are reprimanded instead of thanked.
fix: don't await sub-process of `onSuccess` (egoist#1256)
sxzz commentedon Jan 25, 2025
To clarify, I am one of the project maintainers. I occasionally check for obvious bugs that need fixing. Providing a minimal reproduction is the quickest way for us to identify issues. This is why PRs on this issue haven't been easily merged for a long time. Continuously pinging maintainers or asking "any news" doesn't help.
We are grateful to all authors, maintainers, contributors, and everyone who provides valuable information for this project. Open source projects rely on community effort; maintaining a positive attitude and avoiding blame benefits everyone.
If asking for reproductions of common issues is unwelcome, I might leave the problems for others to solve. 😔
panoply commentedon Jan 25, 2025
The efforts of maintainers are appreciated, but this issue has been evident for months. I'm not alone in choosing projects developed or maintained by egoist + collaborators, primarily to support brilliant developers and their innovative tools, while also chipping in where one can.
This choice fosters innovation and helps relatively small, code-efficient projects like tsup to become self-sustaining. The community has been quick to address features and the majority of issues are from contributions, so the project itself is largely one of community-driven support.
I've followed this issue, and the discourse has generally been proactive. The discouragement, I would argue, stems more from dormant PRs that address pressing issues rather than from the community's engagement.
This project isn't your typical OSS offering; I'd argue that many choose to use tsup out of appreciation rather than necessity, given the results can be achieved with similar tooling in the nexus. Those with high expectations are in the minority here, AFAICT. Unnecessary comments/mentions can be avoided with just a bit of communication.
The last thing I think anyone here wants to do is stress out maintainers, we truly appreciate the time and efforts. I'll shoot a donation over this week and maybe some others here can spare a coffee for collaborators. We care about the project but also those behind it.
Thanks.
sxzz commentedon Jan 26, 2025
Thank you for sharing your thoughts. I appreciate your patience and engagement, and I’d like to clarify a few points to avoid any misunderstanding.
First, my earlier comments about maintaining a positive attitude were directed at those who react negatively (e.g., by downvoting) when I request a reproduction. This kind of reaction doesn't contribute to solving the issue and, in fact, can escalate frustrations without offering useful information.
I understand how frustrating it can be when a PR isn’t merged for an extended period—I’ve experienced it myself. Unfortunately, this is sometimes unavoidable in open-source projects. No one can guarantee when or if a PR will be processed, even my own. If the project seems inactive and you believe you have the capacity to take it further, GitHub’s open nature allows you to fork the project or reach out to the maintainers about contributing more directly.
That said, providing a minimal reproduction is one of the best ways to ensure issues are resolved more efficiently. My intent was to emphasize the importance of actionable input to move things forward, not to undervalue the contributions of anyone involved.
Lastly, I want to reaffirm that I deeply value all contributors’ efforts. My earlier message was meant as a reminder to those who may continuously demand more while expressing dissatisfaction. I believe maintaining kindness and constructive communication benefits everyone and keeps this community thriving.
Thank you again for your understanding, support, and thoughtful feedback—it’s contributors like you who help this project grow and succeed.
msholty-fd commentedon Mar 7, 2025
I am getting an error from
picomatch, which is called fromtinyglobby, which is called fromchokidarwhiletsupis in watch mode.Sorry I can't share the project - it's private. So, I don't have steps to reproduce. It looks like just a version mismatch problem. I was able to resolve it by downgrading to version 8.3.0. I just wanted to share that here in case anyone else runs into this problem.
Thank you
tsuplibrary maintainers for all the work you do to maintain this project and other open source projects. For every 1 whiner in here, there are 1000 people like me appreciating the work you do.ngraef commentedon May 22, 2025
@msholty-fd For me, that issue is caused by micromatch/picomatch#144. One of my dependencies has a directory called "constructor", which breaks picomatch parsing.