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

gatsby-plugin-mdx 2.5.x breaks npm gatsby init when mdx file added #31392

Closed
ThePuug opened this issue May 12, 2021 · 1 comment · Fixed by #31396
Closed

gatsby-plugin-mdx 2.5.x breaks npm gatsby init when mdx file added #31392

ThePuug opened this issue May 12, 2021 · 1 comment · Fixed by #31396
Assignees
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. type: bug An issue or pull request relating to a bug in Gatsby

Comments

@ThePuug
Copy link

ThePuug commented May 12, 2021

Description

gatsby-plugin-mdx 2.5.x breaks just init'd gatsby site (even on gatsby 3.x)

Steps to reproduce

npm gatbsy init

use default config, except to select markdown with MDX support

(note: powershell)

cd my-gatsby-site/src/pages
echo "#test" | ac page-2.mdx
gatsby develop

rolling back gatsby-plugin-mdx gets expected result

npm install gatsby-plugin-mdx@~2.4.0
gatsby develop

Expected result

You can now view my-gatsby-site in the browser.

Actual result

 ERROR #98124  WEBPACK

Generating development JavaScript bundle failed

Can't resolve '/srcpagespage-2.mdx?type=component' in 'C:\Users\reedd\repos\my-gatsby-site\src\pages'

If you're trying to use a package make sure that '/srcpagespage-2.mdx?type=component' is installed. If you're trying to
use a local file make sure that the path is correct.

File: src\pages\page-2.mdx:4:0

failed Building development bundle - 6.759s
ERROR in ./src/pages/page-2.mdx 4:0-62
Module not found: Error: Can't resolve '/srcpagespage-2.mdx?type=component' in
'C:\Users\reedd\repos\my-gatsby-site\src\pages'
 @ ./.cache/_this_is_virtual_fs_path_/$virtual/async-requires.js 26:11-28:5
 @ ./.cache/app.js 17:0-52 30:0-86 32:27-40 30:0-86

webpack compiled with 1 error

Environment

  System:
    OS: Windows 10 10.0.19041
    CPU: (4) x64 Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
  Binaries:
    Node: 14.16.1 - C:\Program Files\nodejs\node.EXE
    npm: 6.14.12 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 3.9.4
  Browsers:
    Chrome: 90.0.4430.93
    Edge: Spartan (44.19041.964.0), Chromium (90.0.818.56)
  npmPackages:
    gatsby: ^3.4.1 => 3.5.0
    gatsby-plugin-mdx: ^2.5.0 => 2.5.0
    gatsby-source-filesystem: ^3.5.0 => 3.5.0
  npmGlobalPackages:
    gatsby-cli: 3.4.0
@ThePuug ThePuug added the type: bug An issue or pull request relating to a bug in Gatsby label May 12, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label May 12, 2021
@pieh pieh self-assigned this May 12, 2021
@LekoArts LekoArts added topic: MDX and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels May 12, 2021
@LekoArts
Copy link
Contributor

Thanks. This seems to be an issue only on Windows

@pieh pieh added the status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. label May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: confirmed Issue with steps to reproduce the bug that’s been verified by at least one reviewer. 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.

3 participants