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

Virtual path with gatsby development #26393

Closed
MrGlox opened this issue Aug 12, 2020 · 6 comments · Fixed by #26396
Closed

Virtual path with gatsby development #26393

MrGlox opened this issue Aug 12, 2020 · 6 comments · Fixed by #26396
Assignees
Labels
topic: webpack/babel Webpack or babel type: bug An issue or pull request relating to a bug in Gatsby

Comments

@MrGlox
Copy link

MrGlox commented Aug 12, 2020

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 : #25720 (comment)

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 #25720

Thank you in advance for your hard work !

@MrGlox MrGlox added the type: bug An issue or pull request relating to a bug in Gatsby label Aug 12, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 12, 2020
@pieh pieh self-assigned this Aug 12, 2020
@pieh pieh added topic: webpack/babel Webpack or babel and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Aug 12, 2020
@pieh
Copy link
Contributor

pieh commented Aug 12, 2020

Do you use custom eslint setup? Possibly with gatsby-plugin-eslint? If so - could you share your eslint configuration?

@MrGlox
Copy link
Author

MrGlox commented 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
  }
}

@pieh
Copy link
Contributor

pieh commented Aug 12, 2020

It looks like this is pretty much same problem as one described in #26319 (comment), 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

@MrGlox
Copy link
Author

MrGlox commented Aug 12, 2020

Perfect, it works ! I close this one because it's already handled in the linked post ! Thank you again for your reactivity, I'm waiting for your update !

@MrGlox MrGlox closed this as completed Aug 12, 2020
@pieh
Copy link
Contributor

pieh commented Aug 12, 2020

Perfect, it works !

By this - do you mean that you tried the change from PR ( #26396 ) locally?

I did manually test my change after I reproduced the problem using gatsby-plugin-eslint and your .eslintrc config, but that was very simple reproduction case

@MrGlox
Copy link
Author

MrGlox commented Aug 12, 2020

Yes I added this code to my .eslintrc

{
  ...,
  ignorePatterns: ["sync-requires.js", "**/_this_is_virtual_fs_path_/**/*.js"]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: webpack/babel Webpack or babel type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants