gatsby-plugin-pnpm icon indicating copy to clipboard operation
gatsby-plugin-pnpm copied to clipboard

Gatsby 5

Open 383bd03d opened this issue 2 years ago • 10 comments

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

383bd03d avatar Jan 07 '23 16:01 383bd03d

@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?

lnhrdt avatar Feb 13 '23 16:02 lnhrdt

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).

darylwright avatar Mar 12 '23 01:03 darylwright

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.

Amit0617 avatar Mar 12 '23 05:03 Amit0617

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.

darylwright avatar Mar 12 '23 19:03 darylwright

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.

Amit0617 avatar Mar 13 '23 14:03 Amit0617

Any traction here? @Js-Brecht ? Could you publish a new version to the npm store?

arsinclair avatar May 09 '23 06:05 arsinclair

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.

rafalkrupinski avatar Jul 25 '23 22:07 rafalkrupinski

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.

arsinclair avatar Jul 26 '23 07:07 arsinclair

any updates on making this package compatible with Gatxby 5 ? :)

YKalashnikov avatar Jul 30 '23 04:07 YKalashnikov

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

kevinstubbs avatar Sep 06 '23 14:09 kevinstubbs