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

Navbar item and links disappear using adapter static #537

Open
spedone opened this issue Apr 20, 2023 · 0 comments
Open

Navbar item and links disappear using adapter static #537

spedone opened this issue Apr 20, 2023 · 0 comments

Comments

@spedone
Copy link

spedone commented Apr 20, 2023

Immagine 2023-04-20 152246

When i turn adapter to static in svelte.config.js the navbar items and links disappear.

Cattura

svelte.config.js

import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess} from '@sveltejs/kit/vite';
// import adapter from '@sveltejs/adapter-static';

/** @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({
			// default options are shown. On some platforms
			// these options are set automatically — see below
			pages: 'build',
			assets: 'build',
			fallback: null,
			precompress: false,
			strict: true
		  })

	},

};

export default config;

+layout.svelte

<script lang="ts">
  import {
    Collapse,
    Navbar,
    NavbarToggler,
    NavbarBrand,
    Nav,
    NavItem,
    NavLink,
    Image
  } from 'sveltestrap';

  let isOpen = false;

  function handleUpdate(event) {
    isOpen = event.detail.isOpen;
  }
</script>

<Navbar color="light" light expand="md">
<NavbarBrand href="/">sveltestrap</NavbarBrand>
<NavbarToggler on:click={() => (isOpen = !isOpen)} />
<Collapse {isOpen} navbar expand="md" on:update={handleUpdate}>
  <Nav class="ms-auto" navbar>
    <NavItem>
      <NavLink href="#components/">Components</NavLink>
    </NavItem>
    <NavItem>
      <NavLink href="https://github.com/bestguy/sveltestrap">GitHub</NavLink>
    </NavItem>
  </Nav>
</Collapse>
</Navbar>

<idv>
  <slot></slot>
</idv>

+layout.js

// This can be false if you're using a fallback (i.e. SPA mode)
// export const prerender = true;
// export const trailingSlash = 'always';
export const ssr = false;
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

1 participant