You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior:
I have a use case where I have a baseURI on a different domain than the origin of the page. It requires me to use absolutes urls with the stencil router to make everything work. I've tried many things, debug all the code, and finally I think I could make it work by specifying an absolute root on the router, for example root="https://foo.com/path_to_app/".
Having read all the stencil-router code, this should work, but I found that the following utility function breaks the logic and makes my usecase fail :
Expected behavior:
I would expect to be able to use the stencil-router with absolutes urls in a context where the baseURI is different than the location.origin.
But, since there is no unit test I can't be sure I'm not causing problems elsewhere...
Also, when I forked the repo it didn't build sucessfully. I'm getting this error :
[ ERROR ] TypeScript: ./....\packages\router\src\utils\createBrowserHistory.ts:67:5
Type 'LocationSegments | {}' is not assignable to type
'LocationSegments'. Type '{}' is missing the following properties
from type 'LocationSegments': pathname, query, key
Resources:
Before submitting an issue, please consult our docs.
Stencil version: (run
npm list @stencil/core
from a terminal/cmd prompt and paste output below): 1.12.2I'm submitting a ...
[X] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or https://stencil-worldwide.slack.com
Current behavior:
I have a use case where I have a baseURI on a different domain than the origin of the page. It requires me to use absolutes urls with the stencil router to make everything work. I've tried many things, debug all the code, and finally I think I could make it work by specifying an absolute root on the router, for example root="https://foo.com/path_to_app/".
Having read all the stencil-router code, this should work, but I found that the following utility function breaks the logic and makes my usecase fail :
File : location-utils.ts :
Expected behavior:
I would expect to be able to use the stencil-router with absolutes urls in a context where the baseURI is different than the location.origin.
I would expect the function isAbsolute to return true if it receives an absolute url like "https://foo.com/path_to_app/home".
I tried to fork the repo and fix the function isAbsolute like this and it worked :
But, since there is no unit test I can't be sure I'm not causing problems elsewhere...
Also, when I forked the repo it didn't build sucessfully. I'm getting this error :
[ ERROR ] TypeScript: ./....\packages\router\src\utils\createBrowserHistory.ts:67:5
Type 'LocationSegments | {}' is not assignable to type
'LocationSegments'. Type '{}' is missing the following properties
from type 'LocationSegments': pathname, query, key
Again, I'm lacking expertise on this code to understand why it's doing this.
For these reasons, I would rather like somebody to help me on this problem. It seems easy to fix though.
Related code:
The text was updated successfully, but these errors were encountered: