-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[email protected]
failures in typescript
and parcel
builds and runtime
#9676
Comments
In the meantime this is workaround: import format from 'date-fns/format'; |
The workaround doesn't seem to work in v4.1.0, I can't find any way of using v4 of import {format} from 'date-fns/format'; gives: @parcel/core: node_modules/date-fns/format.js does not export 'format' The workaround causes my typescript compilation to fail: import format from "date-fns/format"; tsc --no-emit
error TS2613: Module '"node_modules/date-fns/format"' has no default export. Did you mean to use 'import { format } from "node_modules/date-fns/format"' instead?
|
I noticed this issue converting some javascript to typescript. And for some reason it doesn't seem to be a problem with javascript. Not ideal, but with that in mind, I've managed to work around it by importing and exporting format via a format.js import { format } from 'date-fns';
export { format }; |
The question is, is it a problem with Edit: |
Any updated on this? I think this issue is related to date-fns/date-fns#3670 |
Ran into this issue too. The workaround e.g. importing Presumably other bundlers don't have this issue with |
🐛 bug report
After upgrading
date-fns
to version3.6.0
the parcel build started failing, not finding the exported functions. Apart from that the runtime function calls in the dev server fails with provided errors documented in the reproduction repository.This seems to be a problem for
parcel
builds in particular, a related issue indate-fns
can be found here: date-fns/date-fns#3744🤔 Expected Behavior
Build should be successful and runtime function calls should work as described in the
date-fns
repository.😯 Current Behavior
Build fails unless specifying the alias function name. Runtime the
format
function throws an error.Build error:
Runtime error:
🔦 Context
This issue prevents us from upgrading
date-fns
to the latest supported major version.💻 Code Sample
Reproduction repository: https://github.com/Milkywire/date-fns-parcel-reproduction
🌍 Your Environment
The text was updated successfully, but these errors were encountered: