Trouble w/ netlify deploy on build. Error: invalid netlify instance URL: undefined

Hello,

I’m having trouble w/ a failing build that may be related to me adding netlify identity.

If possible, could you point me in the proper direction regarding what needs fixing?

I tried googling for the error message and ran through a few stack overflow articles but they didn’t seem to pertain to my trouble.

Any guidance would be greatly appreciated.

Deploy URL:
https://app.netlify.com/sites/taoistprogrammer/deploys/5f245597582c6e01c034c359

Thank you for your time!

10:36:09 AM: error gatsby-plugin-mdx
10:36:09 AM: Error: invalid netlify instance URL: undefined. Please check the docs for proper usage or file an issue.
10:36:09 AM:     at f (evalmachine.<anonymous>:12348:851)
10:36:09 AM:     at d (evalmachine.<anonymous>:11089:498)
10:36:09 AM:     at $a (evalmachine.<anonymous>:11092:16)
10:36:09 AM:     at a.b.render (evalmachine.<anonymous>:11097:476)
10:36:09 AM:     at a.b.read (evalmachine.<anonymous>:11097:18)
10:36:09 AM:     at renderToStaticMarkup (evalmachine.<anonymous>:11107:462)
10:36:09 AM:     at ./node_modules/gatsby-plugin-mdx/utils/wrap-root-render-html-entry.js.__webpack_exports__.default.body (evalmachine.<anonymous>:6241:511)
10:36:09 AM:     at keys.map (/opt/build/repo/node_modules/gatsby-plugin-mdx/utils/render-html.js:157:23)
10:36:09 AM:     at Array.map (<anonymous>)
10:36:09 AM:     at compiler.run (/opt/build/repo/node_modules/gatsby-plugin-mdx/utils/render-html.js:155:22)
10:36:09 AM: /opt/build/repo/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
10:36:09 AM:         throw ex;
10:36:09 AM:         ^
10:36:09 AM: Error: invalid netlify instance URL: undefined. Please check the docs for proper usage or file an issue.
10:36:09 AM:     at f (evalmachine.<anonymous>:12348:851)
10:36:09 AM:     at d (evalmachine.<anonymous>:11089:498)
10:36:09 AM:     at $a (evalmachine.<anonymous>:11092:16)
10:36:09 AM:     at a.b.render (evalmachine.<anonymous>:11097:476)
10:36:09 AM:     at a.b.read (evalmachine.<anonymous>:11097:18)
10:36:09 AM:     at renderToStaticMarkup (evalmachine.<anonymous>:11107:462)
10:36:09 AM:     at ./node_modules/gatsby-plugin-mdx/utils/wrap-root-render-html-entry.js.__webpack_exports__.default.body (evalmachine.<anonymous>:6241:511)
10:36:09 AM:     at keys.map (/opt/build/repo/node_modules/gatsby-plugin-mdx/utils/render-html.js:157:23)
10:36:09 AM:     at Array.map (<anonymous>)
10:36:09 AM:     at compiler.run (/opt/build/repo/node_modules/gatsby-plugin-mdx/utils/render-html.js:155:22)
10:36:10 AM: ​
10:36:10 AM: ┌─────────────────────────────┐
10:36:10 AM: │   "build.command" failed    │
10:36:10 AM: └─────────────────────────────┘
10:36:10 AM: ​
10:36:10 AM:   Error message
10:36:10 AM:   Command failed with exit code 7: gatsby build
10:36:10 AM: ​
10:36:10 AM:   Error location
10:36:10 AM:   In Build command from Netlify app:
10:36:10 AM:   gatsby build
10:36:10 AM: ​
10:36:10 AM:   Resolved config
10:36:10 AM:   build:
10:36:10 AM:     command: gatsby build
10:36:10 AM:     commandOrigin: ui
10:36:10 AM:     environment:
10:36:10 AM:       - REVIEW_ID
10:36:10 AM:     publish: /opt/build/repo/public
10:36:10 AM: Caching artifacts

Not too sure - that seems to be somewhere in the internals of Gatsby, @brandonperfetti , rather than in our system. So my question to you is: Does your build work locally? That’s always a good first step :slight_smile:

Thanks for the reply!

It’s looking like things are and are not working locally.

Some background.

I’m attempting to implement this Gatsby theme:

Here’s how I’ve configured the plugin in gatsby-config.js

   {
      resolve: `gatsby-plugin-netlify-identity`,
      options: {
        url: `https://taoistprogrammer.com`, // required!
      },
    },

When I run Gatsby develop things look to function properly. (Note that my google and GitHub integrations are loading - which tells me my identity url is prob configured appropriately)

However, when I run Gatsby build things break down.

Note the error:

gatsby-plugin-mdx
Error: invalid netlify instance URL: undefined. Please check the docs for proper usage or file an issue.

I get the output below:

➜  taoist-programmer git:(bp-netlify-identity) ✗ gatsby build
success open and validate gatsby-configs - 0.107s
success load plugins - 1.032s
success onPreInit - 0.010s
success delete html and css files from previous builds - 0.024s
success initialize cache - 0.009s
success copy gatsby files - 0.069s
success onPreBootstrap - 0.031s
success createSchemaCustomization - 0.147s
success Checking for changed pages - 0.004s
success source and transform nodes - 1.053s
success building schema - 0.996s
{ local: true }

Config rootPath /


Config basePath /


Config authorsPath /authors


Querying Authors & Articles source: Local


Creating articles page


Creating article posts


Creating authors page

success createPages - 0.963s
success Checking for changed pages - 0.001s
success createPagesStatefully - 0.132s
success update schema - 0.462s
success onPreExtractQueries - 0.002s
success extract queries from components - 1.368s
success write out redirect data - 0.005s
success Build manifest and related icons - 0.155s
success onPostBootstrap - 0.160s
info bootstrap finished - 11.167s
success run page queries - 0.039s - 16/16 413.83/s
success write out requires - 0.005s
success Building production JavaScript and CSS bundles - 9.685s
[                            ]   0.009 s 0/16 0% Building static HTML for pages
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":false}}}
{"isConfirmedUser":false,"isLoggedIn":false,"authedFetch":{},"_goTrueInstance":{"setCookie":true,"api":{"apiURL":"https://taoistprogrammer.com/.netlify/identity","_sameOrigin":true,"defaultHeaders":{}}},"_url":"https://taoistprogrammer.com","settings":{"autoconfirm":false,"disable_signup":false,"external":{"bitbucket":false,"email":true,"facebook":false,"github":false,"gitlab":false,"google":falsesuccess Building static HTML for pages - 5.125s - 16/16 3.12/s
info Generated public/sw.js, which will precache 9 files, totaling 513805 bytes.
The following pages will be precached:
/offline-plugin-app-shell-fallback/index.html

 ERROR

gatsby-plugin-mdx
Error: invalid netlify instance URL: undefined. Please check the docs for proper usage or file an issue.
    at f (evalmachine.<anonymous>:12348:851)
    at d (evalmachine.<anonymous>:11089:498)
    at $a (evalmachine.<anonymous>:11092:16)
    at a.b.render (evalmachine.<anonymous>:11097:476)
    at a.b.read (evalmachine.<anonymous>:11097:18)
    at renderToStaticMarkup (evalmachine.<anonymous>:11107:462)
    at ./node_modules/gatsby-plugin-mdx/utils/wrap-root-render-html-entry.js.__webpack_exports__.default (evalmachine.<anonymous>:6241:511)
    at /Users/brandonperfetti/dev/taoist-programmer/node_modules/gatsby-plugin-mdx/utils/render-html.js:157:23
    at Array.map (<anonymous>)
    at /Users/brandonperfetti/dev/taoist-programmer/node_modules/gatsby-plugin-mdx/utils/render-html.js:155:22

⠏ onPostBuild
/Users/brandonperfetti/.nvm/versions/node/v12.16.3/lib/node_modules/gatsby-cli/node_modules/yoga-layout-prebuilt/yoga-layout/build/Release/nbind.js:53
        throw ex;
        ^

Error: invalid netlify instance URL: undefined. Please check the docs for proper usage or file an issue.
    at f (evalmachine.<anonymous>:12348:851)
    at d (evalmachine.<anonymous>:11089:498)
    at $a (evalmachine.<anonymous>:11092:16)
    at a.b.render (evalmachine.<anonymous>:11097:476)
    at a.b.read (evalmachine.<anonymous>:11097:18)
    at renderToStaticMarkup (evalmachine.<anonymous>:11107:462)
    at ./node_modules/gatsby-plugin-mdx/utils/wrap-root-render-html-entry.js.__webpack_exports__.default (evalmachine.<anonymous>:6241:511)
    at /Users/brandonperfetti/dev/taoist-programmer/node_modules/gatsby-plugin-mdx/utils/render-html.js:157:23
    at Array.map (<anonymous>)
    at /Users/brandonperfetti/dev/taoist-programmer/node_modules/gatsby-plugin-mdx/utils/render-html.js:155:22
➜  taoist-programmer git:(bp-netlify-identity) ✗

I thought I’d check in w/ y’all per the invalid netlify instance URL: undefined error.

Appreciate your help and your time!

Thanks!

Thanks for confirming!

I don’t really know how that plugin works - @jlengstorf might have some ideas, if he has time to take a look, but he might not :slight_smile:

Our official support for situations like this starts at “works locally but not on Netlify”, so you might get a good solution to this in Gatsby’s support community, where the people who wrote that plugin and are experts in its inner workings live: https://www.gatsbyjs.org/contributing/community/#where-to-get-support

Once you have things working locally, if you can’t get them working here, do let us know!

the problem appears to be that the url prop isn’t making it to the react-netlify-identity package, so my first thought is to start logging out that URL at each step in the chain (I’d do this by editing my node_modules locally) to see where it gets lost

good luck!

Many thanks for the insight. :grin:

I’ll report back when I can.

Phenomenal! Many thanks for pointing me in the right direction. :grin:

1 Like