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

Using with import in rollup file not working because of the type: "module" #3

Open
AMontagu opened this issue Jul 25, 2022 · 4 comments

Comments

@AMontagu
Copy link

Trying to use this package in a rollup config file as:

import pascalcase from 'pascalcase';

But then this error happen:

[!] Error: While loading the Rollup configuration from "build/rollup.config.js", Node tried to require an ES module from a CommonJS file, which is not supported. A common cause is if there is a package.json file with "type": "module" in the same folder. You can try to fix this by changing the extension of your configuration file to ".cjs" or ".mjs" depending on the content, which will prevent Rollup from trying to preprocess the file but rather hand it to Node directly.
@y-nk
Copy link

y-nk commented Apr 16, 2024

same here. not sure how to handle that. anybody has a workaround in the meantime?

@AMontagu
Copy link
Author

The code is really small. Even if not ideal just copy paste it in your project: https://github.com/jonschlinkert/pascalcase/blob/master/index.js

@y-nk
Copy link

y-nk commented Apr 19, 2024

@AMontagu indeed it can be almost a oneliner but still... i thought i could use this package. well 🤷

@AMontagu
Copy link
Author

I thought too... But I think it's the best workaround or finding another package...

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

2 participants