question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Virtual path with gatsby development

See original GitHub issue

Description

When running “gatsby develop” after the latest MAJ, the development bundle seems to fail because of a wrong path parsing. This is blocking for deployment and build purpose.

Steps to reproduce

Just run gatsby develop.

Expected result

The dev build should works. Like this quick fix : https://github.com/gatsbyjs/gatsby/pull/25720#issuecomment-667997214

Actual result

There is the error about the build.

Screenshot 2020-08-12 at 09 51 22

Environment

System: OS: macOS 10.15.6 CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.18.3 - ~/.nvm/versions/node/v12.18.3/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.14.6 - ~/.nvm/versions/node/v12.18.3/bin/npm Languages: Python: 2.7.16 - /usr/bin/python Browsers: Chrome: 84.0.4147.105 Firefox: 74.0 Safari: 13.1.2 npmPackages: gatsby: ^2.24.43 => 2.24.43 gatsby-image: ^2.4.15 => 2.4.15 gatsby-link: ^2.4.11 => 2.4.13 gatsby-plugin-alias-imports: ^1.0.5 => 1.0.5 gatsby-plugin-eslint: ^2.0.8 => 2.0.8 gatsby-plugin-manifest: ^2.2.39 => 2.4.22 gatsby-plugin-modal-routing: ^1.1.0 => 1.2.0 gatsby-plugin-offline: ^3.2.23 => 3.2.23 gatsby-plugin-react-helmet: ^3.1.21 => 3.3.10 gatsby-plugin-sass: ^2.3.4 => 2.3.12 gatsby-plugin-sharp: ^2.6.26 => 2.6.26 gatsby-plugin-sitemap: ^2.4.3 => 2.4.11 gatsby-plugin-styled-components: ^3.2.3 => 3.3.10 gatsby-plugin-svgr: ^2.0.2 => 2.0.2 gatsby-plugin-web-font-loader: ^1.0.4 => 1.0.4 gatsby-plugin-webpack-bundle-analyzer: ^1.0.5 => 1.0.5 gatsby-source-contentful: ^2.3.36 => 2.3.36 gatsby-source-filesystem: ^2.1.46 => 2.3.24 gatsby-transformer-plaintext: ^1.0.0 => 1.0.0 gatsby-transformer-sharp: ^2.3.13 => 2.5.12 npmGlobalPackages: gatsby-cli: 2.12.68

Reference

As asked by @pieh there is the whole discussion https://github.com/gatsbyjs/gatsby/pull/25720

Thank you in advance for your hard work !

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
piehcommented, Aug 12, 2020

It looks like this is pretty much same problem as one described in https://github.com/gatsbyjs/gatsby/issues/26319#issuecomment-671462868, so idea of adjusting “virtual path” to include .cache for those autogenerated modules probably will fix it (as gatsby-plugin-eslint already ignores .cache).

Thanks for the eslint config - this should make it much easier for me to reproduce

1reaction
MrGloxcommented, Aug 12, 2020

There is the .eslintrc and yes we use gatsby-plugin-eslint in dev purpose.

{
  "parser": "babel-eslint",
  "rules": {
    "quotes": ["error", "single", { "avoidEscape": true }],
    "indent": ["error", 2],
    "react/jsx-curly-spacing": [
      2,
      { "when": "always", "spacing": { "objectLiterals": "never" } }
    ],
    "object-curly-spacing": ["error", "always", { "objectsInObjects": false }]
  },
  "extends": [
    "eslint:recommended",
    "plugin:react/recommended"
    // "plugin:mdx/recommended"
  ],
  "settings": {
    "import/resolver": {
      "alias": [
        ["assets", "./src/components"],
        ["components", "./src/components"],
        ["containers", "./src/containers"],
        ["contexts", "./src/contexts"],
        ["utils", "./src/utils"]
      ]
    },
    "react": {
      "pragma": "React",
      "version": "latest"
    }
  },
  "env": {
    "browser": true,
    "jest": true,
    "node": true
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding a Path Prefix - Gatsby
Add the path prefix to paths using withPrefix ... For pathnames you construct manually, there's a helper function, withPrefix that prepends your path...
Read more >
How To Set Up Your First Gatsby Website | DigitalOcean
Start developing it by running: cd gatsby-starter-default gatsby develop. gatsby-starter-default is the name of your new directory.
Read more >
GatsbyJs client only paths goes to 404 page when the url is ...
Gatsby can't generate static pages that exist at paths that you don't provide. If you wanted to setup your server to route those...
Read more >
How to Install, Setup, Build and Deploy Gatsby JS ... - YouTube
Gatsby JS is one of the best tools in which to build websites with. It's fast, agile but the initial entry to using...
Read more >
Build a Secure Blog with Gatsby, React, and Netlify
Gatsby is a tool for creating static websites with React. It allows you to pull your data from virtually anywhere: content management ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found