Skip to content

Improved validation of empty or malformed svelte.config.js #1115

@benmccann

Description

@benmccann

Is your feature request related to a problem? Please describe.

SvelteKit had an empty svelte.config.js in one of its test projects. It gave the error message:

│ Error while loading config
│ TypeError: Cannot read property 'compilerOptions' of undefined

Describe the solution you'd like

It'd be nice if it checked if the config existed before trying to read compilerOptions off it:

It'd also be nice if it printed the path to the svelte.config.js in the error. SvelteKit had tons of them in various test projects, so it took a little while to track down

Additional context
See sveltejs/kit#1988

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions