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

IE11 error in v2.14.0 #1833

Closed
jackocnr opened this issue Jun 8, 2020 · 4 comments
Closed

IE11 error in v2.14.0 #1833

jackocnr opened this issue Jun 8, 2020 · 4 comments

Comments

@jackocnr
Copy link

jackocnr commented Jun 8, 2020

I'm seeing this error:

Expected identifier, string, or number

When I upgrade from v2.13.0 to v2.14.0.

I'm using the following imports from date-fns:

import format from 'date-fns/format';
import parseISO from 'date-fns/parseISO';
import { da, de, es, fr, id, it, ms, nb, nl, pl, pt, ro, sv, tr } from 'date-fns/locale';

Here is a screenshot from IE11 devtools - the error is caused by line 10481.

Screenshot 2020-06-08 at 15 00 39

Let me know if there's anything else I can provide.

@jeroenkampinga
Copy link

I have te same error in ie11.

@gottsohn
Copy link
Contributor

@jackocnr @jeroenkampinga
I had the same error, here's a temporal solution I used until this is fixed.

Using npm postinstall script. I rewrite the [-1] to '-1'

#!/usr/bin/env sh

replaceLocale()
{
    if test -f "$1" ; then
        echo "Replacing [-1] in '$1'."
        sed -i -e "s%\[-1\]\:%'-1'\:%" $1
        sed -i -e "s%\[1\]\:%'1'\:%" $1
        sed -i -e "s%\[0\]\:%'0'\:%" $1
        echo "Replaced IE 11 incompatible syntax in '$1'"
    else
        echo "'$1' does not exist."
    fi 
}

replaceLocale "node_modules/date-fns/esm/locale/hu/_lib/formatDistance/index.js"
replaceLocale "node_modules/date-fns/locale/hu/_lib/formatDistance/index.js"

@ghost
Copy link

ghost commented Jul 3, 2020

You can transpile date-fns with webpack babel-loader.

@kossnocorp
Copy link
Member

Closed by #1842

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants