Plugin fails to load when migrated to Svelte 5 (issue might be due to my code)

I am trying to convert my whole code from React to Svelte 5. I wasn’t getting this issue, when I was using Svelte 4 concepts (stores), the plugin was working. But when I changed my whole code to svelte 5 (runes). The plugin is not loading anymore, like I am getting failed to load plugin Notice.

I am getting following warning in npm terminal :

> [email protected] dev
> node esbuild.config.mjs

(node:20892) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

▲ [WARNING] The CommonJS "module" variable is treated as a global variable in an ECMAScript module and may not work as expected [commonjs-variable-in-esm]

    src/shared.svelte.ts:42:0:
      42 │ module.exports = __toCommonJS(stdin_exports);
         ╵ ~~~~~~

  This file is considered to be an ECMAScript module because the enclosing "package.json" file sets
  the type of this file to "module":

    package.json:6:9:
      6 │   "type": "module",
        ╵           ~~~~~~~~

  Node's package format requires that CommonJS files in a "type": "module" package use the ".cjs"
  file extension.

Please ignore my code, its in worst state right now, as I am learning this new runes concept parallelly. This issue might be due to some bad coding practice (I have faced this in past). But since I got that warning, I want to ensure its not related to bundling or because of svelte 5 concepts, like Universal reactivity using runes.

The config files can be found from here : https://github.com/tu2-atmanand/Task-Board/tree/svelteMigration

Also, even though I am initializing all the shared variables (in the shared.svelte.ts file), I am getting the following warning. So the issue might have been the way I am using the reactive variables :

▲ [WARNING] Import "store" will always be undefined because the file "src/shared.svelte.ts" has no exports [import-is-undefined]

    src/utils/JsonFileOperations.ts:13:9:
      13 │ import { store } from "src/shared.svelte";

Found the solution for this problem from Discord : https://discord.com/channels/686053708261228577/840286264964022302/1322912952038195211

the problem seems to be that svelte preprocess turns your .svelte.ts files to cjs which then conflicts with the rest of your project that is in esm and your package.json "type": "module"

by simply removing "type": "module" from the package.json I can get it to build without warnings.

Thank you so much for the answer. The plugin works now without any warnings.