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

regex error after importing #22

Open
feldman4 opened this issue Oct 2, 2017 · 6 comments
Open

regex error after importing #22

feldman4 opened this issue Oct 2, 2017 · 6 comments

Comments

@feldman4
Copy link

feldman4 commented Oct 2, 2017

Importing version 1.4.0 and compiling gives the following error

App.js:8623 Uncaught SyntaxError: Invalid regular expression: /[Ù-Ü]/: Range out of order in character class
    at new RegExp (<anonymous>)
    at regex (App.js:8623)
   ...

in a code block that begins

var _elm_community$string_extra$String_Extra$accentRegex = function () {
... 
}

using Google Chrome | 61.0.3163.100 (Official Build) (64-bit).

@eeue56
Copy link

eeue56 commented Oct 29, 2017

@feldman4, can you provide a reproducable example?

@feldman4
Copy link
Author

Not sure how to make this a minimal example, but the following reproduces the error. Deleting import String.Extra in src/App.elm removes the error.

git clone https://github.com/feldman4/elm-davis.git .
elm-make src/App.elm --output=scripts/App.js
open index.html

@Chadtech
Copy link

Im also experiencing this. Same function.

    var _elm_community$string_extra$String_Extra$accentRegex = function() {
        var matches = {
            ctor: '::',
            _0: {
                ctor: '_Tuple2',
                _0: '[à-æ]',
                _1: 'a'
            },
            _1: {
                ctor: '::',
                _0: {
                    ctor: '_Tuple2',
                    _0: '[À-Æ]',
                    _1: 'A'
                },
                _1: {
                    ctor: '::',
                    _0: {
                        ctor: '_Tuple2',
                        _0: 'ç',
                        _1: 'c'
                    },
                    _1: {
                        ctor: '::',
                        _0: {
                            ctor: '_Tuple2',
                            _0: 'Ç',
                            _1: 'C'
                        },
                        _1: {
                            ctor: '::',
                            _0: {
                                ctor: '_Tuple2',
                                _0: '[è-ë]',
                                _1: 'e'
                            },
                            _1: {
                                ctor: '::',
                                _0: {
                                    ctor: '_Tuple2',
                                    _0: '[È-Ë]',
                                    _1: 'E'
                                },
                                _1: {
                                    ctor: '::',
                                    _0: {
                                        ctor: '_Tuple2',
                                        _0: '[ì-ï]',
                                        _1: 'i'
                                    },
                                    _1: {
                                        ctor: '::',
                                        _0: {
                                            ctor: '_Tuple2',
                                            _0: '[Ì-�]',
                                            _1: 'I'
                                        },
                                        _1: {
                                            ctor: '::',
                                            _0: {
                                                ctor: '_Tuple2',
                                                _0: 'ñ',
                                                _1: 'n'
                                            },
                                            _1: {
                                                ctor: '::',
                                                _0: {
                                                    ctor: '_Tuple2',
                                                    _0: 'Ñ',
                                                    _1: 'N'
                                                },
                                                _1: {
                                                    ctor: '::',
                                                    _0: {
                                                        ctor: '_Tuple2',
                                                        _0: '[ò-ö]',
                                                        _1: 'o'
                                                    },
                                                    _1: {
                                                        ctor: '::',
                                                        _0: {
                                                            ctor: '_Tuple2',
                                                            _0: '[Ò-Ö]',
                                                            _1: 'O'
                                                        },
                                                        _1: {
                                                            ctor: '::',
                                                            _0: {
                                                                ctor: '_Tuple2',
                                                                _0: '[ù-ü]',
                                                                _1: 'u'
                                                            },
                                                            _1: {
                                                                ctor: '::',
                                                                _0: {
                                                                    ctor: '_Tuple2',
                                                                    _0: '[Ù-Ü]',
                                                                    _1: 'U'
                                                                },
                                                                _1: {
                                                                    ctor: '::',
                                                                    _0: {
                                                                        ctor: '_Tuple2',
                                                                        _0: 'ý',
                                                                        _1: 'y'
                                                                    },
                                                                    _1: {
                                                                        ctor: '::',
                                                                        _0: {
                                                                            ctor: '_Tuple2',
                                                                            _0: 'ÿ',
                                                                            _1: 'y'
                                                                        },
                                                                        _1: {
                                                                            ctor: '::',
                                                                            _0: {
                                                                                ctor: '_Tuple2',
                                                                                _0: '�',
                                                                                _1: 'Y'
                                                                            },
                                                                            _1: {
                                                                                ctor: '[]'
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        };
        return A2(_elm_lang$core$List$map, function(_p0) {
            var _p1 = _p0;
            return {
                ctor: '_Tuple2',
                _0: _elm_lang$core$Regex$regex(_p1._0),
                _1: _p1._1
            };
        }, matches);
    }();

I'm not sure why this is a problem for me. When I build and run my code locally it works fine. When I deploy to surge.sh it also works fine. When I deploy to AWS however, it does not. It doesnt make sense to me why my deploy target matters, so I presume I dont understand my circumstance, but right now thats what the difference appears to be.

@jsoo1
Copy link

jsoo1 commented May 31, 2018

I just experienced this, too (same error, same line). I discovered it locally on version 1.4.0.
Both in firefox and Chrome:

  • Firefox Developer Edition 61.0b8 (64-bit)
  • Google Chrome Version 66.0.3359.181 (Official Build) (64-bit)

@jsoo1
Copy link

jsoo1 commented Aug 10, 2018

Is this a locale issue? If so, how can it be fixed? I want to use this package but this is blocking me.

@lorenzo
Copy link
Collaborator

lorenzo commented Aug 10, 2018

No idea to be honest. It would be nice to first know how to reproduce it.

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

5 participants