Skip to content

Markdown files not found in production #902

@marscrusader

Description

@marscrusader

"@nuxt/content": "^1.14.0",
"nuxt": "^2.15.3"

I don't want to bother you if I can but for whatever reason the articles are just not being generated in production. I have been following this article.

My folder structure:
content/category/my-first-blog-post.md

My config:
target: 'static',

// pages/en/_slug.vue

async asyncData({ $content, params, error }) {
    let article
    try {
      article = await $content('category', params.slug).fetch()
    } catch (err) {
      error({
        statusCode: 404,
        message: err
      })
    }
    return { article }
  }

On my local http://localhost:3000/en/my-first-blog-post it works fine, but in production after deploying to Netlify, Netlify will return 404. Making a get request to /_content does not work as well and will return 404. I have also ran nuxt generate and nuxt start to test out the site before deploying and it works perfectly.

I can't figure out why its failing in Netlify, I've cleared cache and redeployed multiple times but the result is the same. It can only load the home page '/' but not any other page. Link to the article on my site on Netlify.

Update: I've downloaded the dist/ directory generated by Netlify and compare it with my local dist/ and its pretty much the same. I'm starting to suspect its a Netlify thing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions