question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Netlify Identity Widget is being loaded on all pages in production

See original GitHub issue

Description

Netlify Identity Widget is being loaded on the index page in production. This makes user to load unnecessary 50kb of js.

Steps to reproduce

  1. Add gatsby-plugin-netlify-cms to gatsby project
  2. npm run build
  3. npm run serve
  4. Check network tab

Expected result

Netlify Identity Widget should be loaded only on the /admin page

Actual result

Netlify Identity Widget is being loaded on all pages in production

Environment

System: OS: macOS Mojave 10.14 CPU: (4) x64 Intel® Core™ i7-5557U CPU @ 3.10GHz Shell: 5.3 - /bin/zsh Binaries: Node: 11.15.0 - /usr/local/bin/node Yarn: 1.21.1 - /usr/local/bin/yarn npm: 6.7.0 - /usr/local/bin/npm Languages: Python: 2.7.10 - /usr/bin/python Browsers: Chrome: 79.0.3945.130 Firefox: 72.0.1 Safari: 12.0 npmPackages: gatsby: 2.19.10 => 2.19.10 gatsby-image: 2.2.39 => 2.2.39 gatsby-plugin-netlify: 2.1.31 => 2.1.31 gatsby-plugin-netlify-cms: 4.1.37 => 4.1.37 gatsby-plugin-netlify-cms-paths: 1.3.0 => 1.3.0 gatsby-plugin-postcss: 2.1.19 => 2.1.19 gatsby-plugin-preact: 3.1.25 => 3.1.25 gatsby-plugin-react-helmet: 3.1.21 => 3.1.21 gatsby-plugin-sharp: 2.4.4 => 2.4.4 gatsby-plugin-svgr: 2.0.2 => 2.0.2 gatsby-plugin-typescript: 2.1.26 => 2.1.26 gatsby-plugin-webpack-bundle-analyzer: 1.0.5 => 1.0.5 gatsby-source-filesystem: 2.1.47 => 2.1.47 gatsby-source-hubspot: 2.0.3 => 2.0.3 gatsby-transformer-sharp: 2.3.13 => 2.3.13 gatsby-transformer-yaml: 2.2.23 => 2.2.23 npmGlobalPackages: gatsby-cli: 2.7.34

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
smashercosmocommented, Feb 3, 2020

Maybe worth adding this advice to the docs

0reactions
abdullahecommented, Nov 1, 2020

This section was recently added to the readme: https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-netlify-cms#disable-widget-on-site

Hi. I don’t know if it is better to open a new issue but trying what @erezrokah suggested above. When I try this, I see a blank page at /admin.

Here is the gatsby-config.js part:

{
      resolve: `gatsby-plugin-netlify-cms`,
      options: {
        modulePath: `${__dirname}/src/cms/cms.js`,
        enableIdentityWidget: true,
        includeRobots: false,
        publicPath: `admin`,
      },
 },

And here is the gatsby-node.js part:

const webpack = require(`webpack`);

exports.onCreateWebpackConfig = ({ actions }) => {
  actions.setWebpackConfig({
    plugins: [
      new webpack.IgnorePlugin({
        resourceRegExp: /^netlify-identity-widget$/,
      }),
    ],
  });
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

Weird behavior by netlify-identity-widget and role based ...
Build process: I am using 11ty to build static pages and with a eleventyConfig.addPassthroughCopy('./_site/_redirects'); directive. Widget:
Read more >
Netlify Identity redirects me to my production URL when I log ...
This works because the Netlify Identity Widget looks for that information in the URL on page load. This same trick also works for...
Read more >
Fixing the Netlify Identity Widget when it prevents clicks after ...
The netlify identity widget overlays the entire page with an iframe. this can cause the application to not receive click events.
Read more >
How to use Netlify Identity and Netlify Functions ... - YouTube
Questions? Comments? Discuss this on Twitter: http://bit.ly/2EUtHhiWant to add authentication and dynamic actions to your Gatsby sites with ...
Read more >
gatsby-plugin-netlify-cms
html with a default Netlify CMS implementation. Netlify CMS is a React single page app for editing git based content via API. Its...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found