-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix: Throw when prerendered routes have unresolvable content negotiation #9994
Closed
elliott-with-the-longest-name-on-github
wants to merge
19
commits into
master
from
elliott/9929-fix-entry-exports
Closed
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
cfcc741
fix: Override precedence of `entries`
elliott-with-the-longest-name-on-github d0d26c3
fix: Set `text/html` header in `respond` during prerendering
elliott-with-the-longest-name-on-github 57a21e4
test
elliott-with-the-longest-name-on-github 97f8ec9
changeset
elliott-with-the-longest-name-on-github 9c66098
Merge remote-tracking branch 'origin' into elliott/9929-fix-entry-exp…
elliott-with-the-longest-name-on-github 34e0ef4
change tact; throw on impossible content negotiation and update tests
elliott-with-the-longest-name-on-github 8213ef6
changeset
elliott-with-the-longest-name-on-github df2c721
Merge remote-tracking branch 'origin' into elliott/9929-fix-entry-exp…
elliott-with-the-longest-name-on-github 13c235d
changeset
elliott-with-the-longest-name-on-github 118676a
use filenames for more actionable feedback
4d16b8c
add a +page.svelte, since the route is unrenderable without
466feec
throw error at dev time
eb80b81
Merge branch 'master' into elliott/9929-fix-entry-exports
benmccann a90638e
fix broken lockfile
benmccann 1207d45
merge master
benmccann e384cce
Merge remote-tracking branch 'origin' into elliott/9929-fix-entry-exp…
elliott-with-the-longest-name-on-github 5190bb3
lockfile
elliott-with-the-longest-name-on-github da4b0bd
other unprerenderable methods
elliott-with-the-longest-name-on-github 9999c99
fix: Clean up options
elliott-with-the-longest-name-on-github File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sveltejs/kit': patch | ||
--- | ||
|
||
fix: precedence of `entries` should be `+page => +page.server => +server` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sveltejs/kit': patch | ||
--- | ||
|
||
fix: prerendered routes will throw when exposing both a GET handler and a page, preventing impossible content negotiation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/kit/test/build-errors/apps/prerender-entry-generator-mismatch/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
packages/kit/test/build-errors/apps/prerender-impossible-content-negotiation/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "prerender-impossible-content-negotiation", | ||
"private": true, | ||
"version": "0.0.1", | ||
"scripts": { | ||
"dev": "vite dev", | ||
"build": "vite build", | ||
"preview": "vite preview", | ||
"check": "svelte-kit sync && tsc && svelte-check" | ||
}, | ||
"devDependencies": { | ||
"@sveltejs/adapter-auto": "workspace:^", | ||
"@sveltejs/kit": "workspace:^", | ||
"svelte": "^3.56.0", | ||
"svelte-check": "^3.0.2", | ||
"typescript": "^4.9.4", | ||
"vite": "^4.3.6" | ||
}, | ||
"type": "module" | ||
} |
12 changes: 12 additions & 0 deletions
12
packages/kit/test/build-errors/apps/prerender-impossible-content-negotiation/src/app.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<link rel="icon" href="%sveltekit.assets%/favicon.png" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
%sveltekit.head% | ||
</head> | ||
<body> | ||
<div>%sveltekit.body%</div> | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
...t/test/build-errors/apps/prerender-impossible-content-negotiation/src/routes/+page.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1>Hello world</h1> |
1 change: 1 addition & 0 deletions
1
...s/kit/test/build-errors/apps/prerender-impossible-content-negotiation/src/routes/+page.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const prerender = true; |
1 change: 1 addition & 0 deletions
1
...kit/test/build-errors/apps/prerender-impossible-content-negotiation/src/routes/+server.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export function GET() {} |
Binary file added
BIN
+1.53 KB
...t/build-errors/apps/prerender-impossible-content-negotiation/static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions
10
...ages/kit/test/build-errors/apps/prerender-impossible-content-negotiation/svelte.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import adapter from '../../../../../adapter-auto/index.js'; | ||
|
||
/** @type {import('@sveltejs/kit').Config} */ | ||
const config = { | ||
kit: { | ||
adapter: adapter() | ||
} | ||
}; | ||
|
||
export default config; |
15 changes: 15 additions & 0 deletions
15
packages/kit/test/build-errors/apps/prerender-impossible-content-negotiation/tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"checkJs": true, | ||
"noEmit": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"paths": { | ||
"@sveltejs/kit": ["../../../../types"], | ||
"$lib": ["./src/lib"], | ||
"$lib/*": ["./src/lib/*"] | ||
} | ||
}, | ||
"extends": "./.svelte-kit/tsconfig.json" | ||
} |
23 changes: 23 additions & 0 deletions
23
packages/kit/test/build-errors/apps/prerender-impossible-content-negotiation/vite.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import * as path from 'node:path'; | ||
import { sveltekit } from '@sveltejs/kit/vite'; | ||
|
||
/** @type {import('vite').UserConfig} */ | ||
const config = { | ||
build: { | ||
minify: false | ||
}, | ||
|
||
clearScreen: false, | ||
|
||
logLevel: 'silent', | ||
|
||
plugins: [sveltekit()], | ||
|
||
server: { | ||
fs: { | ||
allow: [path.resolve('../../../../src')] | ||
} | ||
} | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should keep these in sync with the other test projects