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

Router.base ignored when fetching content #69

Closed
mkamensky opened this issue May 30, 2020 · 7 comments · Fixed by #78
Closed

Router.base ignored when fetching content #69

mkamensky opened this issue May 30, 2020 · 7 comments · Fixed by #78
Assignees
Labels
bug Something isn't working

Comments

@mkamensky
Copy link

Version

@nuxt/content: v1.2.0
nuxt: v2.12.2

I have router.base set to /fe/. It seems that @nuxt/content ignores this when I call fetch() in my Vue file. When I use curl to call the api explicitly, everything seems fine. I tried setting apiPrefix to fe/_content, and then the api is called there, but is actually available at /fe/fe/_content

(Sorry, I didn't manage to operate the codesandbox)

@mkamensky mkamensky added the bug Something isn't working label May 30, 2020
@chrisjung-dev
Copy link
Contributor

chrisjung-dev commented May 31, 2020

This doubles #52

@mkamensky
Copy link
Author

@campino2k I wasn't sure, that one seems to be concerned only with db.json (which I could not find in the docs)

@benjamincanac
Copy link
Member

Hey @mkamensky,

Could you test if the #78 PR solves your issue?

@benjamincanac benjamincanac linked a pull request Jun 1, 2020 that will close this issue
@mkamensky
Copy link
Author

@benjamincanac Yes, appears like it does, thanks!

@mkamensky
Copy link
Author

mkamensky commented Jun 2, 2020

Actually, I'm not sure, but perhaps it's a different problem: the content is shown fine the first time, but if I reload, this just seems stuck. In the console I see messages like:

Firefox can’t establish a connection to the server at ws://10.0.0.215:3333/fe/_content/ws.
[@nuxt/content] WS Error: 
error { target: WebSocket, isTrusted: true, srcElement: WebSocket, currentTarget: WebSocket, eventPhase: 2, bubbles: false, cancelable: false, returnValue: true, defaultPrevented: false, composed: false, … }
[@nuxt/content] WS reconnecting...
[@nuxt/content] WS connect to ws://10.0.0.215:3333/fe/_content/ws

If I restart yarn dev, it loads again (but again, only once)

@benjamincanac
Copy link
Member

benjamincanac commented Jun 2, 2020

@mkamensky Do you have this error on dev mode with universal mode?

It should be fixed in the last update of the PR.

@mkamensky
Copy link
Author

@benjamincanac no, it's SPA mode

@benjamincanac benjamincanac self-assigned this Jun 3, 2020
pi0 pushed a commit that referenced this issue Feb 8, 2022
* fix: improve regex to support encoded components

* fix: workaround for nuxt-i18n behavior
pi0 pushed a commit that referenced this issue Feb 8, 2022
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants