indaco / histoire-sveltekit

Template for new projects with support to Histoire, SvelteKit, Typescript, Plop, Vitest and Tailwind CSS.
MIT License
3 stars 1 forks source link

🐛 Histoire Bug ➡️ LinkError: WebAssembly.instantiate() #1

Closed oneezy closed 1 year ago

oneezy commented 1 year ago

Hey there @indaco ! I was checking out your histoire-sveltekit template and noticed this bug.

src-stories-button-button-story-svelte:1
- Uncaught (in promise) LinkError: WebAssembly.instantiate(): Import #4 module="env" function="setTempRet0" error: function import requires a callable

Any idea on what the problem could be?

image

indaco commented 1 year ago

hey @oneezy, how did you get there?

I tried right now (chrome, firefox and brave) and cannot see the error.

https://user-images.githubusercontent.com/13519/205002415-19392245-c904-4b6b-8f54-e41591413da9.mov

Thanks

oneezy commented 1 year ago

This is odd, but I cloned your template and went about using it that way .. that's how I saw the bug. BUT whenever I created a repo from your template and cloned it, everything worked! Not sure why .

Steps to reproduce:

  1. degit indaco/histoire-sveltekit my-app
  2. pnpm i
  3. pnpm story

OS: Windows 11 Pro (build - 22000.1219) Browser: Chrome - Version 107.0.5304.122 (Official Build) (64-bit) Node: 18.8.0 PNPM: 7.17.1 Terminal: Git Bash

oneezy commented 1 year ago

Now I'm actually getting another bug, but I'll create a separate issue for that

indaco commented 1 year ago

will investigate. Thanks for reporting it

@oneezy anyhow, I tried to create a sample project from scratch (not cloning this template or creating a new repo from it)

npm create svelte@latest histoire-test # skeleton, typescript, eslint, prettier, vitest
cd histoire-test
pnpm i
pnpm i -D histoire @histoire/plugin-svelte
touch histoire.config.ts
mkdir -p src/lib/components/
touch src/lib/components/foo.story.svelte

Add the story scripts to package.json

"story:dev": "histoire dev",
"story:build": "histoire build",
"story:preview": "histoire preview",

Edit histoire.config.ts

import { defineConfig } from 'histoire'
import { HstSvelte } from '@histoire/plugin-svelte'

export default defineConfig({
  plugins: [
    HstSvelte(),
  ],
})

Edit src/lib/components/foo.story.svelte

<script lang="ts">
    import type { Hst } from '@histoire/plugin-svelte';
    export let Hst: Hst;
</script>

<Hst.Story>Foo</Hst.Story>

run histoire

pnpm story:dev

and I get your original error

histoire-error

This is definitely odd!

This is odd, but I cloned your template and went about using it that way .. that's how I saw the bug. BUT whenever I created a repo from your template and cloned it, everything worked! Not sure why .

Steps to reproduce:

  1. degit indaco/histoire-sveltekit my-app
  2. pnpm i
  3. pnpm story

OS: Windows 11 Pro (build - 22000.1219) Browser: Chrome - Version 107.0.5304.122 (Official Build) (64-bit) Node: 18.8.0 PNPM: 7.17.1 Terminal: Git Bash

indaco commented 1 year ago

👍

Now I'm actually getting another bug, but I'll create a separate issue for that

indaco commented 1 year ago

histoire-dev/histoire/issues/383

oneezy commented 1 year ago

ahhh that is weird. Well, I'm glad you were able to reproduce it but it also sucks you were able to reproduce it lol.

Happy to see you got in a bug report for @Akryum already , he's pretty quick about addressing stuff so hopefully he'll get this one knocked out 😄