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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import from 'classnames' broken since v2.5.0 #358

Closed
marneau opened this issue Jan 5, 2024 · 5 comments
Closed

Import from 'classnames' broken since v2.5.0 #358

marneau opened this issue Jan 5, 2024 · 5 comments
Labels

Comments

@marneau
Copy link

marneau commented Jan 5, 2024

Hello 馃憢 We are using classnames into our project and we have just made an upgrade from v2.3.2 to v2.5.1 - we are facing the following issue:

./node_modules/classnames/index.js
Module parse failed: Cannot use 'import.meta' outside a module

After investigation, it seems to be coming directly from the module import which we are importing the following way:

import cx from 'classnames'

It is also happening on v2.5.0 but not v2.4.0.

After having a quick look around at recently merged PRs, I have a hunch it could be coming from the type being moved to 'commonjs' instead of a 'module' but as I said, this is just a wild guess :)

Would you be able to advise on this by any chance?

@jonkoops jonkoops added the bug label Jan 6, 2024
@jonkoops
Copy link
Collaborator

jonkoops commented Jan 6, 2024

Can you provide a little more information about how to reproduce this issue? What runtime are you using? What version of said runtime? Please provide a minimal an reproducible piece of example code.

@jonkoops
Copy link
Collaborator

jonkoops commented Jan 8, 2024

Closing this for a lack of information to reproduce the issue, if you have a reproducible case let us know.

@jonkoops jonkoops closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2024
@luketheobscure
Copy link

In case anyone else comes across this issue - we saw the same error message in our Next.js app after bumping a dependency that depended on classnames 2.5.x. The main package.json depended on classnames 2.3.x. Bumping the main dependency to match the subdependency fixed the issue.

@kingsley-sunny
Copy link

Can you provide a little more information about how to reproduce this issue? What runtime are you using? What version of said runtime? Please provide a minimal an reproducible piece of example code.

This is happening to me in next.js, I am using ant-design which depends on classnames, and I noticed that it was the classnames that caused this error

@jonkoops
Copy link
Collaborator

@kingsley-sunny if you have a reproducible case please file a new issue with minimal steps to reproduce.

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

No branches or pull requests

4 participants