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

State error and can't connect to api #105

Open
moreplease opened this issue Feb 18, 2020 · 10 comments
Open

State error and can't connect to api #105

moreplease opened this issue Feb 18, 2020 · 10 comments

Comments

@moreplease
Copy link

Hi, I'm getting these errors in the console: https://gyazo.com/3e7eda072da541876134983fc825d00a. I'm using mampps and website displays on this link: http://localhost:8888/vuejs/.

I've just cloned your project and used npm install and then npm run watch without any errors.

Any ideas of what can be wrong with it?

@EvanAgee
Copy link
Owner

Hello @moreplease thanks for reaching out. I wanted to clarify are you getting this error with the most recent version of the project or an older version? Can you show me a screenshot or paste the code of the Vuex module that's causing the error so I can suggest a fix?

@moreplease
Copy link
Author

I have the newest files from your github. Just installed it around 20 minutes ago and haven't made any changes. However I'm getting these errors: https://gyazo.com/3e7eda072da541876134983fc825d00a.

I've saved permalinks however looks like it can't connect to WP API.

@Yourgene
Copy link

Hi, your error is related to #52

@moreplease
Copy link
Author

Thanks! I've added vuejs/ on the path like this: https://gyazo.com/03c947f99941bc1d003000dc6545644f and also in settings and don't have any errors in the console. However I don't see any content that is written in Home.vue.

@Yourgene
Copy link

Hi,

I had same errors as you yesterday during my initialization.
I assume you are working on a local server, so your url looks like that in the browser : http://localhost:80/vuejs/

First, you should add a "/" before all your "vuejs" in the router.

Second, go to settings.js and change your API_BASE_PATH to API_BASE_PATH: "http://localhost:80/vuejs/wp-json/wp/v2/"

That's what I did to make it work.

@moreplease
Copy link
Author

Almost done. However still see some errors in the console: https://gyazo.com/d74d18c49a651b65741b21e6e53edd7e.

Here is settings.js file: https://gyazo.com/3eb29a76c43ec5044def2c280879c5bb
Here is index.js: https://gyazo.com/035582e7dee7fd3b114b65b151769c68

@Yourgene
Copy link

You didnt change your API BASE PATH, as explained in my previous comment

@moreplease
Copy link
Author

Hmm, now I see recent posts, but when I click on it, it doesn't display anything and link looks like:
http://localhost:8888/vuejs/:8888/vuejs/2020/02/18/hello-world/.

API_BASE_PATH: "http://localhost:8888/vuejs/wp-json/wp/v2/"

@moreplease
Copy link
Author

Isn't there an error? I needed to add [0] to pageContent, because it didn't work.

https://gyazo.com/36b5b116bc7bd8f2aa7b8b2b18fb65dc

Does it work for you without [0]? For me pageContent.titlle is undefined.

@mmillis1
Copy link
Contributor

mmillis1 commented Mar 3, 2020

Isn't there an error? I needed to add [0] to pageContent, because it didn't work.

https://gyazo.com/36b5b116bc7bd8f2aa7b8b2b18fb65dc

Does it work for you without [0]? For me pageContent.titlle is undefined.

I believe this has been resolved as of 106

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

No branches or pull requests

4 participants