-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
CJS export is missing __esModule - Code transpiled to CJS can't use default export #12
Comments
Oh wait... default export actually isn't listed in the README. I have used it in code blocks when responding to people though and believe I went back-and-forth on whether to use default in the README or not. Guess it's a good thing I didn't given there are more issues with it than I knew of. Still breaks backward compatibility and is an unexpected bug in |
Sent a PR out to Tried a simpler/quicker fix back in July, but that failed upon testing. Decided to try a different fix after some renewed frustrations as a result of that bug and that PR does indeed work now! |
Would like to release the fix to this in v0.1.x so that it's fixed in the same minor it was broken and is fixed in all future minors. That would mean before #16 lands as it'll be a minor release. If jaredpalmer/tsdx#327 isn't merged and released soon, I've created a branch on my fork at agilgur5/tsdx#dist that has the change and is installable via |
- this uses my fork which merged my PR/commit that fixes the missing __esModule in CJS build output - which has been an issue in this library since adopting tsdx, as that's still an undocumented bug in tsdx - the bug means that default imports get transpiled to x = require instead of { default: x } = require - which affects anyone using CJS and importing the default export - and most apps still transpile down, as do most test runners, so basically it affects almost everyone using the default - for more details, see #12 - until this fix is merged and released in the root library, will be using this fork - it also has my recently merged PR/commit that changes the cacheRoot to ./node_modules/.cache/ instead of ./rts2_cache_* directories - can remove them from gitignore and they no longer clutter app root
- this uses my fork which merged my PR/commit that fixes the missing __esModule in CJS build output - which has been an issue in this library since adopting tsdx, as that's still an undocumented bug in tsdx - the bug means that default imports get transpiled to x = require instead of { default: x } = require - which affects anyone using CJS and importing the default export - and most apps still transpile down, as do most test runners, so basically it affects almost everyone using the default - for more details, see #12 - until this fix is merged and released in the root library, will be using this fork - it also has my recently merged PR/commit that changes the cacheRoot to ./node_modules/.cache/ instead of ./rts2_cache_* directories - can remove them from gitignore and they no longer clutter app root
See #3 (comment) onward.
This is a bug in
tsdx
(jaredpalmer/tsdx#165) caused by caused by this config option in its rollup configThis bug makes the v0.1.0 release unintentionally breaking (to an extent at least, as CJS support wasn't available before v0.1.0) and as such fixing it should be high prio. The workaround is to not use default exports, but default is used in the README and v0.1.0 should maintain backward compatibility (though minor releases prior to v1 are allowed to be breaking, this was unintentionally breaking)
The text was updated successfully, but these errors were encountered: