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

build of new "SvelteKit demo app" with @sveltejs/adapter-static fails with "500 /todos" (but Skeleton project build is OK) #3886

Closed
rlyders opened this issue Feb 13, 2022 · 1 comment

Comments

@rlyders
Copy link

rlyders commented Feb 13, 2022

Describe the bug

Running npm run build in a brand new "SvelteKit demo app" using the latest @sveltejs/adapter-static fails with: 500 /todos

NOTE: However, building a new SvelteKit "Skeleton project" completes without error".

error output from npm run build:

> Using @sveltejs/adapter-static
> 500 /todos
    at file:///C:/projects/svelte/research/adapter-static-test-2022-02-13_07-40-36/node_modules/@sveltejs/kit/dist/chunks/index5.js:424:11
    at save (file:///C:/projects/svelte/research/adapter-static-test-2022-02-13_07-40-36/node_modules/@sveltejs/kit/dist/chunks/index5.js:656:4)
    at visit (file:///C:/projects/svelte/research/adapter-static-test-2022-02-13_07-40-36/node_modules/@sveltejs/kit/dist/chunks/index5.js:549:3)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Reproduction

Run the following bash shell script to create a new adapter-static test SvelteKit project and select the following options when prompted:

√ Which Svelte app template? » SvelteKit demo app
√ Use TypeScript? ... No
√ Add ESLint for code linting? ... No
√ Add Prettier for code formatting? ... No

cr-adapter-static-test.sh:

#!/bin/bash

TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S)
APP_NAME=${1:-adapter-static-test-$TIMESTAMP}
echo APP_NAME=$APP_NAME
npm init svelte@next $APP_NAME
cd $APP_NAME
npm i 

# install adapter-static ...
npm i -D @sveltejs/adapter-static@next
sed -i.$TIMESTAMP -e "s/import adapter from.*$/import adapter from '@sveltejs\/adapter-static';/g" \
                  -e "s/adapter: adapter.*$/adapter: adapter\(\{ pages: 'build', assets: 'build', fallback: null, precompress: false\}\),/g" ./svelte.config.js
npm run build

Logs

$ ./cr-adapter-static-test.sh 
APP_NAME=adapter-static-test-2022-02-13_07-45-43

create-svelte version 2.0.0-next.116

Welcome to SvelteKit!

This is beta software; expect bugs and missing features.

Problems? Open an issue on https://github.com/sveltejs/kit/issues if none exists already.

√ Which Svelte app template? » SvelteKit demo app
√ Use TypeScript? ... No / Yes
√ Add ESLint for code linting? ... No / Yes
√ Add Prettier for code formatting? ... No / Yes

Your project is ready!

Install community-maintained integrations:
  https://github.com/svelte-add/svelte-adders

Next steps:
  1: cd adapter-static-test-2022-02-13_07-45-43
  2: npm install (or pnpm install, etc)
  3: git init && git add -A && git commit -m "Initial commit" (optional)
  4: npm run dev -- --open

To close the dev server, hit Ctrl-C

Stuck? Visit us at https://svelte.dev/chat


added 42 packages, and audited 43 packages in 14s

5 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

added 1 package, and audited 44 packages in 2s

5 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
add to `./svelte.config.js`...

> adapter-static-test-2022-02-13-07-45-43@0.0.1 build
> svelte-kit build

vite v2.8.1 building for production...
✓ 34 modules transformed.
.svelte-kit/output/client/_app/assets/svelte-logo-87df40b8.svg                           1.85 KiB
.svelte-kit/output/client/_app/assets/fira-mono-cyrillic-400-normal-c7d433fd.woff2       8.89 KiB
.svelte-kit/output/client/_app/assets/fira-mono-cyrillic-ext-400-normal-3df7909e.woff2   15.40 KiB
.svelte-kit/output/client/_app/assets/fira-mono-greek-ext-400-normal-9e2fe623.woff2      7.33 KiB
.svelte-kit/output/client/_app/assets/fira-mono-greek-400-normal-a8be01ce.woff2          10.27 KiB
.svelte-kit/output/client/_app/assets/fira-mono-latin-400-normal-e43b3538.woff2          15.90 KiB
.svelte-kit/output/client/_app/assets/fira-mono-all-400-normal-1e3b098c.woff             75.55 KiB
.svelte-kit/output/client/_app/assets/fira-mono-latin-ext-400-normal-6bfabd30.woff2      11.10 KiB
.svelte-kit/output/client/_app/manifest.json                                             2.51 KiB
.svelte-kit/output/client/_app/pages/__layout.svelte-c75000c8.js                         4.76 KiB / gzip: 1.86 KiB
.svelte-kit/output/client/_app/error.svelte-29b1ccde.js                                  1.56 KiB / gzip: 0.75 KiB
.svelte-kit/output/client/_app/pages/index.svelte-3e392773.js                            4.08 KiB / gzip: 1.69 KiB
.svelte-kit/output/client/_app/start-e9cd6278.js                                         23.34 KiB / gzip: 7.95 KiB
.svelte-kit/output/client/_app/pages/about.svelte-3b3545d3.js                            2.38 KiB / gzip: 1.09 KiB
.svelte-kit/output/client/_app/pages/todos/index.svelte-8ef16209.js                      5.91 KiB / gzip: 2.40 KiB
.svelte-kit/output/client/_app/chunks/singletons-a6a7384f.js                             0.05 KiB / gzip: 0.07 KiB
.svelte-kit/output/client/_app/assets/pages/about.svelte-bf4528fa.css                    0.11 KiB / gzip: 0.10 KiB
.svelte-kit/output/client/_app/chunks/vendor-ee294e9e.js                                 14.16 KiB / gzip: 6.04 KiB
.svelte-kit/output/client/_app/assets/pages/todos/index.svelte-784042c1.css              3.70 KiB / gzip: 1.04 KiB
.svelte-kit/output/client/_app/assets/pages/__layout.svelte-15681802.css                 4.96 KiB / gzip: 1.55 KiB
.svelte-kit/output/client/_app/assets/pages/index.svelte-1d45bd0c.css                    1.40 KiB / gzip: 0.50 KiB
vite v2.8.1 building SSR bundle for production...
✓ 36 modules transformed.
.svelte-kit/output/server/manifest.json                         2.15 KiB
.svelte-kit/output/server/app.js                                63.25 KiB
.svelte-kit/output/server/entries/endpoints/todos/index.js      1.23 KiB
.svelte-kit/output/server/entries/pages/__layout.svelte.js      4.60 KiB
.svelte-kit/output/server/entries/pages/error.svelte.js         0.72 KiB
.svelte-kit/output/server/entries/pages/index.svelte.js         8.07 KiB
.svelte-kit/output/server/entries/pages/about.svelte.js         1.30 KiB
.svelte-kit/output/server/entries/pages/todos/index.svelte.js   5.84 KiB
.svelte-kit/output/server/chunks/index-ee9fdf1a.js              4.24 KiB

Run npm run preview to preview your production build locally.

> Using @sveltejs/adapter-static
> 500 /todos
    at file:///C:/projects/svelte/research/adapter-static-test-2022-02-13_07-45-43/node_modules/@sveltejs/kit/dist/chunks/index5.js:424:11
    at save (file:///C:/projects/svelte/research/adapter-static-test-2022-02-13_07-45-43/node_modules/@sveltejs/kit/dist/chunks/index5.js:656:4)
    at visit (file:///C:/projects/svelte/research/adapter-static-test-2022-02-13_07-45-43/node_modules/@sveltejs/kit/dist/chunks/index5.js:549:3)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz   
    Memory: 6.68 GB / 15.89 GB
  Binaries:
    Node: 17.4.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.3.1 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (98.0.1108.50)
    Internet Explorer: 11.0.19041.1202
  npmPackages:
    @sveltejs/adapter-static: ^1.0.0-next.28 => 1.0.0-next.28

Severity

serious, but I can work around it

Additional Information

This might be related to #3852

@babichjacob
Copy link
Member

Closing to keep discussion in #3833

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

No branches or pull requests

2 participants