Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Nav Bar links do not work correctly behind Cloudflare Access #580

Closed
aguilaair opened this issue Jul 4, 2023 · 7 comments
Closed

Nav Bar links do not work correctly behind Cloudflare Access #580

aguilaair opened this issue Jul 4, 2023 · 7 comments
Assignees

Comments

@aguilaair
Copy link

Hello,

We seem to be having trouble with deploying retype behind our authentication layer, with the links in the navbar not being generated correctly. For example, when you navigate to a page that is not the index, the link in the navbar to one of the pages is ./frontend-v1/general/accessusers/ when it should not have the . at the front.

When deploying with Vercel temporary link it seems to work fine, but then production has this issue.

Let me know if you need any info.

@geoffreymcgill geoffreymcgill self-assigned this Jul 4, 2023
@geoffreymcgill
Copy link
Collaborator

Can you share your retype.yml file? or is your project available in GitHub?

My first guess is that the url config within your projects retype.yml file is not correct. It might be the correct or valid url for local use, but once deployed to production, the url is different.

@geoffreymcgill
Copy link
Collaborator

ah, Cloudflare...

Can you ensure the Cloudflare Rocket Loader feature is turned off?

@geoffreymcgill
Copy link
Collaborator

You can determine if Rocket Loader is being used on your website by viewing the HTML source on any of your live production pages and search for the value rocket-loader.

If rocket-loader is found, then the Cloudflare Rocket Loader service is enabled for your website.

You can disable within Cloudflare for you domain by going to:

Speed > Optimization > Content Optimization > Toggle off

Screen Shot 2023-07-04 at 12 34 08 PM

You can also create a Cloudflare Rule to disable Rocket Loader on a per hostname basis.

@aguilaair
Copy link
Author

Disabling Rocket Loader seems to have done the trick. Thank you!

@aguilaair
Copy link
Author

Is it worth creating an issue to support Rocket Loader, @geoffreymcgill ?

@geoffreymcgill
Copy link
Collaborator

Is it worth creating an issue to support Rocket Loader, @geoffreymcgill ?

I think it is very unlikely that Retype will be able to support Rocker Loader, at least for the foreseeable future. It's definitely something that we can investigate at a later time.

I did find a way to configure specific <script> elements so Rocket Loader will ignore:

https://developers.cloudflare.com/fundamentals/speed/rocket-loader/ignore-javascripts/

I'll try adding the data-cfasync="false" attribute and see if that can get everything working with Rocket Loader still enabled for the site. Theoretically, this should work.

@geoffreymcgill
Copy link
Collaborator

As of the upcoming v3.1.0 release, Retype now supports Cloudflare Rocket Loader. There are no changes required in your project, other than building with Retype v3.1.0 once it is released.

Even though Retype is now working well, we would still recommend disabling Cloudflare Rocket Loader within your Cloudflare admin panel.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants