njosefbeck / gatsby-source-stripe

Gatsby source plugin for building websites using Stripe as a data source
74 stars 17 forks source link

'Unable to find plugin' After 2.20 Update #28

Closed brxck closed 5 years ago

brxck commented 5 years ago

I just updated to the newest release, but I'm running into this error on develop/build:

error Unable to find plugin "gatsby-source-stripe". Perhaps you need to install its package?

I checked and the plugin is indeed in my node_modules. I've also tried deleting node_modules & package-lock.json and then reinstalling.

Same deal on both projects I tested.

@njosefbeck Looks like the publishing setup changed, maybe something's not quite right?

Versions

os: Linux / Solus 4 node: 10.11.0 npm: 6.5.0 gatsby: 2.5.7 gatsby-source-stripe: 2.2.0

njosefbeck commented 5 years ago

Let me take a look!

njosefbeck commented 5 years ago

This is fixed! Apparently it's required to have an index.js file in the root of the plugin, even if it's empty. I've tested locally, but if you wouldn't mind updating to the new version (2.2.1) of the plugin and re-testing, it'd be much appreciated @brxck! Thanks!

brxck commented 5 years ago

Okay that cleared it up!

Running into another error:

Error: Cannot find module './StripeObject'

Looks like a capitalization issue, the file's now named stripeObject.js. I looked back and I guess the old build process used to capitalize the file?

EDIT: Okay, just pushed the smallest commit to fix this as well. With that change, everything is working :tada:

njosefbeck commented 5 years ago

Hmm, so I didn't run into that error myself. The file used to be capitalized but it isn't anymore. Have you tried deleting your node_modules and package-lock.json and doing a fresh npm install? Once you do that, if you look at gatsby-source-stripe in node_modules, is your file structure the same as below?

Screen Shot 2019-04-13 at 1 05 35 PM
njosefbeck commented 5 years ago

Oh just saw your edit! Was it that way in the latest version you get from NPM? Or in a local version you have in a plugins dir?

brxck commented 5 years ago

Yeah it was that way in the latest, even with a fresh install :thinking:

njosefbeck commented 5 years ago

Oh yeah, that's a bug then! I'll pull down your change and publish that to NPM then! Thanks!

njosefbeck commented 5 years ago

OK pushed up and published 2.2.2. Let me know if you encounter any further errors!

brxck commented 5 years ago

New version is working great, thanks!