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

Freshly-scaffolded demo app does not include methodOverride in svelte.config.js #3385

Closed
geoffrich opened this issue Jan 17, 2022 · 0 comments · Fixed by #3411
Closed

Freshly-scaffolded demo app does not include methodOverride in svelte.config.js #3385

geoffrich opened this issue Jan 17, 2022 · 0 comments · Fixed by #3411
Labels
Milestone

Comments

@geoffrich
Copy link
Member

Describe the bug

When scaffolding a demo app with npm init svelte@next, the methodOverride setting is not included in svelte.config.js. This is despite it being included in the demo app template. This is causing new demo apps to not support editing or removing TODOs.

methodOverride: {
allowed: ['PATCH', 'DELETE']
}

Reproduction

  1. Run npm init svelte@next and select all the default options
  2. Look at svelte.config.js in the created repo. The methodOverride setting is not included.

Logs

XHRPOSThttp://localhost:3000/todos/df0000a7-e3d0-4e83-b71b-378e92cdc2c2.json?_method=DELETE
[HTTP/1.1 400 Bad Request 3ms]

_method=DELETE is not enabled. See https://kit.svelte.dev/docs#configuration-methodoverride form.js:31:13
XHRPOSThttp://localhost:3000/todos/df0000a7-e3d0-4e83-b71b-378e92cdc2c2.json?_method=PATCH
[HTTP/1.1 400 Bad Request 7ms]

_method=PATCH is not enabled. See https://kit.svelte.dev/docs#configuration-methodoverride form.js:31:13
XHRPOSThttp://localhost:3000/todos/df0000a7-e3d0-4e83-b71b-378e92cdc2c2.json?_method=PATCH
[HTTP/1.1 400 Bad Request 2ms]

_method=PATCH is not enabled. See https://kit.svelte.dev/docs#configuration-methodoverride

System Info

System:
    OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
    CPU: (8) x64 Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
    Memory: 7.27 GB / 12.40 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 14.17.0 - /usr/bin/node
    Yarn: 1.22.10 - /usr/bin/yarn
    npm: 8.1.1 - /usr/bin/npm
  Browsers:
    Chrome: 90.0.4430.212

Severity

annoyance

Additional Information

Reported in comment method override PR: #2989 (comment).

I think this is related to the svelte.config.js present in the shared folder, which overwrites the default svelte.config.js. Maybe there's a way to merge these configs like we seem to do with package.json?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants