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!
- 谷歌:无意统一Android和Chrome OS
- 三问凡客“毁三观”
- [连载]巨头“心血之作”终失败(六):RIM PlayBook
- react native - Handling loginlogout without user undefined errors - Stack Overflow
- rust - Why do I have to use &char instead of char to index a key in a HashMap<char, i32>? - Stack Overflow
- soa - How to use a variable in a composite or wsdl, as I need to have this variable per environment? - Stack Overflow
- performance testing - How to retrieve the dynamic value from the JMeter - Stack Overflow
- csv - How to Handle Clob Data Type in Excel When Exporting Data From DB2 Database - Stack Overflow
- c - How to properly implement HKDF Expand with openssl EVP_KDF - Stack Overflow
- sql - PostgreSQL ERROR: cannot accumulate arrays of different dimensionality - Stack Overflow
- How to implement GPU memory recycling in CUDA C++ for data streaming in TensorFlow? - Stack Overflow
- using Okta principal groups and metadata in Spring Boot with Okta Spring Boot - Stack Overflow
- javascript - Unable to locate tests within a folder - Stack Overflow
- c++ - Which option has precendence if I enable and disable FrontEndHeapDebugOptions at the same time? - Stack Overflow
- amazon web services - Python boto3: download files from s3 to local only if there are differences between s3 files and local one
- arkit - Detecting and Using 2 Different Vertical Planes - Stack Overflow
- java - Android physical keyboard support for key press and hold - Stack Overflow