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

[Bug]: Deployment of a sveltke-kit app fails, telling me that I'm not using the svelte-deno-adapter when I am. #485

Open
pdenapo opened this issue Sep 5, 2023 · 2 comments
Assignees

Comments

@pdenapo
Copy link

pdenapo commented Sep 5, 2023

Problem description

I have a svelte-kit app in Deno Deploy.

When I imported in into deno, it complais that it is not using svelte-adapter-deno. But this is not true.

Here is my svelte.config.js

import adapter from 'svelte-adapter-deno';


/** @type {import('@sveltejs/kit').Config} */
const config = {
	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()
	}
};

export default config;

and it is also in package.json.

When commiting to github after that, the deploy fails with a strange message in the deploy log

Finishing deployment...
Error: TypeError: terminated

However, my site just works in Deno Deploy.

Steps to reproduce

clone my repository

https://github.com/pdenapo/svelte-app-deno.git

and import in into Deno Deploy

Expected behavior

Deploy the site without errors.

Environment

Everthing is done through github actions

name: ci

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  deploy:
    name: deploy
    runs-on: ubuntu-latest
    permissions:
      id-token: write
      contents: read

    steps:
      - name: Clone repository
        uses: actions/checkout@v2

      - name: Install Node
        uses: actions/setup-node@v2
        with:
          node-version: 16

      - name: Cache pnpm modules
        uses: actions/cache@v2
        with:
          path: ~/.pnpm-store
          key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
          restore-keys: |
            ${{ runner.os }}-

      - name: Install pnpm and node_modules
        uses: pnpm/action-setup@v2
        with:
          version: latest
          run_install: true

      - name: Copy bootstrap 
        run:  ./copiar_en_static.sh
        shell: bash     

      - name: Build site
        run: pnpm build

      - name: Deploy to Deno Deploy
        uses: denoland/deployctl@v1
        with:
          project: far-deer-44
          entrypoint: 'build/index.js' 

Possible solution

No response

Additional context

No response

@pdenapo pdenapo changed the title [Bug]: [Bug]: Deployment of a sveltke-kit app fails, telling me that I'm not using the svelte-deno-adapter when I am. Sep 5, 2023
@pdenapo
Copy link
Author

pdenapo commented Sep 5, 2023

This would be much easier if you provide a template for the supported frameworks (like you do for Fresh or like Vercel does)

@ry ry assigned kt3k Sep 8, 2023
@kt3k
Copy link
Member

kt3k commented Sep 10, 2023

There are 2 sveltekit adapters in npm: svelte-adapter-deno and sveltekit-adapter-deno.

We only detect the latter sveltekit-adapter-deno as the adapter for Deno Deploy because the former one has major issue in bundling ( pluvial/svelte-adapter-deno#40 ) , but it doesn't solve it for long time (it doesn't look maintained anymore).

Finishing deployment...
Error: TypeError: terminated

This seems caused by uploading too many files (4679 files) to Deno Deploy. This is caused because node_modules directory is remaining from previous steps, and denoland/deployctl tries to upload everything in the current dir. If I replaced pnpm build to pnpm build && rm -rf node_modules in my forked repository, denoland/deployctl action ran successfully.

My change: kt3k/svelte-app-deno@0b67e4d
CI run: https://github.com/kt3k/svelte-app-deno/actions/runs/6136568287/job/16651530818

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