framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
18.06k stars 3.23k forks source link

@rollup/plugin-typescript TS2307: Cannot find module 'framework7/lite' #4055

Closed kayazinc closed 2 years ago

kayazinc commented 2 years ago

Describe the bug

I cannot reproduce using CodeSandbox. tbh i have no idea what is wrong since i have issue trying to import Framework7 module:

import Framework7 from 'framework7/lite' <--- does not work import Framework7 from 'framework7' <--- it works

Please advise me, thanks.

Below are the error messages:

[0] rollup-plugin-svelte: The following packages did not export their package.json file so we could not check the svelte field. If you had difficulties importing svelte components from a package, then please contact the author and ask them to export the package.json file. [0] - framework7 [0] - framework7-svelte

Additional context

Add any other context about the problem here.

AlwaysLoveme commented 2 years ago

Hi, i fixed this error, just waiting for code to merge, or you can copy code to "typesVersions" of package.json in "node_modules/framework7" just for temporarily resolved;

{
...

"typesVersions": {
    "*": {
      ".": [
        "./framework7.d.ts"
      ],
      "components/appbar": ["./components/appbar/appbar.d.ts"],
      "components/dialog": ["./components/dialog/dialog.d.ts"],
      "components/popup": ["./components/popup/popup.d.ts"],
      "components/login-screen": ["./components/login-screen/login-screen.d.ts"],
      "components/popover": ["./components/popover/popover.d.ts"],
      "components/actions": ["./components/actions/actions.d.ts"],
      "components/sheet": ["./components/sheet/sheet.d.ts"],
      "components/toast": ["./components/toast/toast.d.ts"],
      "components/preloader": ["./components/preloader/preloader.d.ts"],
      "components/progressbar": ["./components/progressbar/progressbar.d.ts"],
      "components/sortable": ["./components/sortable/sortable.d.ts"],
      "components/swipeout": ["./components/swipeout/swipeout.d.ts"],
      "components/accordion": ["./components/accordion/accordion.d.ts"],
      "components/contacts-list": ["./components/contacts-list/contacts-list.d.ts"],
      "components/virtual-list": ["./components/virtual-list/virtual-list.d.ts"],
      "components/list-index": ["./components/list-index/list-index.d.ts"],
      "components/timeline": ["./components/timeline/timeline.d.ts"],
      "components/tabs": ["./components/tabs/tabs.d.ts"],
      "components/panel": ["./components/panel/panel.d.ts"],
      "components/card": ["./components/card/card.d.ts"],
      "components/chip": ["./components/chip/chip.d.ts"],
      "components/form": ["./components/form/form.d.ts"],
      "components/input": ["./components/input/input.d.ts"],
      "components/checkbox": ["./components/checkbox/checkbox.d.ts"],
      "components/radio": ["./components/radio/radio.d.ts"],
      "components/toggle": ["./components/toggle/toggle.d.ts"],
      "components/range": ["./components/range/range.d.ts"],
      "components/stepper": ["./components/stepper/stepper.d.ts"],
      "components/smart-select": ["./components/smart-select/smart-select.d.ts"],
      "components/grid": ["./components/grid/grid.d.ts"],
      "components/calendar": ["./components/calendar/calendar.d.ts"],
      "components/picker": ["./components/picker/picker.d.ts"],
      "components/infinite-scroll": ["./components/infinite-scroll/infinite-scroll.d.ts"],
      "components/pull-to-refresh": ["./components/pull-to-refresh/pull-to-refresh"],
      "components/lazy": ["./components/lazy/lazy.d.ts"],
      "components/data-table": ["./components/data-table/data-table.d.ts"],
      "components/fab": ["./components/fab/fab.d.ts"],
      "components/searchbar": ["./components/searchbar/searchbar.d.ts"],
      "components/messages": ["./components/messages/messages.d.ts"],
      "components/messagebar": ["./components/messagebar/messagebar.d.ts"],
      "components/swiper": ["./components/swiper/swiper.d.ts"],
      "components/photo-browser": ["./components/photo-browser/photo-browser.d.ts"],
      "components/notification": ["./components/notification/notification.d.ts"],
      "components/autocomplete": ["./components/autocomplete/autocomplete.d.ts"],
      "components/tooltip": ["./components/tooltip/tooltip.d.ts"],
      "components/skeleton": ["./components/skeleton/skeleton.d.ts"],
      "components/menu": ["./components/menu/menu.d.ts"],
      "components/color-picker": ["./components/color-picker/color-picker.d.ts"],
      "components/treeview": ["./components/treeview/treeview.d.ts"],
      "components/text-editor": ["./components/text-editor/text-editor.d.ts"],
      "components/elevation": ["./components/elevation/elevation.d.ts"],
      "components/typography": ["./components/typography/typography.d.ts"],
      "lite": ["./framework7.d.ts"],
      "types": [
        "./framework7-types.d.ts"
      ]
    }
  },
...
}
yoyo930021 commented 2 years ago

The framework7/lite type is missing, but the component type isn't missing. You must see this guide. The component type will be correct.

Other type problem fixes in #4060.