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
{{ message }}
Repository navigation
Error: No "exports" main defined in /.../package.json #41
Ah interesting. When you set cjs: false zshy won't set any "require" condition. So in a CJS context (e.g. if your package/app doesn't contain "type":"module") the package won't be loadable. You could argue this is desirable since you've explicitly disabled CJS here. Assuming that you've forgotten "type":"module" in your package.json, this is possibly revealing a useful "bug" in your codebase. I'll think about this a little more. Setting "default" is probably a good idea.
FYI condition order matters in package.json/#exports so you should always put "default" last to avoid weird issues. 👍
The root of the playwright issue is that it's trying to resolve to a CommonJS version of your package. It's a little weird that default works here, and it's a quirk of Playwright's module resolution I guess. I'm hesistant to blindly throw in "default" conditions. In a true CommonJS environment it would cause issues if a require resolved to an ESM file. It's weird that it doesn't cause issues in Playwright here. But if you want to avoid stuff like this you probably just shouldn't disable CJS.
Activity
colinhacks commentedon Sep 19, 2025
Ah interesting. When you set
cjs: falsezshy won't set any"require"condition. So in a CJS context (e.g. if your package/app doesn't contain"type":"module") the package won't be loadable. You could argue this is desirable since you've explicitly disabled CJS here. Assuming that you've forgotten"type":"module"in your package.json, this is possibly revealing a useful "bug" in your codebase. I'll think about this a little more. Setting"default"is probably a good idea.FYI condition order matters in package.json/#exports so you should always put
"default"last to avoid weird issues. 👍colinhacks commentedon Oct 5, 2025
The root of the playwright issue is that it's trying to resolve to a CommonJS version of your package. It's a little weird that default works here, and it's a quirk of Playwright's module resolution I guess. I'm hesistant to blindly throw in
"default"conditions. In a true CommonJS environment it would cause issues if arequireresolved to an ESM file. It's weird that it doesn't cause issues in Playwright here. But if you want to avoid stuff like this you probably just shouldn't disable CJS.