Unexpected Error "has underlying svelte-native code changed?" on ns run ios / ns run android
See original GitHub issueIssue 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
- I have searched the existing issues as well as StackOverflow and this has not been posted before
- This is a bug report
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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
Nope. Running a 2019 MacBook Pro with 12.0.1 MacOS