Skip to content

Uncaught TypeError: Failed to set an indexed property [0] on 'CSSStyleDeclaration': Indexed property setter is not supported. #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Zsl8 opened this issue Apr 3, 2025 · 4 comments

Comments

@Zsl8
Copy link

Zsl8 commented Apr 3, 2025

idk what is happening and why i'm getting this in the BlurText component it seems like the problem is in the springs styles

<p
      ref={ref}
      className={className}
      style={{ display: 'flex', flexWrap: 'wrap' }}
    >
      {springs.map((props, index) => (
        <AnimatedSpan
          key={index}
          style={{
            ...props,
            display: 'inline-block',
            willChange: 'transform, filter, opacity',
          } as unknown as { [key: string]: SpringValue<string | number> }}
        >
          {elements[index] === ' ' ? '\u00A0' : elements[index]}
          {animateBy === 'words' && index < elements.length - 1 && '\u00A0'}
        </AnimatedSpan>
      ))}
    </p>

i tried to debug the problem but didn't get any good results the styles are pefrect and nothing is wrong with them

@DavidHDev
Copy link
Owner

Incomplete issue, not enough details. You need to provide details such your component usage, your React version, the full error message, a proper title. Otherwise you can't expect to get help for this.

@Zsl8
Copy link
Author

Zsl8 commented Apr 3, 2025

Image

react version is 19 and this is how i'm using it

<BlurText
  text="Isn't this so cool?!"
  delay={150}
  animateBy="letters"
  direction="top"
  onAnimationComplete={() => console.log('Animation complete')}
/>

@TristanLavalou
Copy link

TristanLavalou commented Apr 7, 2025

Hello @DavidHDev, I'm facing this issue too using the BlurText component.

I'm using it as proposed on the website, without modifying anything. The component is used below a MaterialUI theme, one div and a MUI box. Here is an extract :

  return (
    <ThemeProvider theme={theme}>
      <div className='content'>
          <Box>
            <BlurText
              text="Sample"
              delay={150}
              animateBy="words"
              direction="top"
              onAnimationComplete={handleAnimationComplete}
              className="text-2xl mb-8"
            />
          </Box>
      </div>
    </ThemeProvider>

My project is using React v18.3.1 and Typescript v5.6.2.

Note that it seems to be specific on this component, cause SplitText is currently working in my project.
After some investigations, error is about props structure type in AnimatedSpan style prop.

Glad to help you if you need more details on this bug.

@Zsl8
Copy link
Author

Zsl8 commented Apr 7, 2025

I remade the component using different library but with less options if you are interested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants