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

rescript build -w non-terminating rebuild #5303

Closed
3 of 5 tasks
ninesunsabiu opened this issue Sep 22, 2021 · 6 comments
Closed
3 of 5 tasks

rescript build -w non-terminating rebuild #5303

ninesunsabiu opened this issue Sep 22, 2021 · 6 comments
Labels
stale Old issues that went stale

Comments

@ninesunsabiu
Copy link

在使用 build 的 watch 模式时,如果 .res 文件中有 unused variable,compiler 会陷入无限循环的场景。

Reproduction Repo

https://github.com/ninesunsabiu/rescript-proj-tpl

Steps to reproduce

npm install
npm run start

如果没有直接触发的话,再一次保存 Demo.res 就可以触发。
有怀疑是 gentype 的问题,因为一加上就会报错。

Snapshot

snapshot
截图上面的操作就是在 watch 模式下,有 @genType 和 没有 @genTyp 的控制台输出区别

Environment

  • OS: macOS Catalina / Mojave
  • Editor: VS Code 1.60.1
  • Terminal: zsh
  • Node.js: v12.18.3
  • Npm: 7.23.0

Thank you for filing! Check list:

  • Is it a bug? Usage questions should often be asked in the forum instead.
  • Concise, focused, friendly issue title & description.
  • A minimal, reproducible example.
  • OS and browser versions, if relevant.
  • Is it already fixed in master?
@bobzhang
Copy link
Member

bobzhang commented Sep 22, 2021

This is due to that the build system noticed Demo.gen.ts changed (the generated file).
It should be an easy fix.

CC @cristianoc , besides gen.ts, what other files are generated by gentype

@bobzhang bobzhang changed the title rescript build -w 循环问题 rescript build -w non-terminating rebuild Sep 22, 2021
@searleser97
Copy link

searleser97 commented Sep 28, 2021

This is due to that the build system noticed Demo.gen.ts changed (the generated file).
It should be an easy fix.

CC @cristianoc , besides gen.ts, what other files are generated by gentype

@bobzhang
gentype can generate files with several extensions, not just gen.ts (e.g. .gen.tsx, .mygen.tsx,...). This can be configured in gentypeconfig.generatedFileExtension inside "bsconfig" file.

Not sure if this is what you asked though. Hopefully it is.

@cristianoc
Copy link
Collaborator

The default is .tsx and I know people use .ts but don't know of other extension. The feature to enable changing the extension is experimental.

@Zeta611
Copy link
Contributor

Zeta611 commented Jun 28, 2022

I made a PR that modifies the CLI script can fix this by checking gentypeconfig.generatedFileExtension.

@DZakh
Copy link
Member

DZakh commented Sep 22, 2023

According to the code, the issue has been fixed.

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Old issues that went stale label Oct 13, 2024
@zth zth closed this as completed Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Old issues that went stale
Projects
None yet
Development

No branches or pull requests

7 participants