question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

document base url does not update when URL changes in a single-page-app?

See original GitHub issue

I discovered a bug in my app that uses tinymce-react, related to the handling of relative URLs. I’m not certain, but I’m guessing that it’s related to how document_base_url is handled.

Here’s how I’ve observed the bug:

  • Page loads with a url like dashboard.wikiedu.org/courses/My_School/My_course_(Fall_2018)
  • User navigates to dashboard.wikiedu.org/courses/My_School/My_course_(Fall_2018)/timeline
  • TinyMCE field contains a link like /training/students/getting-started.
  • After saving, the now-relative updated url is one level off of what it originally was.

In contrast, the relative url is still pointed to the correct place after saving if the user loads dashboard.wikiedu.org/courses/My_School/My_course_(Fall_2018)/timeline initially.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
SimonFccommented, May 20, 2019

@ragesoss, Setting the convert_url option to false fixes the issue in your reproduction app. I’ll be closing this now but let me know if you’re still having the issue and this doesn’t work out for you in your real use case!

0reactions
ragesosscommented, Sep 12, 2019

@SimonFc thanks! Didn’t see this until now, but I thought I had worked around the situation in my app… discovered today that the workaround wasn’t quite complete, and went searching for this thread. Yep, convert_urls: true fixed it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-router URLs don't work when refreshing or writing ...
I added --history-api-fallback parameter in package.json file. Then page refreshing is working correctly. Each when I change code, web page is refresh ......
Read more >
The Document Base URL element - HTML - MDN Web Docs
The HTML element specifies the base URL to use for all relative URLs in a document. There can be only one element in...
Read more >
Add a Base URL to an App Using Redux and React Router
In this guide, you will learn how to set up a base URL in React Router and how to combine Redux seamlessly.
Read more >
Fixing the 'cannot GET /URL' error on refresh with React ...
In this post you'll learn how to fix the 'cannot GET /URL' error ... no longer making requests to your server every time...
Read more >
Configuring the URL strategy on the web - Flutter documentation
Update the <base href="/"> tag in web/index.html to the path where your app is hosted. For example, to host your Flutter app at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found