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

@emotion/babel-plugin 11.11.x causes error: "Unexpected falsy value: undefined" #3192

Open
Nantris opened this issue May 31, 2024 · 3 comments

Comments

@Nantris
Copy link
Contributor

Nantris commented May 31, 2024

Current behavior:

Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Unexpected falsy value: undefined

To reproduce:

Unknown, but upgrading to @emotion/[email protected] is a prerequisite, as is using babel-loader in Webpack.

Expected behavior:

Upgrading from 11.10.x to 11.11.x should not cause errors.
Environment information:

  • react version: 18.2.0
  • @emotion/react version: 11.11.4
@Nantris
Copy link
Contributor Author

Nantris commented Dec 19, 2024

Same issue with 11.12.0 - I can only get the project to work if I explicitly install 11.10.8, even though simultaneously @emotion/[email protected] is installing 11.12.0 alongside it. I have no idea why this works and I'm sure it's not optimal, but this issue prevents us from upgrading to 11.12/11.13 and then #3300 prevents us from upgrading to a version where this issue seems to be resolved.

@Andarist I wonder if you have any thoughts? The problems we're seeing with Emotion are starting to compound.

@Nantris
Copy link
Contributor Author

Nantris commented Dec 19, 2024

Works fine also with Yarn resolutions setting @emotion/babel-plugin to 11.10.8 - fully excluding any later versions of @emotion/babel-plugin.

@Nantris
Copy link
Contributor Author

Nantris commented Dec 19, 2024

One last note; our config of the Babel plugin:

   const IS_DEV = api.env() === 'development';
   // ....
      [
        '@emotion',
        { sourceMap: !!IS_DEV, autoLabel: IS_DEV ? 'always' : 'never' },
      ], // MUST come first (as per Emotion docs)

I confirmed

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

No branches or pull requests

1 participant