[BUG] Default import is broken in v3.5.0
See original GitHub issueDescribe the bug As of v3.5.0, When importing as
import csv from 'fast-csv';
and using as
csv.writeToStream(stream, rowsWithHeaders, {
headers: true,
});
I get an error at runtime
TypeError: Cannot read property 'writeToStream' of undefined
To fix it, I could import like this :
import * as csv from 'fast-csv';
and everyting works again
To Reproduce Steps to reproduce the behavior:
npm install fast-csv@3.5.0
- Here is a failing test (with
jest
) :
import csv from 'fast-csv';
describe('CSV issue', () => {
test('should not throw', () => {
expect(csv).not.toBeUndefined();
});
});
it fails with :
FAIL src/api-admin/application/__tests__/repro.spec.ts
● CSV issue › should not throw
expect(received).not.toBeUndefined()
Received: undefined
3 | describe('CSV issue', () => {
4 | test('should not throw', () => {
> 5 | expect(csv).not.toBeUndefined();
| ^
6 | });
7 | });
8 |
at Object.<anonymous> (src/api-admin/application/__tests__/repro.spec.ts:5:21)
Expected behavior
import csv from 'fast-csv';
should still work, or this should be a major version bump as it is possibly breaking callers.
Desktop (please complete the following information):
- OS: macOS
- OS Version Mojave 10.14.6
- Node Version 12.13.1
Additional context
I believe the breakage is due to the changes in index.ts
in :
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
[BUG] 5.0 Failed to compile with create-react-app · Issue #1307
[BUG] 5.0 Failed to compile with create-react-app #1307 ... Can't import the named export 'XXX' from non EcmaScript module (only default export is ......
Read more >Bug: Dynamic imports are broken ☠️ - Site Feedback
Yep. The workaround I have to use currently is replacing all dynamic imports with require('https://bundle.run/...') Sorry, this was my fault! I've deployed a...
Read more >Bug listing with status RESOLVED with resolution FIXED as at ...
... Bug:3 - "poedit-1.1.5.ebuild" status:RESOLVED resolution:FIXED severity:normal ... Bug:106 - "dircolors is not useable with zsh, and may be broken" ...
Read more >[UE5] Nanite bugged in new version of UE5?
Hi, I updated Unreal to the latest github repo of 5.0. After reimporting my project nanite does not work anymore.
Read more >Eclipse error: "The import XXX cannot be resolved"
This is still (in v 2020-09) an old (2010) Eclipse bug that can be resolved ... Changing the order back does not regress...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve create #301 to address this.
I think documentation is a great place to start!
Ill add a some documentation about that. A longer term change would be to provide ts examples along side the js examples.
Thanks again for pointing this out!