Skip to content
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

Adding an export in one file and using it from in another requires a daemon restart #20

Open
NoahAndrews opened this issue Jun 4, 2024 · 3 comments

Comments

@NoahAndrews
Copy link

NoahAndrews commented Jun 4, 2024

Environment information

My project has a main.ts entry point, as well as a util.ts file that it uses. util.ts imports nothing from main.ts. I'm using typescript 5.4.5 and tsimp 2.0.11, and the project is set up to be ESM-only.

Reproduction steps

  1. Run TSIMP_DIAG=error tsimp src/main.ts (should work correctly)
  2. Add the line export const greeting = "hi"; to util.ts
  3. Add these lines to main.ts:
 import { greeting } from "./util.js";
 console.log(greeting);
  1. Run TSIMP_DIAG=error tsimp src/main.ts again
    • Now I get an error: src/main.ts:10:10 - error TS2724: '"./util.js"' has no exported member 'greeting'.
  2. Run tsimp --restart
  3. Run TSIMP_DIAG=error tsimp src/main.ts a third time, and now it works again.
@NoahAndrews
Copy link
Author

NoahAndrews commented Jun 4, 2024

I did spend some time looking at this, and it seems like the issue might be at the Typescript server level (or how this project uses the Typescript API), but I don't have enough knowledge of either this codebase or that one to be comfortable filing a bug report there. The typescript server API is not particularly well-documented.

@NoahAndrews
Copy link
Author

NoahAndrews commented Jun 7, 2024

This issue was previously reported here, but the issue it's commented on is more specifically about tsconfig.json changes, so I'm leaving this open.

@NoahAndrews
Copy link
Author

Update: I thought I had figured out how to fix this, but it didn't actually work. See #22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant