How to import a svelte.ts component from another app where the import is with $lib - Stack Overflow
Hi im trying to import a svelte component from another svelte.ts app. This component has a script:
button.svelte:
<script lang="ts">
import { cn } from "$lib/utils.js";
let {
class: className,
variant = "default",
size = "default",
ref = $bindable(null),
href = undefined,
type = "button",
children,
...restProps
}: ButtonProps = $props();
</script>
Here an import is made:
import { cn } from "$lib/utils.js";
This import seems to cause an error when I import this component in a complete different svelte.ts app. The error that is caused looks like this:the error appearing
In my other app (I want to import the button into) the file tree is the exact same and I also have the utils.js in my lib folder and in my App.svelte I import the original component like this import {Button} from '../../ui/src/lib/components/ui/button/';
. I tried setting the aliases in my app but it still doesnt work. Maybe theres a quickfix? If you need more info just ask!
I was expecting that the button could just be imported. But it didnt work!
- IBM联合创新策略伙伴合作启动
- Unable to Access Event Data via Eventbrite API - 404 NOT_FOUND Error - Stack Overflow
- HTML code for removing lines when using slices for email signature that has multiple hyperlinks - Stack Overflow
- .net - Visual Studio shows "The application is in break mode" instead of underlining the problematic code - St
- javascript - Mapping through these JSON elements - Stack Overflow
- typescript - Declare object and internally refer to other values - Stack Overflow
- Flutter : Privacy screen implementation - Stack Overflow
- postgresql - Postgres Postgis ST_DWithin query is not accurate - Stack Overflow
- reactjs - How to deploy Laravel (with react) app on heroku without any error (like 419 error) - Stack Overflow
- node.js - node-gyp fails with parsing vs version: undefined - Stack Overflow
- json - How do I convert a string to a table in Lua? - Stack Overflow
- Font Size Mismatch When Using Fallback Fonts in FFmpeg ASS Subtitles - Stack Overflow
- node.js - Response body is null even though server is sending a non null response - Stack Overflow
- tsx - Does Inversify actually require emitDecoratorMetadata for Typescript? - Stack Overflow
- macos - Image from ImagePicker in landscape - Stack Overflow
- excel - Are there any advantages to use `Application.Match` on a VBA array instead of looping over it when you only care if an e
- Is it possible to determine if the Julia JIT will return a heap allocated or stack allocated return value from a function call?