Skip to content

iOS Simulator Crash on HMR updates #10361

Closed

Description

@orbiteleven

Issue Description

I have a fresh install of Nativescript+Svelte, per https://svelte-native.technology/docs#quick-start. I have built and started the app. This successfully opens on my iOS Simulator. However, on the first and ever other code update, the app on the simulator crashes

Reproduction

ns create myapp --svelte
cd myapp
ns build ios
ns run ios

Make an update to app/components/Home.svelte.

Relevant log output (if applicable)

Refreshing application on device <device>...
  [HMR:Svelte] Up to date
  [HMR][93bc504aef60789ba4ce] success | Successfully applied update.
  ***** Fatal JavaScript exception - application has been terminated. *****
  NativeScript encountered a fatal error: Uncaught Error: View not added to this instance. View: Page(2) CurrentParent: undefined ExpectedParent: Frame(1)
  at
  _removeView(file: app/webpack:/myapp/node_modules/@nativescript/core/ui/core/view-base/index.js:583:0)
  at _removeEntry(file: app/webpack:/myapp/node_modules/@nativescript/core/ui/frame/frame-common.js:168:0)
  at _updateBackstack(file: app/webpack:/myapp/node_modules/@nativescript/core/ui/frame/frame-common.js:246:0)
  at setCurrent(file: app/webpack:/myapp/node_modules/@nativescript/core/ui/frame/index.ios.js:46:0)
  at UIViewControllerImpl.viewDidAppear(file: app/webpack:/myapp/node_modules/@nativescript/core/ui/page/index.ios.js:156:0)
Successfully synced application org.nativescript.myapp on device <device>

Environment

OS: macOS 13.4.1
CPU: (8) arm64 Apple M1
Shell: /opt/homebrew/bin/fish
node: 16.16.0
npm: 8.11.0
nativescript: 8.5.3

# android
java: javac 18
ndk: Not Found
apis: Not Found
build_tools: Not Found
system_images: Not Found

# ios
xcode: 14.3.1/14E300c
cocoapods: 1.11.3
python: 3.11.2
python3: 3.11.2
ruby: 3.1.2
platforms: 
  - DriverKit 22.4
  - iOS 16.4
  - macOS 13.3
  - tvOS 16.4
  - watchOS 9.4

Dependencies

"dependencies": {
  "@nativescript/core": "~8.5.0",
  "@nativescript/theme": "~3.0.2",
  "svelte-native": "~1.0.0"
},
"devDependencies": {
  "@nativescript/ios": "8.5.2",
  "@nativescript/preview-cli": "1.0.5",
  "@nativescript/types": "~8.5.0",
  "@nativescript/webpack": "~5.0.14",
  "svelte": "~3.44.0",
  "svelte-loader": "^3.1.2",
  "svelte-native-preprocessor": "^1.0.0",
  "svelte-preprocess": "^4.7.0",
  "typescript": "~4.8.4"
}

Please accept these terms

Activity

  1. vallemar commented on Aug 10, 2023

    @vallemar
    Contributor

    same error

  2. orbiteleven commented on Aug 10, 2023

    @orbiteleven
    Author

    FWIW I've had it suggested to me to call ns run ios --no-hmr. This works, but means the app does a full reload on every update. My hope is that this is just HMR being broken for iOS, not that Nativescript doesn't support HMR on iOS. If it is the latter, I guess it's a matter of updating documentation.

  3. PixsaOJ commented on Oct 7, 2024

    @PixsaOJ

    Error still here, I do never use hmr with vue 3 becuase it does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-pending-triageReported bug, pending triage to confirm.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions