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

Typegen errors on prettier step with prettier > 3.0 #48

Open
mwood23 opened this issue Dec 26, 2024 · 0 comments
Open

Typegen errors on prettier step with prettier > 3.0 #48

mwood23 opened this issue Dec 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mwood23
Copy link

mwood23 commented Dec 26, 2024

Bug description (include screenshots or a GIF screencast)

I think Prettier needs to be bumped in order to avoid an ESM bug. Should be a peer dep instead?

See this issue for more details: tailwindlabs/prettier-plugin-tailwindcss#207

🔄 Reloading...
🥚 message TS6194: Found 0 errors. Watching for file changes.
!! Prettier: Error formatting "/Users/marcuswood/moonshots/packages/extension/src/entrypoints/popup/recordingLogicType.ts"
require() of ES Module /Users/marcuswood/moonshots/node_modules/prettier-plugin-tailwindcss/dist/index.mjs not supported.
Instead change the require of /Users/marcuswood/moonshots/node_modules/prettier-plugin-tailwindcss/dist/index.mjs to a dynamic import() which is available in all CommonJS modules.
🔥 Writing: src/entrypoints/popup/recordingLogicType.ts

If you update you'll see this:

👀 Starting TypeScript watch mode
🥚 message TS6194: Found 0 errors. Watching for file changes.
prettier version: 3.4.2
/Users/marcuswood/moonshots/node_modules/yargs/yargs.js:1172
      else throw err
           ^

TypeError: prettier.resolveConfig.sync is not a function

You can only use async methods for prettier now. Looked at the code and we'd need to async all the way up the callstack since it's sync atm.

Expected behavior

No prettier errors on typegen using the latest version of prettier

Environment

  • "kea-typegen": "3.3.4",
  • "kea": "3.1.6",
  • "prettier": "3.4.2"

Additional context

@mwood23 mwood23 added the bug Something isn't working label Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant