netlify / netlify-plugin-gatsby

A build plugin to integrate Gatsby seamlessly with Netlify

Home Page:https://www.npmjs.com/package/@netlify/plugin-gatsby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plugin does not work for monorepo

Simply007 opened this issue · comments

Description

There is a Gatsby Kontent packages monorepo containing a development site + a couple of examples. As a part of kontent-ai/gatsby-packages#202 I wanted to use this plugin instead deprecated Gatsby Cache plugin.

Steps to reproduce

  • Fork the repository
  • Register the repo to Netlify with its config (you can substitute dsg-ssr, with navigation/relationships/resolution)
    • Build command yarn build:dsg-ssr
    • Publish directory /examples/dsg-ssr/public
  • Install this plugin

The build failed on (error from example dsg-ssr, but the same if on all examples):

12:07:02 PM: ────────────────────────────────────────────────────────────────
12:07:02 PM:   Dependencies installation error                               
12:07:02 PM: ────────────────────────────────────────────────────────────────
12:07:02 PM: ​
12:07:02 PM:   Error message
12:07:02 PM:   A Netlify Function failed to require one of its dependencies.
12:07:02 PM:   Please make sure it is present in the site's top-level "package.json".
​
12:07:02 PM:   In file "/opt/build/repo/.netlify/functions-internal/__api/__api.js"
12:07:02 PM:   Cannot find module '../../../.cache/functions/manifest.json' from '/opt/build/repo/.netlify/functions-internal/__api'
12:07:02 PM: ​
12:07:02 PM:   Resolved config
12:07:02 PM:   build:
12:07:02 PM:     command: yarn build:dsg-ssr
12:07:02 PM:     commandOrigin: ui
12:07:02 PM:     environment:
12:07:02 PM:       - NODE_VERSION
12:07:02 PM:     publish: /opt/build/repo/examples/dsg-ssr/public
12:07:02 PM:     publishOrigin: ui
12:07:02 PM:   functions:
12:07:02 PM:     __api:
12:07:02 PM:       external_node_modules:
12:07:02 PM:         - msgpackr-extract
12:07:02 PM:       included_files:
12:07:02 PM:         - examples/dsg-ssr/.cache/functions/**

Expected behavior

Build does not fail and DSG and SSG work.

Environment

I might be able to share the netlify project, if you need.

Thanks @Simply007 . I have a decent idea what's causing this, and hopefully can fix it later this week.

Thanks @Simply007 . I have a decent idea what's causing this, and hopefully can fix it later this week.

That would be great! :) If you need me to test out something, let me know.

Thx for taking a look at the issue @ascorbic! What are the plans for releasing the new version?