gatsby-plugin-pnpm
gatsby-plugin-pnpm copied to clipboard
Gatsby 5
warn Plugin gatsby-plugin-pnpm is not compatible with your gatsby version 5.3.3 - It requires gatsby@~2.x.x || ~3.x.x || ~4.x.x
@Js-Brecht I saw that you merged #16 a couple months ago. Any chance of getting a new release soon that includes that PR to support Gatsby 5?
It seems like this project could benefit from using semantic-release and therefore converting to conventional commits. That last commit to master should have been a release. The existing tag name format is already compatible and it wouldn't take much to add a semantic-release job to the master.yml workflow (Edit: in addition to some configuration in package.json, which is also trivial).
Yes actually it only needs to be built and published.
I made a clone of it, built it manually and published for myself as npm was failing due to dependency conflicts.
Here is the cloned repo. For obvious reasons, I can't publish it with same name and hence it can be found as gatsby-plugin-pnpm-gatsby-5 on npm.
This plugin isn't quite ready for Gatsby v5. I discovered this after hours of fighting with manual MDX page generation. Consider the following code in gatsby-node.ts:
posts.forEach((post: Queries.MdxNodeFieldsFragment) => {
createPage({
path: post.node.fields.slug,
context: {
id: post.node.id,
},
component: `${contentTemplate}?__contentFilePath=${post.node.internal.contentFilePath}`,
});
});
When using pnpm as my package manager, the MDX on my pages doesn't render with the contentTemplate layout. The MDX can render with component: post.node.internal.contentFilePath but it does so without the layout. The layout is also able to render on its own but without the MDX content.
My last resort to getting this issue resolved was to switch back to yarn by deleting my node_modules folder, deleting pnpm-lock.yaml, commenting out gatsby-plugin-pnpm in gatsby-config.ts, and reinstalling all my packages with yarn. This worked.
There is something wrong with this plugin that prevents Gatsby from grabbing the MDX content in the createPage API function. I have also encountered the exact same issue when using the File System Route API.
I'll be sticking to yarn for now and may investigate this issue further when I have the time, as I'd prefer to switch to pnpm.
Edit: I just realized I haven't tried configuring the plugin with strict: false. I'll give this a try and see if this works.
Edit2: strict: false doesn't work and neither does adding MDX packages to the include option. That's it for potential quick fixes.
I doubt you are looking at wrong plugin for your problems. It is just for resolving node modules, which are created as symlinks by pnpm for webpack. Nothing else.
Any traction here? @Js-Brecht ? Could you publish a new version to the npm store?
Does this help? https://www.npmjs.com/package/gatsby-plugin-pnpm-gatsby-5 looks like the latest version was ~accidentally~ published ~under another name~ by someone.
Hmm, looks fishy, since it still points to this repo. Either someone forgot, or intentionally didn't update the meta-information in the package.json, but I'm unable to find from which repository the gatsby-plugin-pnpm-gatsby-5 is originating.
any updates on making this package compatible with Gatxby 5 ? :)
Hmm, looks fishy, since it still points to this repo. Either someone forgot, or intentionally didn't update the meta-information in the package.json, but I'm unable to find from which repository the gatsby-plugin-pnpm-gatsby-5 is originating. @arinsclair
@Amit0617 who published that gatsby 5 compatible package has noted earlier in this thread, the repo can be found at https://github.com/amit0617/gatsby-plugin-pnpm