Try .mjs for Prettier, because web also tries to use prettier to format#4105
Open
FranjoMindek wants to merge 3 commits intomainfrom
Open
Try .mjs for Prettier, because web also tries to use prettier to format#4105FranjoMindek wants to merge 3 commits intomainfrom
.mjs for Prettier, because web also tries to use prettier to format#4105FranjoMindek wants to merge 3 commits intomainfrom
Conversation
Member
|
Do a change in |
@wasp.sh/wasp-cli
@wasp.sh/wasp-cli-darwin-arm64-unknown
@wasp.sh/wasp-cli-darwin-x64-unknown
@wasp.sh/wasp-cli-linux-x64-glibc
@wasp.sh/wasp-cli-linux-x64-musl
commit: |
Deploying wasp-docs-on-main with
|
| Latest commit: |
991a956
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://4ad93841.wasp-docs-on-main.pages.dev |
| Branch Preview URL: | https://franjo-prettier-fix-fix.wasp-docs-on-main.pages.dev |
FranjoMindek
commented
May 4, 2026
| @@ -1,8 +1,9 @@ | |||
| { | |||
| "name": "wasp-repo", | |||
| "type": "module", | |||
Contributor
Author
There was a problem hiding this comment.
Should've added this with prettier.config.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
After we change
.prettierrctoprettier.config.ts, Miho noticed that themaindidn't manage to deployweb/to cloudflare properly.So I went to investigate.
Problems:
Our
web/deployment was pinned toNODE_VERSION=20on Cloudflare via environment variables. This caused us to error when trying to import config fromprettier.config.tssince that version of node can't work with TypeScript natively.NODE_VERSIONproblematic since it diverges from.nvmrcversion defined in the repo. Also as this version only exists in Cloudflare, so it's hard to track and remember..nvmrcifNODE_VERSIONis not set. So if we just delete theNODE_VERSIONenv var, theweb/node version should follow the repo version. Which I did.The
prettier.config.tsfile imports theConfigtype from theprettierpackage, which means that if we don'tnpm iin the project root, loadingprettier.config.tswill fail, sinceprettierpackage it tries to import type from does not exist. This means it becomes necessary tonpm ito load the config..prettierrc, so I converted TypeScript to JavaScript, which should work without any packages installed. I did the same for ourBasicstarter template.Type of change
Checklist
I tested my change in a Wasp app to verify that it works as intended.
🧪 Tests and apps:
examples/kitchen-sink/e2e-tests.waspc/data/Cli/templates, as needed.examples/, as needed.examples/tutorials) I updated the tutorial in the docs (and vice versa).📜 Documentation:
web/docs/.🆕 Changelog: (if change is more than just code/docs improvement)
waspc/ChangeLog.mdwith a user-friendly description of the change.web/docs/migration-guides/.versioninwaspc/waspc.cabalto reflect the changes I introduced.