🐛 BUG: nested `astro.config` files cause dev server errors
What version of astro are you using?
1.0.0-beta.24
Are you using an SSR adapter? If so, which one?
No
What package manager are you using?
Yarn
What operating system are you using?
Windows
Describe the Bug
Just ran into this error when running the dev server on a project that contains a nested astro.config file.
Error: Build failed with 5 errors:
node_modules/svelte-preprocess/dist/modules/language.js:27:24: ERROR: Could not resolve "sugarss"
node_modules/svelte-preprocess/dist/transformers/coffeescript.js:7:47: ERROR: Could not resolve "coffeescript"
node_modules/svelte-preprocess/dist/transformers/less.js:8:39: ERROR: Could not resolve "less"
node_modules/svelte-preprocess/dist/transformers/pug.js:8:38: ERROR: Could not resolve "pug"
node_modules/svelte-preprocess/dist/transformers/stylus.js:8:41: ERROR: Could not resolve "stylus"
at failureErrorWithLog (/home/projects/github-qrvb6k-se32e8/node_modules/esbuild/lib/main.js:1557:15)
at eval (/home/projects/github-qrvb6k-se32e8/node_modules/esbuild/lib/main.js:1215:28)
at runOnEndCallbacks (/home/projects/github-qrvb6k-se32e8/node_modules/esbuild/lib/main.js:1005:63)
at buildResponseToResult (/home/projects/github-qrvb6k-se32e8/node_modules/esbuild/lib/main.js:1213:7)
at eval (/home/projects/github-qrvb6k-se32e8/node_modules/esbuild/lib/main.js:1322:14)
at eval (/home/projects/github-qrvb6k-se32e8/node_modules/esbuild/lib/main.js:637:9)
at handleIncomingPacket (/home/projects/github-qrvb6k-se32e8/node_modules/esbuild/lib/main.js:734:9)
at Socket.readFromStdout (/home/projects/github-qrvb6k-se32e8/node_modules/esbuild/lib/main.js:604:7)
at Socket.EventEmitter.emit (https://github-qrvb6k-se32e8.w.staticblitz.com/blitz.331c80ffab288536319518a60349d00207075dad.js:6:155505)
at addChunk (https://github-qrvb6k-se32e8.w.staticblitz.com/blitz.331c80ffab288536319518a60349d00207075dad.js:6:656340)
Use Case
- I'm writing a
ComponentSandboxcomponent - I want to include template files to be sent to Stackblitz in
/src/- for example:
/src/Templates/Foo/astro.config.ts
- for example:
https://user-images.githubusercontent.com/10906415/166838165-b745e4e8-3201-4d5f-ac98-9ef8a681a586.mp4
Steps To Reproduce
- fork the
Kitchen Sink (Multiple Frameworks)example fromastro.new - copy
./astro.config.mjsto./src/templates/StackBlitz/astro.config.mjs
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-qrvb6k-se32e8
Participation
- [ ] I am willing to submit a pull request for this issue.
So this looks like an issue coming from vite-plugin-svelte? I think what's happening is it's trying to preprocess everything inside of the src/ directory.
Is there a reason your templates need to be inside of src/? Do all of these templates need to be built?
So this looks like an issue coming from
vite-plugin-svelte? I think what's happening is it's trying to preprocess everything inside of thesrc/directory.Is there a reason your templates need to be inside of
src/? Do all of these templates need to be built?
Putting the templates @ the project root seems to work as a workaround, just thought it was a weird issue and am wondering if other valid source code could cause the same type of issue.