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

SPA demo not working when deploy on subpath of domain #272

Open
x4fingers opened this issue May 2, 2024 · 1 comment
Open

SPA demo not working when deploy on subpath of domain #272

x4fingers opened this issue May 2, 2024 · 1 comment
Labels

Comments

@x4fingers
Copy link

Describe the Bug

The SPA demo is not working when I deploy it on the subpath of the domain.

I followed the document from here: https://nuejs.org/docs/reference/configuration-options.html#base and modified some static paths on the app.

Environment

  • Bun 1.1.6
  • Nue 0.5.3

Minimal Reproduction

For details, I created a repository for demonstration purposes here. I will delete it after this issue is finished.

@x4fingers x4fingers added the bug label May 2, 2024
@nobkd
Copy link
Collaborator

nobkd commented Aug 19, 2024

Hello, I was looking through older issues, and I checked your demo, and there are some more paths, that have to be changed. Then it works.

The following would be necessary:

  • The router.on paths in app.nue have to use the full urls: /nuejs/…
  • The imports in app.nue need can just use relative imports ./@nue/… / ./model/…
  • The href in the nav in app.nue might need trailing slash. Not sure, may be different between servers.
  • The fetch in /model/index.ts should use relative paths: ./model/…

Note

The router.on part and ability to use {base} in hrefs (currently not working here) should probably be improved in nue(kit). But SPA stuff is as I can see still low priority

The stuff then has to be deployed/served on a subpath. At least locally it works for me after those changes.

(Currently, with the new beta it seems, like index.html doesn't work anymore. Just use index.md with following content instead: [app :title :description] )

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

No branches or pull requests

2 participants