question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected Error "has underlying svelte-native code changed?" on ns run ios / ns run android

See original GitHub issue

Issue Description

When i run the Command ns run ios or ns run android the Project is builded succesfully but once the App is started it crashes with the Terminal Output below.

When i uncomment the else Block in “./node_modules/svelte-hmr/runtime/svelte-native/proxy-adapter-native.js” Line 132 everything works fine and the App is running

if (type === 'navigatedFrom') {
  this.navigatedFromHandler = handler
  if (ownOn) {
    originalNativeView.on = on
  } else {
    delete originalNativeView.on
  }
} else {
  throw new Error(
    'Unexpected call: has underlying svelte-native code changed?'
  )
}

Reproduction

No response

Relevant log output (if applicable)

NativeScript encountered a fatal error: Uncaught Error: Unexpected call: has underlying svelte-native code changed?
at
originalNativeView.on(file: app/webpack:/simplemenu/node_modules/svelte-hmr/runtime/svelte-native/proxy-adapter-native.js:140:0)
at setWindowContent(file: app/webpack:/***/node_modules/@nativescript/core/application/index.ios.js:270:0)
at notifyAppStarted(file: app/webpack:/***/node_modules/@nativescript/core/application/index.ios.js:169:0)
at didFinishLaunchingWithOptions(file: app/webpack:/***/node_modules/@nativescript/core/application/index.ios.js:152:0)
at NotificationObserver.onReceive(file: app/webpack:/***/node_modules/@nativescript/core/application/index.ios.js:42:0)

Environment

OS: macOS 12.0.1
CPU: (10) x64 Apple M1 Pro
Shell: /bin/zsh
node: 14.15.1
npm: 8.3.0
nativescript: 8.1.5

# android
java: 15.0.2
ndk: Not Found
apis: Not Found
build_tools: Not Found
system_images: Not Found

# ios
xcode: 13.1/13A1030d
cocoapods: 1.11.2
python: 2.7.18
python3: 3.9.7
ruby: 2.6.8
platforms: 
  - DriverKit 21.0.1
  - iOS 15.0
  - macOS 12.0
  - tvOS 15.0
  - watchOS 8.0

Dependencies

"dependencies": {
  "@nativescript/core": "~8.1.1",
  "@nativescript/theme": "~3.0.1",
  "svelte-native": "~1.0.0"
},
"devDependencies": {
  "@nativescript/ios": "8.1.0",
  "@nativescript/types": "~8.1.1",
  "@nativescript/webpack": "~5.0.0",
  "svelte": "~3.44.0",
  "svelte-loader": "^3.1.2",
  "svelte-native-preprocessor": "^1.0.0",
  "svelte-preprocess": "^4.7.0",
  "typescript": "~4.3.5"
}

Please accept these terms

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
halfnelsoncommented, Dec 18, 2021

hrm, my first guess is that this is a regression in svelte loader, but I will dig in. The eternal conundrum of pinning to known working versions of dependencies vs accepting minor versions for security and fixes

0reactions
FilipSzutkowskicommented, Dec 19, 2021

Sorry for the late reply. Yes its a completely new App, nothing modified at this point. Im curious, maybe has something to do with the Platform? @FilipSzutkowski are you running a M1 Macbook?

Nope. Running a 2019 MacBook Pro with 12.0.1 MacOS

Read more comments on GitHub >

github_iconTop Results From Across the Web

API Docs • Svelte Native
NativeScript is an open-source framework to develop apps on the Apple iOS and Android ... Svelte-Native runs on top of an unmodified NativeScript...
Read more >
The Preview service has been disabled until further notice ...
The Playground and the Preview app has been disabled until ... With ns run you can deploy your app to your iOS/Android device...
Read more >
ns run android - Fig.io
Name, Description. --env.aot, Creates an Ahead-Of-Time build (Angular only). --env.uglify, Provides basic obfuscation and smaller app size.
Read more >
Svelte Native - First Impressions - Coder's Coffee House
The actionBarHidden attribute is optional but adding this made it look consistent across Android and iOS. Now npn run will work. Depending on ......
Read more >
nativescript - npm
What is NativeScript. NativeScript is a cross-platform JavaScript framework that lets you develop native iOS and Android apps from a single code ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found