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

2.3.0 no longer supports async functions for config #3470

Closed
joeldenning opened this issue Mar 29, 2020 · 3 comments · Fixed by #3472
Closed

2.3.0 no longer supports async functions for config #3470

joeldenning opened this issue Mar 29, 2020 · 3 comments · Fixed by #3472

Comments

@joeldenning
Copy link
Contributor

joeldenning commented Mar 29, 2020

Expected Behavior

Async functions should be supported as rollup configs. This worked in 2.2.0, but appears not to work in 2.3.0.

export default async () => ({
  input: './index.js',
  output: {...}
})

Actual Behavior

yarn build
yarn run v1.22.0
$ rollup -c
[!] Error: Config file must export an options object, or an array of options objects
https://rollupjs.org/guide/en/#configuration-files
Error: Config file must export an options object, or an array of options objects
    at Object.error (/Users/joeldenning/code/esm-bundle-react-dom/node_modules/rollup/dist/shared/rollup.js:10120:30)
    at getConfigList (/Users/joeldenning/code/esm-bundle-react-dom/node_modules/rollup/dist/shared/loadConfigFile.js:543:26)
    at loadConfigFile (/Users/joeldenning/code/esm-bundle-react-dom/node_modules/rollup/dist/shared/loadConfigFile.js:488:12)
    at Object.loadAndParseConfigFile (/Users/joeldenning/code/esm-bundle-react-dom/node_modules/rollup/dist/shared/loadConfigFile.js:466:21)
    at getConfigs (/Users/joeldenning/code/esm-bundle-react-dom/node_modules/rollup/dist/bin/rollup:2032:39)
    at runRollup (/Users/joeldenning/code/esm-bundle-react-dom/node_modules/rollup/dist/bin/rollup:2013:43)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@joeldenning
Copy link
Contributor Author

Here's perhaps a clearer reproduction case - https://github.com/joeldenning/rollup-3470

@lukastaegert
Copy link
Member

Sorry about that and thanks for spotting. Fix at #3472.

@joeldenning
Copy link
Contributor Author

Thank you for the very quick fix!

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

Successfully merging a pull request may close this issue.

2 participants