Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

"Sorry, we can't find that page" error when serving a library with an invalid spa name #314

Open
ThomasOrtiz opened this issue Aug 11, 2020 · 0 comments

Comments

@ThomasOrtiz
Copy link
Contributor

ThomasOrtiz commented Aug 11, 2020

Description

Builder has issues when attempting to serve a library with a package name under a sub-domain.

skyux serve

  • Uses the "name" of the spa to host your local at https://host.nxt.blackbaud.com/{ name }.
  • It pulls the spa name from:
    • skyuxconfig.json's name
    • package.json's name

The default template for libraries do not have a name field in the skyuxconfig so the defualt place to pull a new library's name is its package.json.

package.json name examples

  • skyux-lib-testing-serve
    • Serve at https://host.nxt.blackbaud.com/skyux-lib-testing-serve
    • This works fine.
  • @blackbaud-internal/blackbaud-skyux-lib-testing-serve
    • Serve at https://host.nxt.blackbaud.com/@blackbaud-internal/blackbaud-skyux-lib-testing-serve.
    • I believe that the extra / causes the browser to try to re-direct to a subdomain and results in a "Sorry, we can't find that page" error page.

The library template doesn't have a skyuxconfig.json > name field so it always pulls from the package.json > name field for hosting the local spa. This works fine for package names that are valid URLs but for packages without a valid package name it will fail to serve until you add a skyuxconfig.json > name.

Fix

Temporary

  • When using @blackbaud/internal (or other similar sub-domain packages) you need to specify a name field in the skyuxconfig.json.
  • Found the fix after finding this 3 year old slack thread.

Long-term

  • @Blackbaud-BobbyEarl mentioned that we might want to URL Encode the "name" before we send it to host.
  • At the very least have builder log some error message explaining that the spa name is invalid and how to fix it.
@ThomasOrtiz ThomasOrtiz changed the title "Sorry, we can't find that page" error when serving a library with a name including "/" "Sorry, we can't find that page" error when serving a library with an invalid spa name Aug 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants