Skip to content

Failed to compile with 2 errors #24

Open
@sajjadalis

Description

First time using Gridsome.. Tried with both WordPress starters. This one and other bootstrap.. Same error on both. What i'm doing wrong?

ERROR  Failed to compile with 2 errors                                                                       2:57:01 AM

 error  in ./src/templates/WordPressPost.vue?vue&type=custom&index=0&blockType=page-query

Module build failed (from ./node_modules/gridsome/lib/plugins/vue-components/lib/loaders/page-query.js):
Error: Cannot query field "mediaDetails" on type "WordPressAttachment". Did you mean "mediaType"?

GraphQL request:44:7
43 |       altText
44 |       mediaDetails {
   |       ^
45 |         width
    at Object.module.exports (D:\Apps\gridsome-wp\node_modules\gridsome\lib\plugins\vue-components\lib\loaders\page-query.js:28:21)

 @ ./src/templates/WordPressPost.vue?vue&type=custom&index=0&blockType=page-query 1:0-339 1:355-358 1:360-696 1:360-696
 @ ./src/templates/WordPressPost.vue
 @ ./src/.temp/routes.js
 @ ./node_modules/gridsome/app/router.js
 @ ./node_modules/gridsome/app/entry.sockjs.js
 @ multi webpack/hot/dev-server webpack-hot-middleware/client?name=app&reload=true ./node_modules/gridsome/app/entry.client.js ./node_modules/gridsome/app/entry.sockjs.js

 error  in ./src/components/TagsWidget.vue?vue&type=custom&index=0&blockType=static-query

Module build failed (from ./node_modules/gridsome/lib/plugins/vue-components/lib/loaders/static-query.js):
Error: Cannot query field "title" on type "WordPressPostTag".

GraphQL request:22:9
21 |       node {
22 |         title
   |         ^
23 |         slug
    at Object.module.exports (D:\Apps\gridsome-wp\node_modules\gridsome\lib\plugins\vue-components\lib\loaders\static-query.js:34:14)

 @ ./src/components/TagsWidget.vue?vue&type=custom&index=0&blockType=static-query 1:0-340 1:356-359 1:361-698 1:361-698
 @ ./src/components/TagsWidget.vue
 @ ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/babel-loader/lib??ref--1-1!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/SiteSidebar.vue?vue&type=script&lang=js&
 @ ./src/components/SiteSidebar.vue?vue&type=script&lang=js&
 @ ./src/components/SiteSidebar.vue
 @ ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/babel-loader/lib??ref--1-1!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/layouts/Default.vue?vue&type=script&lang=js&
 @ ./src/layouts/Default.vue?vue&type=script&lang=js&
 @ ./src/layouts/Default.vue
 @ ./src/main.js
 @ ./node_modules/gridsome/app/main.js
 @ ./node_modules/gridsome/app/app.js
 @ ./node_modules/gridsome/app/entry.client.js
 @ multi webpack/hot/dev-server webpack-hot-middleware/client?name=app&reload=true ./node_modules/gridsome/app/entry.client.js ./node_modules/gridsome/app/entry.sockjs.js

In gridsome.config.js

module.exports = {
  siteName: 'Gridsome',
  siteDescription: 'A WordPress starter for Gridsome',

  templates: {
    WordPressCategory: '/category/:slug', // adds route for "category" post type (Optional)
    WordPressPost: '/:year/:month/:day/:slug', //adds route for "post" post type (Optional)
    WordPressPostTag: '/tag/:slug' // adds route for "post_tag" post type (Optional)
  },

  plugins: [
    {
      use: '@gridsome/source-wordpress',
      options: {
        baseUrl: 'http://words.test/', // process.env.WORDPRESS_URL, // required
        typeName: 'WordPress', // GraphQL schema name (Optional)
      }
    }
  ]
}

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions