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

fix: Enabled sub folder, fetching wrong static JSON URL #351

Closed
ics-nishihara opened this issue Jan 18, 2021 · 0 comments
Closed

fix: Enabled sub folder, fetching wrong static JSON URL #351

ics-nishihara opened this issue Jan 18, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ics-nishihara
Copy link

๐Ÿ› The bug
I enable sub folder, fetching static JSON URL is wrong.

๐Ÿ› ๏ธ To reproduce
Steps to reproduce the behavior:

  1. setting sub folder at nuxt.config.json
router: {
  base: "/foo/",
}
  1. using useFetch() method normaly.
  2. access the page, the fetching static JSON is wrong. Nuxt tries fetching "fooKEY.json" not "foo/KEY.json"

๐ŸŒˆ Expected behaviour
Fetching the correct URL; "foo/KEY.json".

โ„น๏ธ Additional context
It caused by here. When does not set sub folder settings, the options.publicPath indicates / but /foo/ sets is indicates /foo. Fetching "fooKEY.json" because of the slash is dropped.

Sorry for my poor English

@ics-nishihara ics-nishihara added the bug Something isn't working label Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants