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

[SSR] Adding basePath to ROOT_URL alters intended url #508

Closed
rikonor opened this issue Jan 29, 2016 · 2 comments
Closed

[SSR] Adding basePath to ROOT_URL alters intended url #508

rikonor opened this issue Jan 29, 2016 · 2 comments

Comments

@rikonor
Copy link

rikonor commented Jan 29, 2016

Hi,

I've noticed the following issue with the ssr branch.

When ROOT_URL has a basePath, e.g. ROOT_URL=http://localhost:8000/basePath - whenever the browser loads the page the path gets an additional basePath appended at the end of the url, e.g. visiting http://localhost:8000/basePath will "redirect" to http://localhost:8000/basePath/basePath.

This seems to be caused by router.js#L46.

I had tried to clone the ssr branch locally in order to try and fix this, but encountered an additional issue #507

@mquandalle
Copy link
Contributor

Reproduced, will work on a fix.

mquandalle added a commit to mquandalle/flow-router that referenced this issue Feb 1, 2016
@arunoda arunoda reopened this Feb 1, 2016
mquandalle added a commit to mquandalle/flow-router that referenced this issue Feb 1, 2016
mquandalle added a commit to mquandalle/flow-router that referenced this issue Feb 1, 2016
@rikonor
Copy link
Author

rikonor commented Feb 1, 2016

@mquandalle I realize, as you say, that the root cause may be Meteor.absoluteUrl. However, applying your fix locally did not fix the problem for me. The path still showed double basePath.

I managed to resolve this (at least temporarily) by commenting out router.js#L46.

Also, please notice an additional issue. Caching will fail when basePath is present. To fix it (again, temporarily until the root cause is fixed) I had to add the following:

// server/route.js
_cachePage(url, data, timeout) {
  // Fix URL to include _basePath
  url = `${FlowRouter.basePath}${url}`;
  ...
}

@rikonor rikonor closed this as completed Oct 6, 2016
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