Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Top-level await not working on ios platform #9667

Copy link
Copy link
Open
@mpcref

Description

@mpcref
Issue body actions

In order to be able to use top-level await I enabled it in my webpack.config.js file:

...
experiments: {
  topLevelAwait: true
}
...

Top-level await then works but only on android.
The moment a top-level await is encountered on ios, the app will just crash without any further information.

Expected behavior:

Either
Top-level await should work on ios like it does on android.
Or
A syntax error should be thrown so that I as a developer know why my app is crashing.

Ideally, top-level await would be supported out-of-the-box without having to enable it by setting the experimental flag.

Aside from this, I'm using NativeScript with Svelte and top-level await doesn't work on android either when used in *.svelte modules. I'm not sure if that would be automatically solved once this feature gets better support from NativeScript or whether this is a seperate Svelte-Native-specific issue.

How to reproduce:

  1. Enable the experimental feature flag in webpack.config.js
  2. Use the await keyword at the top-level of a module.
  3. Run the app on ios platform

Env

OS: macOS 12.0.1
CPU: (8) arm64 Apple M1
Shell: /bin/zsh
node: 17.0.1
npm: 8.1.0
nativescript: 8.1.4

# 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.8.9
ruby: 3.0.2
platforms: 
  - DriverKit 21.0.1
  - iOS 15.0
  - macOS 12.0
  - tvOS 15.0
  - watchOS 8.0

Dependencies

"dependencies": {
  "@nativescript-community/ui-material-bottomnavigationbar": "^6.2.2",
  "@nativescript/core": "^8.1.5",
  "@nativescript/theme": "^3.0.2",
  "nativescript-secure-storage": "^2.6.2",
  "nativescript-ui-listview": "^10.0.1",
  "svelte-native-nativescript-ui": "0.9.0"
},
"devDependencies": {
  "@nativescript/android": "8.1.1",
  "@nativescript/ios": "8.1.0",
  "@nativescript/unit-test-runner": "^2.0.2",
  "@nativescript/webpack": "^5.0.0",
  "@types/jasmine": "^3.10.0",
  "karma": "6.3.4",
  "karma-jasmine": "4.0.1",
  "karma-nativescript-launcher": "0.4.0",
  "karma-webpack": "5.0.0",
  "svelte": "3.44.0",
  "svelte-loader": "^3.0.0",
  "svelte-native": "^1.0.0",
  "svelte-native-preprocessor": "^1.0.0",
  "svelte-preprocess": "^4.9.8",
  "tslib": "^2.3.1",
  "typescript": "^4.4.4"
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.