Skip to content

Watch mode not working on v8.3.4 / v8.3.5 #1245

Closed

Description

@jayychoi

It works until v8.3.0 but doesn't work on next releases v8.3.4 and v8.3.5.

v.8.3.0

There are two lines at the bottom and watch mode works well.

CLI Watching for changes in "."
CLI Ignoring changes in "**/{.git,node_modules}/**" | "dist"
image

v8.3.4 / v8.3.5

No messages for watch mode and watch mode doesn't work as well.

image

Activity

  1. changed the title [-]Watch mode not working on v8.3.5[/-] [+]Watch mode not working on v8.3.4 / v8.3.5[/+] on Oct 29, 2024
  2. ghiscoding commented on Nov 2, 2024

    @ghiscoding

    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

  3. SuperchupuDev commented on Nov 2, 2024

    @SuperchupuDev
    Contributor

    could be, would have to check how chokidar v3 did globbing

  4. r-rayns commented on Nov 14, 2024

    @r-rayns

    I'm having the same issue. I had version 8.3.5 installed 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:

    CLI Watching for changes in "."
    CLI Ignoring changes in "**/{.git,node_modules}/**" | "dist"
    

    The project does not reload on changes.

    However! If I stop my Express server from running:

    // stop express server from running
    // server.listen(8080, () => console.log('Server is live'))

    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.0 works whether my Express server is running or not. So that is what I've done for now.
    Hope this extra bit of information helps!

  5. methompson commented on Nov 25, 2024

    @methompson

    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.

  6. methompson commented on Nov 25, 2024

    @methompson

    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

  7. methompson commented on Nov 25, 2024

    @methompson

    PR: #1253

  8. SupertigerDev commented on Nov 30, 2024

    @SupertigerDev

    almost a month with no fix 😭 is there a better tsup alternative?

  9. methompson commented on Nov 30, 2024

    @methompson

    almost a month with no fix 😭 is there a better tsup alternative?

    Just use Esbuild. Tsup is just a wrapper around it.

  10. SupertigerDev commented on Dec 1, 2024

    @SupertigerDev

    almost a month with no fix 😭 is there a better tsup alternative?

    Just use Esbuild. Tsup is just a wrapper around it.

    Oh wow, I didn't know that. Thanks!

  11. methompson commented on Dec 13, 2024

    @methompson

    @ocavue Any chance we can get some eyes on the PR above?

  12. panoply commented on Dec 20, 2024

    @panoply
    Contributor

    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.

    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).

    I'll have a look at a PR.

  13. herberthobregon commented on Jan 21, 2025

    @herberthobregon

    Any update?

  14. methompson commented on Jan 21, 2025

    @methompson

    Any update?

    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.

  15. stychu commented on Jan 22, 2025

    @stychu

    Just discovered this in our projects too. Had to downgrade tsup. Can we get the PRs merged in already? 👀 👀 👀

  16. 2 remaining items

  17. piusidev commented on Jan 23, 2025

    @piusidev

    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.

    import { defineConfig } from 'tsup'
    
    export default defineConfig((options) => {
      return {
        entryPoints: [
          './src/**/*.{ts,tsx}',
          '!src/__tests__/**',
          '!src/**/*.test.*',
        ],
        format: 'esm',
        dts: true,
        external: ['react', 'react-dom'],
        watch: ['src/**/*.{ts,tsx}'],
        ...options,
      }
    })
  18. added
    bugSomething isn't working
    on Jan 24, 2025
  19. sxzz commented on Jan 25, 2025

    @sxzz
    Collaborator

    Please provide a reproduction repo to help us identify the issue and speed up the PR merge. Thanks.

    Why reproduction is required

  20. SupertigerDev commented on Jan 25, 2025

    @SupertigerDev

    Please provide a reproduction repo to help us identify the issue and speed up the PR merge. Thanks.

    Why reproduction is required

    Just load up any project in watch mode and make a change.

  21. methompson commented on Jan 25, 2025

    @methompson

    Please provide a reproduction repo to help us identify the issue and speed up the PR merge. Thanks.

    Why reproduction is required

    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.

  22. sxzz commented on Jan 25, 2025

    @sxzz
    Collaborator

    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.

  23. methompson commented on Jan 25, 2025

    @methompson

    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.

    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.

  24. added a commit that references this issue on Jan 25, 2025
    314a6d7
  25. sxzz commented on Jan 25, 2025

    @sxzz
    Collaborator

    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. 😔

  26. panoply commented on Jan 25, 2025

    @panoply
    Contributor

    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.

    Thanks.

  27. sxzz commented on Jan 26, 2025

    @sxzz
    Collaborator

    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.

  28. msholty-fd commented on Mar 7, 2025

    @msholty-fd

    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.

  29. ngraef commented on May 22, 2025

    @ngraef

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions