Open shivamjjha opened 1 year ago
https://www.npmjs.com/package/nprogress#template
To keep the progress bar working, keep an element with role='bar' in there
@r1zyn I changed my conig to:
NProgress.configure({
showSpinner: false,
barSelector: styles.bar,
template: `
<div className=${styles.bar} role='bar'>
<div className=${styles.peg}></div>
</div>
<div className=${styles.spinner} role='spinner'>
<div className=${styles['spinner-icon']}></div>
</div>
`,
parent: styles['nprogress-custom-parent'],
spinnerSelector: styles.spinner
})
Still it shows error:
nprogress.js?5707:397
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'style')
at applyCss (nprogress.js?5707:397:1)
at eval (nprogress.js?5707:408:1)
at NProgress.render (nprogress.js?5707:233:1)
at NProgress.set (nprogress.js?5707:70:1)
at NProgress.inc (nprogress.js?5707:170:1)
at NProgress.done (nprogress.js?5707:152:1)
at eval (ProgressBar.tsx?8ff9:34:9)
at startTransition (react-dom.development.js?ac89:17332:1)
at routeChangeEnd (ProgressBar.tsx?8ff9:33:7)
at eval (mitt.js?851d:19:17)
at Array.map (<anonymous>)
at Object.emit (mitt.js?851d:18:39)
at eval (router.js?8684:950:39)
at Generator.next (<anonymous>)
at asyncGeneratorStep (_async_to_generator.js?0e30:23:1)
at _next (_async_to_generator.js?0e30:12:1)
I am using nprogress in a ProgressBar component with jsx.
However, when I try to replace it with my own CSS module, it gives error
My component:
CSS file (
ProgressBar.module.css
)The error thrown:
Error occurs in this function: