Issues using Typescript with F7 Core Version 8.3.0. Anybody seen these?

Hi, after creating a new Framework7 project (no Vue or React) using the CLI and converting some files to typescript, i’m getting a lot of build errors. The project runs fine using npm start but not using npm run build.

I created a repository with the code that reproduces the issue. Clone the repo, then run “npm install && npm run build”. Does anybody know how to resolve this issue with the build ? I spent a week on this without being able to figure it out. Thanks!

https://github.com/biguphpc/f7-tester
F7 Version: v8.3.0

tester$ npm run build

> [email protected] build
> cross-env NODE_ENV=production vite build && npx workbox generateSW workbox-config.js

vite v4.5.0 building for production...
node_modules/framework7/framework7-types.d.ts (4:21) "Support" is not exported by "node_modules/framework7/shared/get-support.js", imported by "node_modules/framework7/framework7-types.d.ts".
node_modules/framework7/framework7-types.d.ts (5:20) "Device" is not exported by "node_modules/framework7/shared/get-device.js", imported by "node_modules/framework7/framework7-types.d.ts".
... more warnings
node_modules/framework7/framework7-types.d.ts (87:9) "VirtualList" is not exported by "node_modules/framework7/components/virtual-list/virtual-list.js", imported by "node_modules/framework7/framework7-types.d.ts".
✓ 241 modules transformed.
✓ built in 7.34s
"Support" is not exported by "node_modules/framework7/shared/get-support.js", imported by "node_modules/framework7/framework7-types.d.ts".
file: /tmp/tester/node_modules/framework7/framework7-types.d.ts:4:21
2: import Framework7 from './components/app/app-class.js'
3: 
4: import { getSupport, Support } from './shared/get-support.js';
                        ^
5: import { getDevice, Device } from './shared/get-device.js';
6: import { Utils } from './shared/utils.js';
error during build:
RollupError: "Support" is not exported by "node_modules/framework7/shared/get-support.js", imported by "node_modules/framework7/framework7-types.d.ts".
    at error (file:///tmp/tester/node_modules/rollup/dist/es/shared/node-entry.js:2287:30)
    at Module.error (file:///tmp/tester/node_modules/rollup/dist/es/shared/node-entry.js:13745:16)
    at Module.traceVariable (file:///tmp/tester/node_modules/rollup/dist/es/shared/node-entry.js:14175:29)
    at Module.getVariableForExportName (file:///tmp/tester/node_modules/rollup/dist/es/shared/node-entry.js:13925:35)
    at Module.includeAllExports (file:///tmp/tester/node_modules/rollup/dist/es/shared/node-entry.js:13974:39)
    at Module.includeAllInBundle (file:///tmp/tester/node_modules/rollup/dist/es/shared/node-entry.js:13999:14)
    at Graph.includeStatements (file:///tmp/tester/node_modules/rollup/dist/es/shared/node-entry.js:25834:24)
    at Graph.build (file:///tmp/tester/node_modules/rollup/dist/es/shared/node-entry.js:25740:14)
    at async file:///tmp/tester/node_modules/rollup/dist/es/shared/node-entry.js:26706:13
    at async catchUnfinishedHookActions (file:///tmp/tester/node_modules/rollup/dist/es/shared/node-entry.js:25910:16)
    at async rollupInternal (file:///tmp/tester/node_modules/rollup/dist/es/shared/node-entry.js:26701:5)
    at async build (file:///tmp/tester/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:48079:18)
    at async CAC.<anonymous> (file:///tmp/tester/node_modules/vite/dist/node/cli.js:842:9)

I’ve made some progress by changing imports in the typescript files from import from 'framework7/types' to import from 'framework7/bundle' and now Vite can properly build the project.

VSCode doesn’t recognize the bundle import and shows an error. Maybe there’s a way to map bundle to types ? Let me know if someone has a solution, thanks.

Could not find a declaration file for module 'framework7/bundle'. '/workspace/node_modules/framework7/framework7-bundle.esm.js' implicitly has an 'any' type.
  If the 'framework7' package actually exposes this module, try adding a new declaration (.d.ts) file containing `declare module 'framework7/bundle';`ts(7016)