Skip to content

Commit 4a1c04a

Browse files
author
Rich Harris
authored
only complain that svelte.config.cjs is missing if it actually is - fixes #659 (#665)
1 parent 272148b commit 4a1c04a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

.changeset/tame-dodos-love.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
More accurate MODULE_NOT_FOUND errors

packages/kit/src/cli.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ async function get_config() {
2222
} catch (error) {
2323
let message = error.message;
2424

25-
if (error.code === 'MODULE_NOT_FOUND') {
25+
if (
26+
error.code === 'MODULE_NOT_FOUND' &&
27+
/Cannot find module svelte\.config\.cjs/.test(error.message)
28+
) {
2629
if (existsSync('svelte.config.js')) {
2730
// TODO this is temporary, for the benefit of early adopters
2831
message = 'You must rename svelte.config.js to svelte.config.cjs';

0 commit comments

Comments
 (0)