Zettexe / svelte-ionic-starter

40 stars 3 forks source link

Getting error on IonicHelper.ts #1

Closed prokawsar closed 2 years ago

prokawsar commented 3 years ago

Steps I followed: Did clone, npm i, (at this point npm run dev:start should work) did npx cap add android change server.url to localhost:5000 then run npm run dev:android

Getting this error on local (no capacitor)

Error: IonicHelper.ts:2 Uncaught (in promise) SyntaxError: The requested module '/node_modules/.vite/@ionic_core.js?v=f318b351' does not provide an export named 'ActionSheetOptions'

dioxine commented 2 years ago

I have a similar error Unhandled Promise Rejection: SyntaxError: Importing binding name 'PickerOptions' is not found. going from IonicHelper.ts too. Seems it cannot get around with that imports. Maybe something changed in latest ViteJS versions. Will try to investigate.

dioxine commented 2 years ago

ok, functions and interfaces and types were together in one import

import {
  MenuI,
  loadingController,
  toastController,
  alertController,
  pickerController,
  actionSheetController,
  modalController,
  popoverController,
  ComponentProps,
  LoadingOptions,
  ToastOptions,
  AlertOptions,
  PickerOptions,
  ActionSheetOptions,
} from '@ionic/core';

correct way is to do like this

import {
  loadingController,
  toastController,
  alertController,
  pickerController,
  actionSheetController,
  modalController,
  popoverController,
} from '@ionic/core';

import type {
  MenuI,
  ComponentProps,
  LoadingOptions,
  ToastOptions,
  AlertOptions,
  PickerOptions,
  ActionSheetOptions,
} from '@ionic/core';

so, now everything works as expected. Hope this will help you!

Zettexe commented 2 years ago

Sorry for the late response.

I remember having issues with splitting the type declaration like this when I first made the project but it all seems fine now so I have pushed a commit implementing this change.