Skip to content
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

swcMinify breaks build with react-text-transition package #35074

Closed
1 task done
ch3rn1k opened this issue Mar 5, 2022 · 3 comments
Closed
1 task done

swcMinify breaks build with react-text-transition package #35074

ch3rn1k opened this issue Mar 5, 2022 · 3 comments
Assignees

Comments

@ch3rn1k
Copy link

ch3rn1k commented Mar 5, 2022

Verify canary release

  • I verified that the issue exists in Next.js canary release

Provide environment information

Operating System:
Platform: darwin
Arch: x64
Version: Darwin Kernel Version 21.4.0: Sat Jan 29 03:25:23 PST 2022; root:xnu-8020.100.417.0.4~31/RELEASE_X86_64
Binaries:
Node: 14.17.0
npm: 8.5.2
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.1.0
react: 17.0.2
react-dom: 17.0.2

What browser are you using? (if relevant)

Chrome 98.0.4758.109

How are you deploying your application? (if relevant)

next start

Describe the Bug

When using swcMinify: true with package react-text-transition - it breaks application.

Expected Behavior

Working build

To Reproduce

import { useState, useEffect } from 'react';
import TextTransition, { presets } from 'react-text-transition';

const titleTexts = ['Test', 'Test2', 'Test3', 'Test4', 'Test5'];

const Example = () => {
  const [index, setIndex] = useState(0);

  useEffect(() => {
    const intervalId = setInterval(() => setIndex((index) => index + 1), 1 * 3000);

    return () => clearTimeout(intervalId);
  }, []);

  return (
    <TextTransition
      text={titleTexts[index % titleTexts.length]}
      springConfig={presets.gentle}
      inline={true}
    />
  );
};


export default Example;
@ch3rn1k ch3rn1k added the bug Issue was opened via the bug report template. label Mar 5, 2022
@balazsorban44
Copy link
Member

Thanks, I could reproduce. Created a small reproduction repository: https://github.com/balazsorban44/nextjs-35074

@balazsorban44 balazsorban44 added area: SWC Minify and removed bug Issue was opened via the bug report template. labels Mar 5, 2022
@kdy1 kdy1 assigned kdy1 and unassigned kdy1 Apr 15, 2022
@kdy1 kdy1 self-assigned this Apr 15, 2022
@kdy1
Copy link
Member

kdy1 commented Apr 17, 2022

This is fixed by #36187

I made a mistake while reproducing this and thought it was not fixed.

I made a correct repro script (https://github.com/swc-project/swc/blob/2563c7f8ff5bb86131f642b6cca948955d795820/crates/swc_ecma_minifier/scripts/next/start.sh) and I found that this issue is fixed.

@kdy1 kdy1 closed this as completed Apr 17, 2022
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants