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

Rollup cant parse plugin that dependend on ES package #4619

Closed
ColdSpirit0 opened this issue Aug 25, 2022 · 6 comments · Fixed by #4621 or #4549
Closed

Rollup cant parse plugin that dependend on ES package #4619

ColdSpirit0 opened this issue Aug 25, 2022 · 6 comments · Fixed by #4621 or #4549

Comments

@ColdSpirit0
Copy link

Rollup Version

v2.77.2

Operating System (or Browser)

Windows 10

Node Version (if applicable)

v17.2.0

Link To Reproduction

https://github.com/ColdSpirit0/rollup-config-problem

Expected Behaviour

Plugin working

Actual Behaviour

Throws error:

[!] Error: While loading the Rollup configuration from "rollup.config.ts", 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.
https://rollupjs.org/guide/en/#using-untranspiled-config-files
    at Object.error (D:\Work\js\rollup-config-problem\node_modules\rollup\dist\shared\rollup.js:198:30)     
    at loadConfigFromBundledFile (D:\Work\js\rollup-config-problem\node_modules\rollup\dist\shared\loadConfigFile.js:637:27)
    at getDefaultFromTranspiledConfigFile (D:\Work\js\rollup-config-problem\node_modules\rollup\dist\shared\loadConfigFile.js:613:12)
    at loadConfigFile (D:\Work\js\rollup-config-problem\node_modules\rollup\dist\shared\loadConfigFile.js:572:11)
    at Object.loadAndParseConfigFile (D:\Work\js\rollup-config-problem\node_modules\rollup\dist\shared\loadConfigFile.js:552:21)
    at getConfigs (D:\Work\js\rollup-config-problem\node_modules\rollup\dist\bin\rollup:1691:39)
    at runRollup (D:\Work\js\rollup-config-problem\node_modules\rollup\dist\bin\rollup:1665:43)
@lukastaegert
Copy link
Member

Fix at #4621

@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4621 as part of rollup@3.0.0-5. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@3.0.0-5 or npm install rollup@beta. It will likely become part of a regular release later.

@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4621 as part of rollup@3.0.0-6. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@3.0.0-6 or npm install rollup@beta. It will likely become part of a regular release later.

@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4621 as part of rollup@3.0.0-7. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@3.0.0-7 or npm install rollup@beta. It will likely become part of a regular release later.

@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4621 as part of rollup@3.0.0-8. Note that this is a pre-release, so to test it, you need to install Rollup via npm install rollup@3.0.0-8 or npm install rollup@beta. It will likely become part of a regular release later.

@rollup-bot
Copy link
Collaborator

This issue has been resolved via #4621 as part of rollup@3.0.0. You can test it via npm install rollup.

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