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

mdx 1.2.32 to 1.2.33 breaks because babel has new api requirements #26446

Closed
cescoferraro opened this issue Aug 13, 2020 · 4 comments · Fixed by #27305
Closed

mdx 1.2.32 to 1.2.33 breaks because babel has new api requirements #26446

cescoferraro opened this issue Aug 13, 2020 · 4 comments · Fixed by #27305
Labels
stale? Issue that may be closed soon due to the original author not responding any more. type: question or discussion Issue discussing or asking a question about Gatsby

Comments

@cescoferraro
Copy link

cescoferraro commented Aug 13, 2020

Summary

yarn add --exact gatsby-plugin-mdx@1.2.32 works fine
yarn add --exact gatsby-plugin-mdx@1.2.33/34 breaks

Relevant information

https://github.com/agenciaglobal/web

warn Module build failed (from ./node_modules/gatsby-plugin-mdx/loaders/mdx-loader.js):
Error: [BABEL] unknown: Preset /* your preset */ requires a filename to be set when babel is called directly,

babel.transform(code, { filename: 'file.ts', presets: [/* your preset */] });

See https://babeljs.io/docs/en/options#filename for more information.
    at validateIfOptionNeedsFilename (/Users/cescoferraro/go/src/github.com/agenciaglobal/web/node_modules/@babel/core/lib/config/full.js:274:11)
    at /Users/cescoferraro/go/src/github.com/agenciaglobal/web/node_modules/@babel/core/lib/config/full.js:286:52
    at Array.forEach (<anonymous>)
    at validatePreset (/Users/cescoferraro/go/src/github.com/agenciaglobal/web/node_modules/@babel/core/lib/config/full.js:286:25)
    at loadPresetDescriptor (/Users/cescoferraro/go/src/github.com/agenciaglobal/web/node_modules/@babel/core/lib/config/full.js:293:3)
    at loadPresetDescriptor.next (<anonymous>)
    at recurseDescriptors (/Users/cescoferraro/go/src/github.com/agenciaglobal/web/node_modules/@babel/core/lib/config/full.js:107:30)
    at recurseDescriptors.next (<anonymous>)
    at loadFullConfig (/Users/cescoferraro/go/src/github.com/agenciaglobal/web/node_modules/@babel/core/lib/config/full.js:142:6)
    at loadFullConfig.next (<anonymous>)
    at Function.transform (/Users/cescoferraro/go/src/github.com/agenciaglobal/web/node_modules/@babel/core/lib/transform.js:25:45)
    at transform.next (<anonymous>)
    at evaluateSync (/Users/cescoferraro/go/src/github.com/agenciaglobal/web/node_modules/gensync/index.js:244:28)
    at Function.sync (/Users/cescoferraro/go/src/github.com/agenciaglobal/web/node_modules/gensync/index.js:84:14)
    at Object.transform (/Users/cescoferraro/go/src/github.com/agenciaglobal/web/node_modules/@babel/core/lib/transform.js:36:54)
    at module.exports (/Users/cescoferraro/go/src/github.com/agenciaglobal/web/node_modules/gatsby-plugin-mdx/utils/extract-exports.js:9:9)`
<!-- Provide as much useful information as you can -->

Environment (if relevant)

File contents (if changed)

https://github.com/agenciaglobal/web/blob/master/babel.config.js
gatsby-config.js: N/A
https://github.com/agenciaglobal/web/blob/master/gatsby-config.js
package.json: N/A
https://github.com/agenciaglobal/web/blob/master/package.json
gatsby-node.js: N/A
https://github.com/agenciaglobal/web/blob/master/gatsby-node.js
gatsby-browser.js: N/A
https://github.com/agenciaglobal/web/blob/master/gatsby-browser.js
gatsby-ssr.js: N/A

@cescoferraro cescoferraro added the type: question or discussion Issue discussing or asking a question about Gatsby label Aug 13, 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 13, 2020
@vladar vladar added topic: MDX and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Aug 14, 2020
@vladar
Copy link
Contributor

vladar commented Aug 14, 2020

@pvdz Can something like this be caused by recent MDX updates?

@pvdz
Copy link
Contributor

pvdz commented Aug 15, 2020

Anything is possible :) I check into this next week.

@github-actions
Copy link

github-actions bot commented Sep 4, 2020

Hiya!

This issue has gone quiet. Spooky quiet. 👻

We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 💪💜

@github-actions github-actions bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Sep 4, 2020
@pvdz
Copy link
Contributor

pvdz commented Oct 6, 2020

Had to drop the yarn.lock and some other things to reproduce your error.

The problem appears to be caused by a "new" requirement by Babel, which requires a filename property (as per the error).

I'll merge and publish a fix soon. Meanwhile you can unblock yourself by going into node_modules/gatsby-plugin-mdx/utils/extract-exports.js and adding a filename field with any value to the call to babel.transform.

Note that afterwards your build produces a bunch of different errors of this kind:

./node_modules/browserslist/node.js 161:26-33
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted

But I believe this is unrelated to mdx. If this is turns out to be a bug in Gatsby please open a new issue for it.

Thank you for reporting the issue 💜

@pvdz pvdz changed the title migration from 1.2.32 to 1.2.33 breaks app mdx 1.2.32 to 1.2.33 breaks because babel has new api requirements Oct 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale? Issue that may be closed soon due to the original author not responding any more. type: question or discussion Issue discussing or asking a question about Gatsby
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants