F7 Svelte Vite Typescript Bundle Problem

Hello,
I am developing a mobile app using F7 Svelte utilizing Vite as a bundler. After I convert the project scripting lang to typescript and recreate the node_modules directory, I take some errors like “app.f7.[input, sheet, etc.]” is “undefined”.
I have utilized git to detect changes in the “node_modules” directory and found out that changes occur in the “.vite” directory under the node_modules. When I overwrite the “.vite” directory with the old one no error occurs. But when I delete the “.vite” directory and recreate it using the “npm start” command, errors aforementioned above occur again.

The differences between “framework7_lite-bundle.ts” files in the “.vite” dir, before and after the node_modules dir recreated.

Thanks in advance for your helpings.

Error in console

I solved the problem at last. I think vite causes the problem while optimizing the f7 bundles. I added
optimizeDeps: {
exclude: [‘framework7’, ‘framework7-svelte’],
},
to vite.config.js and problem solved.

Many thanks to @AKSG.