Skip to content

josdejong/test-svelte5-rollup

Repository files navigation

Test issue with rollup bundle not working with Svelte 5

See josdejong/svelte-jsoneditor#476 (comment)

Relevant files:

  • src/lib/index.ts
  • src/lib/Test.svelte
  • rollup.config.js
  • test.html

Steps to reproduce the issue with Svelte 5:

  1. Install dependencies via npm install --force

  2. Run in develop mode to verify that the Svelte app itself works: npm run dev, then open your browser and check that you see "Test Component message: Hello world"

  3. Build the bundle via npm run build

  4. Start a local server like serve and open test.html in your browser. You should see the same message "Hello world" as in (2) but that is not the case. Open your browser console, that will show an error like:

    Uncaught TypeError: props is undefined
      prop props.js:226
      Test Test.svelte:2
      <anonymous> test.html:32
    

To verify that the rollup bundling works with Svelte 4:

  1. Open package.json and change the version of "svelte" from "5.0.0-next.205" to "4.2.18".
  2. Run npm install
  3. Execute steps (3) and (4) again: npm run build, then open test.html in your browser. Now, you'll see the "hello world" message and no errors in the browser console.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published