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

MapInit error #55

Closed
tforkmann opened this issue Dec 8, 2022 · 6 comments
Closed

MapInit error #55

tforkmann opened this issue Dec 8, 2022 · 6 comments

Comments

@tforkmann
Copy link

Hi there,

updating to the newest Elmish (4.0.0-beta-8) produces following error:

String.js:522 Uncaught (in promise) Error: Invalid startIndex and/or length
at substring (String.js:522:15)
at parseParams (parser.fs.js:274:72)
at parsePath (parser.fs.js:5:56)
at urlParser (Pages.js:197:21)
at init (navigation.fs.js:96:56)
at Program$4.init (Util.js:552:12)
at traceInit (program.fs.js:66:38)
at init (debugger.fs.js:36:30)
at Util.js:552:12
at mapInit (App.js:2909:42)

I didn't make any changes from the version 3 to version 4 yet.

image

Any idea how to fix that?

@et1975
Copy link
Member

et1975 commented Dec 8, 2022

Hm, there was this fix...

@tforkmann
Copy link
Author

tforkmann commented Dec 8, 2022

Hmm that fix was for hashes right?

@tforkmann
Copy link
Author

I guess it would need the same fix of parsePath instead of parseHash. Gonna try to create a PR.

@tforkmann tforkmann mentioned this issue Dec 8, 2022
@et1975
Copy link
Member

et1975 commented Dec 26, 2022

@alfonsogarciacaro I've created a unit test that passes (w/ or w/o the check in line 357) when running in CLR, which tells me the substring impl in JS doesn't work the same way as String.Substring - JS throws exception if start position points at the end, while .NET - returns empty string. Do you think this should be addressed in Fable core?

@et1975
Copy link
Member

et1975 commented Dec 28, 2022

will release a fix in urlParser 1.0.1.

@et1975 et1975 closed this as completed Dec 28, 2022
@alfonsogarciacaro
Copy link
Contributor

@et1975 The substring implementation seems to be right in Fable (it will return an empty string if startIndex is same as length). Maybe the error is caused by something else?

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

3 participants