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

Sveltekit with ts does not work on vercel #10263

Closed
SaranSundar opened this issue Jun 27, 2023 · 2 comments
Closed

Sveltekit with ts does not work on vercel #10263

SaranSundar opened this issue Jun 27, 2023 · 2 comments

Comments

@SaranSundar
Copy link

Describe the bug

I noticed if the file is named

svelte.config.ts it doesn't work, but if it is svelte.config.js it works.

Running build in Cleveland, USA (East) – cle1
--
11:58:51.444 | Cloning github.com/SaranSundar/architect (Branch: main, Commit: ab80f40)
11:58:52.094 | Cloning completed: 650.047ms
11:58:53.007 | Restored build cache
11:58:53.033 | Running "vercel build"
11:58:53.505 | Vercel CLI 30.2.3
11:58:54.090 | Installing dependencies...
11:58:54.985 |  
11:58:54.986 | up to date in 611ms
11:58:54.986 |  
11:58:54.986 | 71 packages are looking for funding
11:58:54.986 | run `npm fund` for details
11:58:54.997 | Detected `package-lock.json` generated by npm 7+...
11:58:54.997 | Running "npm run build"
11:58:55.236 |  
11:58:55.236 | > [email protected] build
11:58:55.236 | > vite build
11:58:55.236 |  
11:58:55.434 | ▲ [WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]
11:58:55.434 |  
11:58:55.434 | tsconfig.json:2:12:
11:58:55.434 | 2 │   "extends": "./.svelte-kit/tsconfig.json",
11:58:55.434 | ╵              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11:58:55.435 |  
11:58:56.082 |  
11:58:56.082 | vite v4.3.9 building SSR bundle for production...
11:58:56.109 | transforming...
11:58:57.821 | ✓ 77 modules transformed.
11:58:57.868 | rendering chunks...
11:58:58.048 |  
11:58:58.048 | vite v4.3.9 building for production...
11:58:58.053 | transforming...
11:58:58.743 | ✓ 67 modules transformed.
11:58:58.801 | rendering chunks...
11:58:58.844 | computing gzip size...
11:58:58.859 | .svelte-kit/output/client/_app/version.json                              0.03 kB │ gzip:  0.05 kB
11:58:58.859 | .svelte-kit/output/client/vite-manifest.json                             2.53 kB │ gzip:  0.46 kB
11:58:58.859 | .svelte-kit/output/client/_app/immutable/assets/0.942d8a14.css          84.30 kB │ gzip: 12.00 kB
11:58:58.860 | .svelte-kit/output/client/_app/immutable/chunks/stores.47b3d873.js       0.24 kB │ gzip:  0.17 kB
11:58:58.860 | .svelte-kit/output/client/_app/immutable/nodes/1.fe1fd95d.js             0.84 kB │ gzip:  0.52 kB
11:58:58.860 | .svelte-kit/output/client/_app/immutable/nodes/2.e91dc94d.js             1.13 kB │ gzip:  0.70 kB
11:58:58.860 | .svelte-kit/output/client/_app/immutable/chunks/scheduler.e108d1fd.js    2.16 kB │ gzip:  1.02 kB
11:58:58.860 | .svelte-kit/output/client/_app/immutable/chunks/singletons.11e535a3.js   2.85 kB │ gzip:  1.46 kB
11:58:58.860 | .svelte-kit/output/client/_app/immutable/chunks/index.0719bd3d.js        5.44 kB │ gzip:  2.31 kB
11:58:58.860 | .svelte-kit/output/client/_app/immutable/entry/app.56c77fed.js           5.76 kB │ gzip:  2.24 kB
11:58:58.860 | .svelte-kit/output/client/_app/immutable/nodes/0.eb644cef.js             6.95 kB │ gzip:  2.84 kB
11:58:58.861 | .svelte-kit/output/client/_app/immutable/entry/start.9fa4caef.js        24.00 kB │ gzip:  9.52 kB
11:58:58.861 | ✓ built in 812ms
11:58:59.000 | .svelte-kit/output/server/vite-manifest.json                           2.02 kB
11:58:59.000 | .svelte-kit/output/server/_app/immutable/assets/_layout.55db779d.css  84.29 kB
11:58:59.000 | .svelte-kit/output/server/entries/pages/_page.js                       0.05 kB
11:58:59.000 | .svelte-kit/output/server/entries/pages/_layout.server.js              0.16 kB
11:58:59.000 | .svelte-kit/output/server/internal.js                                  0.24 kB
11:58:59.000 | .svelte-kit/output/server/chunks/shared-server.js                      0.28 kB
11:58:59.000 | .svelte-kit/output/server/entries/fallbacks/error.svelte.js            0.47 kB
11:58:59.001 | .svelte-kit/output/server/chunks/stores.js                             0.52 kB
11:58:59.001 | .svelte-kit/output/server/entries/pages/_layout.svelte.js              0.62 kB
11:58:59.001 | .svelte-kit/output/server/entries/pages/_page.svelte.js                0.76 kB
11:58:59.001 | .svelte-kit/output/server/chunks/ssr.js                                3.35 kB
11:58:59.001 | .svelte-kit/output/server/chunks/internal.js                           5.26 kB
11:58:59.001 | .svelte-kit/output/server/index.js                                    86.49 kB
11:58:59.001 |  
11:58:59.002 | Run npm run preview to preview your production build locally.
11:58:59.002 |  
11:58:59.002 | No adapter specified
11:58:59.002 | See https://kit.svelte.dev/docs/adapters to learn how to configure your app to run on the platform of your choosing
11:58:59.002 | ✓ built in 2.92s
11:58:59.164 | Error: No Output Directory named "public" found after the Build completed. You can configure the Output Directory in your Project Settings.
11:58:59.164 | Learn More: https://vercel.link/missing-public-directory
11:58:59.504 | STATIC_BUILD_NO_OUT_DIR: No Output Directory named "public" found after the Build completed. You can configure the Output Directory in your Project Settings.
import adapter from '@sveltejs/adapter-vercel';
import { vitePreprocess } from '@sveltejs/kit/vite';

/** @type {import('@sveltejs/kit').Config} */
const config = {
	// Consult https://kit.svelte.dev/docs/integrations#preprocessors
	// for more information about preprocessors
	preprocess: vitePreprocess(),

	kit: {
		// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
		// If your environment is not supported or you settled on a specific environment, switch out the adapter.
		// See https://kit.svelte.dev/docs/adapters for more information about adapters.
		adapter: adapter({
			runtime: 'nodejs18.x'
		})
	}
};

export default config;

Reproduction

Use vercels deploy for sveltekit, update packages to below and try a deploy

{
	"name": "test",
	"version": "0.0.1",
	"scripts": {
		"dev": "vite dev",
		"build": "vite build",
		"preview": "vite preview",
		"test": "playwright test",
		"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
		"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
		"test:unit": "vitest",
		"lint": "prettier --plugin-search-dir . --check . && eslint .",
		"format": "prettier --plugin-search-dir . --write ."
	},
	"devDependencies": {
		"@fontsource/fira-mono": "^5.0.3",
		"@playwright/test": "^1.35.1",
		"@sveltejs/adapter-vercel": "^3.0.1",
		"@sveltejs/kit": "^1.20.5",
		"@types/cookie": "^0.5.1",
		"@typescript-eslint/eslint-plugin": "^5.60.1",
		"@typescript-eslint/parser": "^5.60.1",
		"autoprefixer": "^10.4.14",
		"eslint": "^8.43.0",
		"eslint-config-prettier": "^8.8.0",
		"eslint-plugin-svelte": "^2.31.1",
		"firebase": "^9.23.0",
		"postcss": "^8.4.24",
		"prettier": "^2.8.8",
		"prettier-plugin-svelte": "^2.10.1",
		"svelte": "^4.0.0",
		"svelte-check": "^3.4.4",
		"tailwindcss": "^3.3.2",
		"tslib": "^2.6.0",
		"typescript": "^5.1.3",
		"vite": "^4.3.9",
		"vitest": "^0.32.2",
		"web-vitals": "^3.3.2",
		"@floating-ui/dom": "^1.4.2",
		"@skeletonlabs/skeleton": "^1.8.0",
		"@tailwindcss/forms": "^0.5.3",
		"@tailwindcss/typography": "^0.5.9",
		"highlight.js": "^11.8.0"
	},
	"type": "module"
}

Logs

When i use the js version output on vercel is correct

Run npm run preview to preview your production build locally.
> Using @sveltejs/adapter-vercel
  ✔ done
✓ built in 4.87s
Build Completed in /vercel/output [7s]
Deploying outputs...
Deployment completed

System Info

N/A on vercel

Severity

serious, but I can work around it

Additional Information

No response

@Conduitry
Copy link
Member

There is no svelte.config.ts - #2576.

@Conduitry Conduitry closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2023
@SaranSundar
Copy link
Author

Oh my bad thanks, I'm new to svelte just tried using this

https://www.skeleton.dev/

and there typescript app starter generated that file, didn't realize it's not actually supported.

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