Skip to content

onMount No Longer Being Invoked on Svelte Upgrade v3.59.1 -> 4.0.5 #8961

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stricklandrbls opened this issue Jul 12, 2023 · 3 comments
Closed

Comments

@stricklandrbls
Copy link

stricklandrbls commented Jul 12, 2023

Describe the bug

In my VSCode extension, I am using Svelte for the UI of my web panel. I have created multiple .svelte components that have onMount running fine in Svelte v3.59.1 and Svelte-Check v3.4.3.

I recently upgrade Svelte to 4.0.5 and Svelte-Check to 3.4.5 and ever since this upgrade, none of the onMount functions in any of my components are being invoked.

Reproduction

Link to GitHub Repo Files
https://github.com/ctc-oss/daffodil-vscode/blob/implement-highlevel-svelte-components/src/svelte/src/components/DataDisplays/CustomByteDisplay/DataLineFeed.svelte

https://github.com/ctc-oss/daffodil-vscode/blob/implement-highlevel-svelte-components/src/svelte/src/components/DataDisplays/DataViewports.svelte

https://github.com/ctc-oss/daffodil-vscode/blob/implement-highlevel-svelte-components/src/svelte/src/components/Header/fieldsets/SearchReplace.svelte

Logs

No response

System Info

System:
    OS: Linux 6.2 Pop!_OS 22.04 LTS
    CPU: (12) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
    Memory: 20.95 GB / 31.26 GB
    Container: Yes
    Shell: 5.1.16 - /bin/bash
  Binaries:
    Node: 18.16.0 - ~/.local/bin/node
    Yarn: 1.22.19 - ~/.local/bin/yarn
    npm: 9.5.1 - ~/.local/bin/npm
    pnpm: 8.6.7 - ~/.local/bin/pnpm


### Severity

blocking an upgrade
@gtm-nayan
Copy link
Contributor

Duplicate of #8953

@gtm-nayan gtm-nayan marked this as a duplicate of #8953 Jul 12, 2023
@gtm-nayan
Copy link
Contributor

Add browser: true to your plugin-node-resolve, #8953 (comment)

@scholarsmate
Copy link

scholarsmate commented Jul 12, 2023

Thanks for this fix. I too was bitten by this change. Adding browser: true to the resolve section in my rollup.config.js worked. I didn't see anything about having to do this in the migration from v3 to v4 guide, but I think it deserves a mention as I'm sure many of us who are migrating will have this same problem.

    resolve({
      exportConditions: ['svelte'],
      extensions: ['.svelte'],
      dedupe: ['svelte'],
      browser: true,
    }),

dummdidumm added a commit that referenced this issue Jul 13, 2023
Ennoriel pushed a commit to sveltefr/svelte that referenced this issue Jul 25, 2023
Ennoriel pushed a commit to sveltefr/svelte that referenced this issue Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants