Using vite-plugin-iso-import after updating to latest version of SvelteKit results in an error
See original GitHub issueDescribe the bug
I was using vite-plugin-iso-import successfully just fine for a few weeks. Today I updated SvelteKit from .144 to .162 and now I am getting this error when trying to start the server:
> The following dependencies are imported but could not be resolved:
text-field-edit?client (imported by /Users/kevin/Workspace/cn-sveltekit/src/lib/components/Textarea.svelte)
fit-textarea?client (imported by /Users/kevin/Workspace/cn-sveltekit/src/lib/components/Textarea.svelte)
Are they installed?
Why is this no longer working after the SvelteKit update, and how do I fix it?
Reproduction
My (simplified) Textarea.svelte
component:
<script>
import { onMount } from "svelte";
import { insert, wrapSelection, getSelection } from "text-field-edit?client";
import fitTextarea from "fit-textarea?client";
export let value = "";
let textarea;
onMount(() => {
fitTextarea.watch(textarea);
});
</script>
<textarea rows="3" bind:value bind:this={textarea} />
My svelte.config.js
file:
import md from "vite-plugin-markdown";
import { isoImport } from "vite-plugin-iso-import";
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
vite: {
plugins: [md.plugin({ mode: md.Mode.HTML }), isoImport()],
},
},
};
export default config;
Logs
No response
System Info
System:
OS: macOS 12.0
CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Memory: 28.36 MB / 32.00 GB
Shell: 3.3.1 - /usr/local/bin/fish
Binaries:
Node: 16.6.2 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 7.20.3 - /usr/local/bin/npm
Browsers:
Safari: 15.0
npmPackages:
@sveltejs/kit: next => 1.0.0-next.162
svelte: ^3.34.0 => 3.42.4
Severity
blocking all usage of SvelteKit
Additional Information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
FAQ • SvelteKit
Most issues related to including a library are due to incorrect packaging. Libraries work best with Vite when they distribute an ESM version...
Read more >Help! I have trouble updating SvelteKit! : r/sveltejs - Reddit
After updating a few dependencies, I have trouble running it on Vercel. It seems that the adapter-vercel library doesn't copy the static ...
Read more >Error installing sveltekit app after upgrading Node to latest ...
I recently upgraded node to the latest version (v16.15.1). After upgrading, I started a new sveltekit site using the following command:
Read more >Svelte Hacking #2 — client side imports | by Thomas McNicol
You will be greeted with an error such as window is not defined . The reason this error occurs is that when Svelte...
Read more >Migrating Breaking Changes in SvelteKit - Netlify
Depending on when you last upgraded, there may be other steps to follow. SvelteKit errors are pretty good and may help walk you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes please
I think we should transfer the issue to https://github.com/bluwy/vite-plugin-iso-import, the change in 146 can’t be reverted. I may have some ideas to fix this on the vite plugin’s end.