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

Error: Error: Validation (isSlug) failed for slug #75

Closed
simhol opened this issue Apr 18, 2021 · 6 comments
Closed

Error: Error: Validation (isSlug) failed for slug #75

simhol opened this issue Apr 18, 2021 · 6 comments

Comments

@simhol
Copy link

simhol commented Apr 18, 2021

I've received this error on a fresh new project. Just cloned the starter and provided a .env.local file with the API_URL and _KEY to my Ghost instance.

I get the following error in my terminal when running this in my dev environment:

Error: Error: Validation (isSlug) failed for slug
at getPostBySlug (F:\Projects\tsc-blog.next\server\pages\index.js:4018:134)
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async getStaticProps (F:\Projects\tsc-blog.next\server\pages[...slug].js:10310:10)
at async renderToHTML (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\render.js:28:1737)
at async F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:112:97
at async __wrapper (F:\Projects\tsc-blog\node_modules\next\dist\lib\coalesced-function.js:1:330)
at async DevServer.renderToHTMLWithComponents (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:137:387)
at async DevServer.renderToHTML (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:138:923)
at async DevServer.renderToHTML (F:\Projects\tsc-blog\node_modules\next\dist\server\next-dev-server.js:35:578)
at async DevServer.render (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:75:236)
at async Object.fn (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:59:580)
at async Router.execute (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\router.js:25:67)
at async DevServer.run (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:69:1042)
at async DevServer.handleRequest (F:\Projects\tsc-blog\node_modules\next\dist\next-server\server\next-server.js:34:504)

I've changed nothing in the original repo.

@styxlab
Copy link
Owner

styxlab commented Apr 18, 2021

@simhol Sorry to hear you are running into issues. This error is coming from your Ghost CMS (there is no isSlug function in this repo).

  1. Please comment out API_URL and _KEY in your .env.local: In this case content is fetched from the example Ghost CMS. If this works, you know that the error is caused by your Ghost installation (see Validation (isSlug) failed for slug TryGhost/Ghost#10525) or is related to your specific content.
  2. Make sure your Ghost CMS is up-to-date (I am running a v4 instance, but a recent v3 should work too).
  3. Try to start with a fresh installation, copy all images over and then export/import 1 post at a time (this is a crude way to isolate problems coming from specific content, but should only be done as a last resort if all other debugging fails). You could also unpublish posts / pages, if you think a post is making trouble.

I also notice that you are building on Windows which is not officially supported (it means you are a bit on your own when it comes to debugging). I recommend using WSL 2 with Ubuntu when building on Windows. However, I don't think this is the issue here.

@simhol
Copy link
Author

simhol commented Apr 18, 2021

I will try to unpublish posts or import/export them to identify the malicious content!

@styxlab
Copy link
Owner

styxlab commented Apr 18, 2021

Can you please open a new issue for this error as it looks unrelated?

@styxlab
Copy link
Owner

styxlab commented Apr 18, 2021

I will try to unpublish posts or import/export them to identify the malicious content!

Before doing that, please make sure your Ghost instance is running on a recent version. Please also publish your software versions for OS, Ghost and npm/yarn here. You are getting many errors I have never seen before, so something is fundamentally wrong here.

Repository owner deleted a comment from simhol Apr 19, 2021
Repository owner deleted a comment from simhol Apr 19, 2021
@styxlab
Copy link
Owner

styxlab commented Apr 19, 2021

@simhol: moved the image optimization issue to #76

@styxlab
Copy link
Owner

styxlab commented May 1, 2021

Closing as not reproducable. If you disagree, please link to a repository with a reproducable example and add some instructions to it.

@styxlab styxlab closed this as completed May 1, 2021
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

2 participants