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
For a large enough project, it may take 1-2 seconds between two file writes. The TypeScript Server, which watches for changes to .wxt/tsconfig.json, will see the first change to {} (from findEntrypoints) and rebuild the project, and since .wxt/wxt.d.ts will not be included in the project, the code editor will show errors like
Cannot find name 'defineContentScript'. ts(2304)
until the TS project is rebuilt again after writing the generated .wxt/tsconfig.json from generateTypesDir.
This is what it looks like in the code editor:
save.mp4
I have tried changing (hikiko4ern@5e9d43e) the fs.writeJson flag from w to wx so that the file is not overwritten when present, and the problem does not reproduce and the tests pass, but I'm not sure if that breaks something.
Describe the bug
When rebuilding,
findEntrypointsis called, which overwrites.wxt/tsconfig.jsonwith the{}:wxt/packages/wxt/src/core/utils/building/find-entrypoints.ts
Line 39 in 97aa173
which is later overwritten in
generateTypesDirwith the newly generated content:wxt/packages/wxt/src/core/utils/building/generate-wxt-dir.ts
Line 51 in d79d7ed
For a large enough project, it may take 1-2 seconds between two file writes. The TypeScript Server, which watches for changes to
.wxt/tsconfig.json, will see the first change to{}(fromfindEntrypoints) and rebuild the project, and since.wxt/wxt.d.tswill not be included in the project, the code editor will show errors likeuntil the TS project is rebuilt again after writing the generated
.wxt/tsconfig.jsonfromgenerateTypesDir.This is what it looks like in the code editor:
save.mp4
I have tried changing (hikiko4ern@5e9d43e) the
fs.writeJsonflag fromwtowxso that the file is not overwritten when present, and the problem does not reproduce and the tests pass, but I'm not sure if that breaks something.Reproduction
https://github.com/hikiko4ern/wxt-tsconfig-truncated
Steps to reproduce
pnpm ipnpm deventrypoints/dummy1.content.ts)System Info
Used Package Manager
pnpm
Validations