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

Building with dynamically generated pages for tags fails. #1687

Open
marvinroman opened this issue May 15, 2023 · 0 comments
Open

Building with dynamically generated pages for tags fails. #1687

marvinroman opened this issue May 15, 2023 · 0 comments

Comments

@marvinroman
Copy link

marvinroman commented May 15, 2023

Description

Building a site using gridsome build when having dynamically created tag pages. An error occurs on build but works fine serving the site using gridsome develop.

Steps to reproduce

Node versions I had tried v12.21.0, v16.18.0, v17.9.1, v18.14.2.

This is what I have narrowed down to when it happens for me.
Packages:

"@gridsome/source-filesystem": "^0.6.0",
"gridsome": "^0.7.0",
"vuetify": "^2.6.15"

Gridsome config:

  plugins: [
    {
      use: "@gridsome/source-filesystem",
      options: {
        baseDir: "data/articles",
        typeName: "Article",
        path: '*.md',
        route: '/article/:author/:year/:month/:day/:title',
        refs: {
          tags: {
            typeName: 'Tag',
            create: true
          },
          author: {
            typeName: 'Author',
            create: true
          }
        }
      }
    }
  ],
  templates: {
    Author: '/author/:id',
    Tag: '/tag/:id'
  }

Markdown file in path /data/articles that include the following front matter added.

author: Author Name 2
tags: ['design', 'frontend']

Expected result

Tag directories and pages are generated. This is an example from another gridsome site.

Screenshot_20230515_121019

Actual result

Could not generate HTML for "/tag/design/":
TypeError: Cannot read property 'state' of undefined
    at lo.$page (node_modules/gridsome/app/graphql/mixin.js:17:32)
    at lo.$page (/home/marvin/repos/iedsa/my-project/node_modules/vue/dist/vue.runtime.common.prod.js:11:38195)
    at i.data (src/templates/Tag.vue:12:36)
    at /home/marvin/repos/iedsa/my-project/node_modules/vue/dist/vue.runtime.common.prod.js:11:37187
    at /home/marvin/repos/iedsa/my-project/node_modules/vue/dist/vue.runtime.common.prod.js:11:37247
    at eo (/home/marvin/repos/iedsa/my-project/node_modules/vue/dist/vue.runtime.common.prod.js:11:37434)
    at i.e._init (/home/marvin/repos/iedsa/my-project/node_modules/vue/dist/vue.runtime.common.prod.js:11:41333)
    at new i (/home/marvin/repos/iedsa/my-project/node_modules/vue/dist/vue.runtime.common.prod.js:11:38851)
    at Mt (/home/marvin/repos/iedsa/my-project/node_modules/vue-server-renderer/build.prod.js:1:23296)
    at po (/home/marvin/repos/iedsa/my-project/node_modules/vue-server-renderer/build.prod.js:1:70206)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Environment

  System:
    OS: Linux 6.1 Manjaro Linux
    CPU: (12) x64 AMD Ryzen 5 3600 6-Core Processor
  Binaries:
    Node: 16.18.0 - ~/.nvm/versions/node/v16.18.0/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v16.18.0/bin/npm
  Browsers:
    Firefox: 113.0
  npmPackages:
    @gridsome/source-filesystem: ^0.6.0 => 0.6.2 
    @gridsome/transformer-remark: ^0.6.4 => 0.6.4 
    @gridsome/vue-remark: ^0.2.6 => 0.2.6 
    gridsome: ^0.7.0 => 0.7.23 
    gridsome-plugin-remark-shiki: ^0.6.0 => 0.6.0 
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

1 participant