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
I'm describing an issue below that is caused by dependencies. When the issues in the dependencies are resolved, this issue can be closed, as it will no longer be an issue for users of this package.
This project currently uses @prettier/sync v0.3.0 and prettier 3.0.3.
With this configuration I was getting occasional aborts with "Uncaught Error Error: Cannot find module './worker.js'" ?
Here is a simplified return stack:
at createWorker (...\node_modules\.pnpm\@[email protected][email protected]\node_modules\@prettier\sync\index.cjs:44:25)
at formatByPrettier (...\src\process\formatByPrettier.ts:4:11)
at outputToFile (...\src\process\outputToFile.ts:18:20)
So, in outputToFile, the code is used to synchronously reformat the schema and global schema files before they are written.
Here is another warning when the project starts:
esbuild ./src/main.ts --bundle --sourcemap --platform=node --outfile=./dist/main.js
▲ [WARNING] "./worker.js" should be marked as external for use with "require.resolve" [require-resolve-not-external]
While a missing file should be a critical issue, it seems an error only occurs if bad code that is sent to the prettier process, which can happen during our development.
The code in @prettier/sync was re-written. v0.5.2 is now very different and that specific error is gone.
However, there is a new issue, in that new version, and ONLY when this project is run in debug mode. The debugger will lock on a semaphore during initialization and will therefore not execute the main.js code here that does the schema generation.
Summary :
With @prettier/sync 0.3.0 specified in package.json, when not running in debug, and when generated code is good, there is no problem other than warnings.
With 0.3.0 a failure only occurs if we are generating bad code in schema.ts or in globalSchema.ts.
The issue is not in "prettier", it is in this other extension that makes prettier run synchronously.
This project should not update to v0.5.2 yet. In addition to the issues noted here, the way that this synchronized Prettier is used has changed - noted in fix: Changes required for @prettier/sync v0.5.2 #151.
The text was updated successfully, but these errors were encountered:
I'm describing an issue below that is caused by dependencies. When the issues in the dependencies are resolved, this issue can be closed, as it will no longer be an issue for users of this package.
This project currently uses @prettier/sync v0.3.0 and prettier 3.0.3.
With this configuration I was getting occasional aborts with "Uncaught Error Error: Cannot find module './worker.js'" ?
Here is a simplified return stack:
So, in outputToFile, the code is used to synchronously reformat the schema and global schema files before they are written.
Here is another warning when the project starts:
While a missing file should be a critical issue, it seems an error only occurs if bad code that is sent to the prettier process, which can happen during our development.
The code in @prettier/sync was re-written. v0.5.2 is now very different and that specific error is gone.
However, there is a new issue, in that new version, and ONLY when this project is run in debug mode. The debugger will lock on a semaphore during initialization and will therefore not execute the main.js code here that does the schema generation.
Summary :
The text was updated successfully, but these errors were encountered: