TypeError: Cannot read property 'tagName' of null

See original GitHub issue

I created React app by using npx create-react-app i then run npm run eject to add @svgr/webpack follow the docs i changed webpack.config.js file to

{
   test: [/\.bmp$/, /\.gif$/, /\.jpe?g$/, /\.png$/, /\.svg$/],
     use: [{
         loader: '@svgr/webpack',
           options: {
              limit: imageInlineSizeLimit,
              name: 'static/media/[name].[hash:8].[ext]',
             }
          },
     {
          loader: 'url-loader'
     }]
},

NotFoundPage component

import React from 'react';
import { ReactComponent as NotFound } from '../assets/images/404.svg';
/** @jsx jsx */ import { jsx, css } from '@emotion/core';

export default function PageNotFound() {
    return <div css={{
          width: '100vw',
          height: '100vh',
          overflow: 'auto',
          display: 'flex',
          justifyContent: 'center',
          alignItems: 'center',
     }}>
         <NotFound/>;
    </div>
}

It was working perfectly at the time. Day after I back run the project again and the error is shown in the command

./src/assets/images/404.svg (./node_modules/@svgr/webpack/lib?-svgo,+titleProp,+ref!./src/assets/images/404.svg) TypeError: Cannot read property ‘tagName’ of null

Have anyone had encountered this problem? and how to fix it? Thanks in advance!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
gregbergecommented, Mar 22, 2020

Outdated issue, I am sorry but it looks like it does not affect enough people to be solved. Please takes time to fix it by opening a PR if you are affected.

3reactions
bmuenzenmeyercommented, Jan 16, 2020

also encountering this.

From reading the file-loader release notes, adding this works for me in webpack config:

            {
              loader: require.resolve('file-loader'),
              exclude: [/\.(js|mjs|jsx|ts|tsx)$/, /\.html$/, /\.json$/],
              options: {
                name: 'static/media/[name].[hash:8].[ext]',
+               esModule: false,
              },
            },

file-loader@5.0.2 @svgr/webpack@5.0.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'tagName' of null #12830 - vercel/next.js
My issue was/is relevant to how I was handling callbacks. I thought it was because of the script tag too, but it wasn't....
Read more >
Uncaught TypeError: Cannot read property 'tagName' of null
I have this error on Chrome for Linux and it was caused by the ImageBlocker extension. Since this "error" occurs for you when...
Read more >
Cannot read property 'tagName' of null throws at /jslibrary ...
When a custom event is created in a custom LWC component which is exposed in the Visualforce tab in Lightning Experience through Lightning...
Read more >
[Multilingual Component] Cannot read property 'tagName' of null
When I try to load resource from file I get the error. Cannot read property 'tagName' of null. The json file is a...
Read more >
Cannot read property 'tagName' of null" for custom events in ...
In this case, the event's 'target' property will evaluate to 'null'. Deploy these components to an org, using target lightning__RecordPage. ...
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