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

🐛 BUG: Empty config file returns confusing error message #8

Closed
FredKSchott opened this issue Mar 12, 2022 · 0 comments · Fixed by #11
Closed

🐛 BUG: Empty config file returns confusing error message #8

FredKSchott opened this issue Mar 12, 2022 · 0 comments · Fixed by #11

Comments

@FredKSchott
Copy link
Contributor

FredKSchott commented Mar 12, 2022

Originally reported in Astro by @RafidMuhymin

Describe the Bug

Astro throws the following error if there's an empty astro.config.js file present or if the config file doesn't have a default export.

TypeError: Cannot convert object to primitive value
    at resolveExtensions (file:///Users/fks/Code/astro/node_modules/.pnpm/@[email protected]/node_modules/@proload/core/lib/esm/index.mjs:103:71)
    at load (file:///Users/fks/Code/astro/node_modules/.pnpm/@[email protected]/node_modules/@proload/core/lib/esm/index.mjs:197:31)
    at async loadConfig (file:///Users/fks/Code/astro/packages/astro/dist/core/config.js:101:18)
    at async cli (file:///Users/fks/Code/astro/packages/astro/dist/cli/index.js:109:14)

No error is thrown if there's no astro.config.js file present.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-tz7qbv?file=astro.config.mjs&on=stackblitz

natemoo-re added a commit that referenced this issue Apr 26, 2022
* Revert "fix(#8): improve handling when file is matched but empty (#11)"

This reverts commit 4c7215e.

* chore: changesets

* fix: resolve conflict
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.

1 participant