-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
Describe the bug
Button.svelte:
<script lang="ts">
import type { HTMLButtonAttributes } from 'svelte/elements';
const { ...rest }: HTMLButtonAttributes = $props();
</script>
<button type="button" {...rest} class="tf-btn nopan nodrag {rest.class}">
<slot></slot>
</button>svelte.config.js
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
export default {
// Consult https://svelte.dev/docs#compile-time-svelte-preprocess
// for more information about preprocessors
preprocess: [
vitePreprocess({
script: true
})
],
compilerOptions: {
// accessors: true,
customElement: true
}
};vite.config.ts
import { defineConfig } from 'vite';
import { resolve } from 'path';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import dts from 'vite-plugin-dts';
// https://vitejs.dev/config/
export default defineConfig({
build: {
outDir: 'dist',
emptyOutDir: true,
minify: true,
sourcemap: false,
lib: {
entry: resolve(__dirname, 'src/index.ts'),
// formats: ['es'],
name: 'Tinyflow',
fileName: 'tinyflow'
}
},
plugins: [svelte({ emitCss: false }), dts({
rollupTypes: true ,
// tsconfigPath: './tsconfig.app.json'
})],
});then execute npm run build will result in an error: [commonjs--resolver] No known conditions for "./elements" specifier in "svelte" package。
Reproduction
git clone https://github.com/tinyflow-ai/tinyflow
pnpm install
pnpm run build
Logs
System Info
System:
OS: macOS 15.1.1
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Memory: 8.97 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.10.0 - /usr/local/bin/node
Yarn: 1.22.22 - /usr/local/bin/yarn
npm: 10.9.1 - /usr/local/bin/npm
pnpm: 8.15.6 - ~/Library/pnpm/pnpm
Browsers:
Chrome: 133.0.6943.127
Safari: 18.1.1
npmPackages:
svelte: ^5.20.2 => 5.20.2Severity
blocking all usage of svelte
ryoppippi
Metadata
Metadata
Assignees
Labels
No labels