问:
Flutter Release APK for playstore
I am trying to generate a build apk, but getting following error.
this is compatible with flutter version 2.8.1

Getting following error while run flutter build apk

```<code>/home/dell/snap/flutter/common/flutter/bin/flutter --no-color build apk

Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

Running Gradle task 'assembleRelease'...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

Note: /home/dell/.pub-cache/hosted/pub.dartlang.org/geocoding-2.0.2/android/src/main/java/com/baseflow/geocoding/GeocodingPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/dell/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-2.1.1/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/dell/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.11/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
e: /var/projects/app/freshooo/android/app/src/main/kotlin/com/u6amtech/flutter_grocery/Application.kt: (11, 51): Unresolved reference: setPluginRegistrant
e: /var/projects/app/freshooo/android/app/src/main/kotlin/com/u6amtech/flutter_grocery/FirebaseCloudMessagingPluginRegistrant.kt: (15, 44): Unresolved reference: registerWith
</code>```

FAILURE: Build failed with an exception.

```<code>* What went wrong:
Execution failed for task ':app:compileReleaseKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 6s
Running Gradle task 'assembleRelease'...                          126.8s
Gradle task assembleRelease failed with exit code 1
</code>```

pubspec.yaml

```<code>name: flutter_grocery
description: A new Flutter application.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.1.0+2

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

  cupertino_icons: ^1.0.2
  get_it: ^6.0.0
  provider: ^5.0.0
  http: ^0.13.1
  freezed: ^0.14.1
  shared_preferences: ^2.0.5
  photo_view: ^0.12.0
  dio: ^4.0.0-prev2
  image_picker: ^0.7.3
  pin_code_fields: ^7.0.0
  google_maps_flutter_web: ^0.3.0
  google_maps_flutter: ^2.0.3
  flutter_google_places: ^0.3.0
  geocoding: ^2.0.0
  geolocator: ^7.0.1
  shimmer_animation: ^2.0.0
  url_launcher: ^6.0.2
  webview_flutter: ^2.0.2
  firebase_core: ^1.7.0
  firebase_messaging: ^10.0.8
  flutter_local_notifications: ^8.2.0
  path_provider: ^2.0.1
  flutter_html: ^2.0.0-nullsafety.0
  connectivity: ^3.0.2
  carousel_slider: ^4.0.0-nullsafety.0
  fluro: ^2.0.3
  url_strategy: ^0.2.0
  universal_html: ^2.0.8
  universal_ui: ^0.0.8
  flutter_widget_from_html_core: ^0.6.1
  phone_number: ^0.11.0+2
  country_code_picker: ^2.0.2
  flutter_typeahead: ^3.1.3

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

  assets:
    - assets/image/
    - assets/language/

  fonts:
    - family: Poppins
      fonts:
        - asset: assets/font/Poppins-Light.ttf
          weight: 300
        - asset: assets/font/Poppins-Regular.ttf
          weight: 400
        - asset: assets/font/Poppins-Medium.ttf
          weight: 500
        - asset: assets/font/Poppins-SemiBold.ttf
          weight: 600
        - asset: assets/font/Poppins-Bold.ttf
          weight: 700
</code>```

app/build.gradle

```<code>def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
    compileSdkVersion 30

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.fresh.grocery"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
    }

    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
            storePassword keystoreProperties['storePassword']
        }
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "com.google.firebase:firebase-messaging:21.0.1"
    implementation 'com.android.support:multidex:1.0.3'
}
</code>```

android/build.gradle

```<code>buildscript {
    ext.kotlin_version = '1.5.20'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.4'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.5'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }

    tasks.withType(JavaCompile) {
        options.compilerArgs << '-Xlint:-options'
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
</code>```

gradle-wrapper.properties

```<code>#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-6.3-all.zip
</code>```

key.properties

```<code>storePassword=123456
keyPassword=123456
keyAlias=upload
storeFile=~/home/dell/upload-keystore.jks
</code>```

Project Setting

答:
For release playstore build change

this in app/build.gradle

```<code>    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
</code>```

to

```<code>    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.release
        }
    }
</code>```

Title: Flutter Release APK for playstore

Body:
I am trying to generate a build apk, but getting following error.
this is compatible with flutter version 2.8.1

Getting following error while run flutter build apk

/home/dell/snap/flutter/common/flutter/bin/flutter --no-color build apk

Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

Running Gradle task 'assembleRelease'...
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01

Note: /home/dell/.pub-cache/hosted/pub.dartlang.org/geocoding-2.0.2/android/src/main/java/com/baseflow/geocoding/GeocodingPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/dell/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-2.1.1/android/src/main/java/io/flutter/plugins/googlemaps/Convert.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/dell/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.11/android/src/main/java/io/flutter/plugins/pathprovider/PathProviderPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
e: /var/projects/app/freshooo/android/app/src/main/kotlin/com/u6amtech/flutter_grocery/Application.kt: (11, 51): Unresolved reference: setPluginRegistrant
e: /var/projects/app/freshooo/android/app/src/main/kotlin/com/u6amtech/flutter_grocery/FirebaseCloudMessagingPluginRegistrant.kt: (15, 44): Unresolved reference: registerWith

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileReleaseKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 6s
Running Gradle task 'assembleRelease'...                          126.8s
Gradle task assembleRelease failed with exit code 1

pubspec.yaml

name: flutter_grocery
description: A new Flutter application.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.1.0+2

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter

  cupertino_icons: ^1.0.2
  get_it: ^6.0.0
  provider: ^5.0.0
  http: ^0.13.1
  freezed: ^0.14.1
  shared_preferences: ^2.0.5
  photo_view: ^0.12.0
  dio: ^4.0.0-prev2
  image_picker: ^0.7.3
  pin_code_fields: ^7.0.0
  google_maps_flutter_web: ^0.3.0
  google_maps_flutter: ^2.0.3
  flutter_google_places: ^0.3.0
  geocoding: ^2.0.0
  geolocator: ^7.0.1
  shimmer_animation: ^2.0.0
  url_launcher: ^6.0.2
  webview_flutter: ^2.0.2
  firebase_core: ^1.7.0
  firebase_messaging: ^10.0.8
  flutter_local_notifications: ^8.2.0
  path_provider: ^2.0.1
  flutter_html: ^2.0.0-nullsafety.0
  connectivity: ^3.0.2
  carousel_slider: ^4.0.0-nullsafety.0
  fluro: ^2.0.3
  url_strategy: ^0.2.0
  universal_html: ^2.0.8
  universal_ui: ^0.0.8
  flutter_widget_from_html_core: ^0.6.1
  phone_number: ^0.11.0+2
  country_code_picker: ^2.0.2
  flutter_typeahead: ^3.1.3

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

  assets:
    - assets/image/
    - assets/language/

  fonts:
    - family: Poppins
      fonts:
        - asset: assets/font/Poppins-Light.ttf
          weight: 300
        - asset: assets/font/Poppins-Regular.ttf
          weight: 400
        - asset: assets/font/Poppins-Medium.ttf
          weight: 500
        - asset: assets/font/Poppins-SemiBold.ttf
          weight: 600
        - asset: assets/font/Poppins-Bold.ttf
          weight: 700

app/build.gradle

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'

def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
    keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}

android {
    compileSdkVersion 30

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    lintOptions {
        disable 'InvalidPackage'
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.fresh.grocery"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
    }

    signingConfigs {
        release {
            keyAlias keystoreProperties['keyAlias']
            keyPassword keystoreProperties['keyPassword']
            storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
            storePassword keystoreProperties['storePassword']
        }
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "com.google.firebase:firebase-messaging:21.0.1"
    implementation 'com.android.support:multidex:1.0.3'
}

android/build.gradle

buildscript {
    ext.kotlin_version = '1.5.20'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.4'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:4.3.5'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }

    tasks.withType(JavaCompile) {
        options.compilerArgs << '-Xlint:-options'
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

gradle-wrapper.properties

#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-6.3-all.zip

key.properties

storePassword=123456
keyPassword=123456
keyAlias=upload
storeFile=~/home/dell/upload-keystore.jks

Project Setting

Body:
For release playstore build change

this in app/build.gradle

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }

to

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.release
        }
    }


来源: stackexchange

问:
(long) i + (int) j * k What is the type of the expression?
```<code>int i;
long j;
unsigned int k;
</code>```

I'm new to learning C, and can't figure this out. I've tried looking online many times for similar expressions. I honestly don't need the answer I really just want to understand how to figure it out. This has to do with mixing data types and I've only come across little information about what they are, but nothing clear to understand. Any help would be appreciated to understand how to figure out the data type for the following expression (long) i + (int) j * k

I appreciate any answers! Thank you!

答:
Check out Implicit type promotion rules. Then use that together with operator precedence to figure out how which operands that bind to each other - type promotion will be per sub expression, then the resulting type of each sub expression becomes the operand for the next.

Multiplication naturally has higher precedence than addition and casts have higher precedence still, so the expression is equivalent to this:

 ((long)i) + ( ((int)j) * k )

In the subexpression inside the parenthesis, there's an explicit conversion of j to int, then the usual arithmetic conversions as per the above link determines the type used for that subexpression. It also becomes the resulting type used when determining what type to use for the addition. Once again, it's the usual arithmetic conversions.

ContentLicense: CC BY-SA 4.0

Body:
int i;
long j;
unsigned int k;

I'm new to learning C, and can't figure this out. I've tried looking online many times for similar expressions. I honestly don't need the answer I really just want to understand how to figure it out. This has to do with mixing data types and I've only come across little information about what they are, but nothing clear to understand. Any help would be appreciated to understand how to figure out the data type for the following expression (long) i + (int) j * k

I appreciate any answers! Thank you!


问:
View margin not working after using databinding
Below is the code of the item layout of gridview. In this, the layout_margin is there in the design panel but when I run the there is no margin. I tried to check other tags like the background and found that it was working.
A similar problem is with the layout_weights of linear_layout, the are also not working. These were working fine without data binding.
Can someone please help me out in resolving this?
'''

```<code><?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <variable
            name="localEntry"
            type="com.example.lo_cal.data.models.LoCalEntry" />
    </data>

    <androidx.appcompat.widget.LinearLayoutCompat
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/small"
        android:background="@color/colorAccent"
        android:orientation="vertical">

        <TextView
            android:id="@+id/item_id"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:itemId="@{localEntry}"
            tools:text="ID" />

        <TextView
            android:id="@+id/item_first_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{localEntry.firstName}"
            tools:text="shashank" />

        <TextView
            android:id="@+id/item_second_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{localEntry.secondName}"
            tools:text="mohabia" />

        <TextView
            android:id="@+id/item_result"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{localEntry.result}"
            tools:text="100" />
    </androidx.appcompat.widget.LinearLayoutCompat>
</layout>
</code>```

'''

答:
I faced the same issue, and found out that, when using dataBinding,  the margin is ignored for the direct children of the dataBinding , and will always stretch to fill any space around.

The simples way to solve it is to wrap the view from which you want a margin in a frameLayout for exemple, so that even the frameLayout is stretched, the view inside it will keep it position and its margins.

so in your case, what you need is to just wrap your

<androidx.appcompat.widget.LinearLayoutCompat> in another layout on which you can set the width and height to wrap_content.

Body:
Below is the code of the item layout of gridview. In this, the layout_margin is there in the design panel but when I run the there is no margin. I tried to check other tags like the background and found that it was working.
A similar problem is with the layout_weights of linear_layout, the are also not working. These were working fine without data binding.
Can someone please help me out in resolving this?
'''

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools">

    <data>

        <variable
            name="localEntry"
            type="com.example.lo_cal.data.models.LoCalEntry" />
    </data>

    <androidx.appcompat.widget.LinearLayoutCompat
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/small"
        android:background="@color/colorAccent"
        android:orientation="vertical">

        <TextView
            android:id="@+id/item_id"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            app:itemId="@{localEntry}"
            tools:text="ID" />

        <TextView
            android:id="@+id/item_first_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{localEntry.firstName}"
            tools:text="shashank" />

        <TextView
            android:id="@+id/item_second_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{localEntry.secondName}"
            tools:text="mohabia" />

        <TextView
            android:id="@+id/item_result"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@{localEntry.result}"
            tools:text="100" />
    </androidx.appcompat.widget.LinearLayoutCompat>
</layout>

'''


问:
Generate image snapshots using Docker with Playwright
Locally, I can do the following:

import { test, expect } from '@playwright/test';

test('should work', async ({ page }) => {
  await page.goto(`https://playwright.dev`);
  expect(await page.screenshot()).toMatchSnapshot('test.png');
});
```
<pre class="lang-sh prettyprint-override"><code>npx playwright test --update-snapshots
</code>```

This works fine, but I want to generate the files via Docker so they're the same as when they run in CI. On the docs, the command is:

docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.12.3-focal /bin/bash
npm install
npx playwright test --update-snapshots
```

This fails, just showing a red test. The docs don't mention much more than this, what is the solution here? I'm on an M1 Mac if it makes a difference.

    browserContext.newPage: Browser closed.
    ==================== Browser output: ====================
    [pid=600][err] #8 0x00400667b49e <unknown>
    [pid=600][err] #9 0x00400343b226 <unknown>
    [pid=600][err] #10 0x00400ef190b3 <unknown>
    [pid=600][err] #11 0x00400343b02a <unknown>
    [pid=600][err] Crash keys:
    [pid=600][err]   "switch-7" = "--enable-crashpad"
    [pid=600][err]   "switch-6" = "--change-stack-guard-on-fork=enable"
    [pid=600][err]   "switch-5" = "--user-data-dir=/tmp/playwright_chromiumdev_profile-Dveenw"
    [pid=600][err]   "switch-4" = "--enable-crash-reporter=,"
    [pid=600][err]   "switch-3" = "--crashpad-handler-pid=605"
    [pid=600][err]   "switch-2" = "--enable-crashpad"
    [pid=600][err]   "switch-1" = "--no-sandbox"
    [pid=600][err]   "num-switches" = "8"
    [pid=600][err]
    [pid=600][err] Received signal 6
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #8 0x004006af4a5e <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #9 0x004006680c57 <unknown>
    [pid=600][err] #2 0x004006b75a71 <unknown>
    [pid=600][err] #10 0x00400667b7ae <unknown>
    [pid=600][err] #3 0x00400e1f43c0 <unknown>
    [pid=600][err] #11 0x00400667d16b <unknown>
    [pid=600][err] #4 0x00400ef3818b <unknown>
    [pid=600][err] #5 0x00400ef17859 <unknown>
    [pid=600][err] #6 0x004006b74d05 <unknown>
    [pid=600][err] #12 0x00400667a9c5 <unknown>
    [pid=600][err] #7 0x004006af433f <unknown>
    [pid=600][err] #13 0x00400667b49e <unknown>
    [pid=600][err] #8 0x004006af4a5e <unknown>
    [pid=600][err] #14 0x00400343b226 <unknown>
    [pid=600][err] #9 0x004006680c57 <unknown>
    [pid=600][err] #15 0x00400ef190b3 <unknown>
    [pid=600][err] #16 0x00400343b02a <unknown>
    [pid=600][err] #10 0x00400667b7ae <unknown>
    [pid=600][err]   r8: 0000000000000000  r9: 000000400e1986f0 r10: 0000000000000008 r11: 000000400f0b2780
    [pid=600][err]  r12: 00002448000ec500 r13: 000000400e198950 r14: 00002448000ec510 r15: aaaaaaaaaaaaaaaa
    [pid=600][err]   di: 0000000000000002  si: 000000400e1986f0  bp: 000000400e198940  bx: 000000401027f900
    [pid=600][err]   dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000027  sp: 000000400e1986f0
    [pid=600][err]   ip: 000000400ef3818b efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
    [pid=600][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
    [pid=600][err] [end of stack trace]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    [pid=600][err] <unknown>
    [pid=600][err] #11 0x00400667d16b <unknown>
    [pid=600][err] #12 0x00400667a9c5 <unknown>
    [pid=600][err] #13 0x00400667b49e <unknown>
    [pid=600][err] #14 0x00400343b226 <unknown>
    [pid=600][err] #15 0x00400ef190b3 <unknown>
    [pid=600][err] #16 0x00400343b02a <unknown>
    [pid=600][err]   r8: 0000000000000000  r9: 000000400e198710 r10: 0000000000000008 r11: 000000400f0b2780
    [pid=600][err]  r12: 0000109000184500 r13: 000000400e198970 r14: 0000109000184510 r15: aaaaaaaaaaaaaaaa
    [pid=600][err]   di: 0000000000000002  si: 000000400e198710  bp: 000000400e198960  bx: 000000401027f900
    [pid=600][err]   dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000027  sp: 000000400e198710
    [pid=600][err]   ip: 000000400ef3818b efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
    [pid=600][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
    [pid=600][err] [end of stack trace]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    [pid=600][err] [600:626:1118/015549.682667:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)
    [pid=600][err] [600:600:1118/015549.767331:FATAL:ozone_platform_x11.cc(238)] Check failed: x11::Connection::Get()->Ready(). Missing X server or $DISPLAY
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006af3f10 <unknown>
    [pid=600][err] #3 0x004006af4a5e <unknown>
    [pid=600][err] #4 0x004003d7ba29 <unknown>
    [pid=600][err] #5 0x004003d19067 <unknown>
    [pid=600][err] #6 0x00400824b507 <unknown>
    [pid=600][err] #7 0x00400824b49a <unknown>
    [pid=600][err] #8 0x00400471509f <unknown>
    [pid=600][err] #9 0x004004715a4d <unknown>
    [pid=600][err] #10 0x004004711dfb <unknown>
    [pid=600][err] #11 0x00400667d692 <unknown>
    [pid=600][err] #12 0x00400667d157 <unknown>
    [pid=600][err] #13 0x00400667a9c5 <unknown>
    [pid=600][err] #14 0x00400667b49e <unknown>
    [pid=600][err] #15 0x00400343b226 <unknown>
    [pid=600][err] #16 0x00400ef190b3 <unknown>
    [pid=600][err] #17 0x00400343b02a <unknown>
    [pid=600][err] Crash keys:
    [pid=600][err]   "io_scheduler_async_stack" = "0x40044F7FE4 0x0"
    [pid=600][err]   "variations" = "19ebe09a-720b026c,23a898eb-fc93cf74,5f2c0f7c-3f4a17df,e4a357e9-3f4a17df,"
    [pid=600][err]   "num-experiments" = "4"
    [pid=600][err]   "switch-30" = "--enable-crashpad"
    [pid=600][err]   "switch-29" = "--no-startup-window"
    [pid=600][err]   "switch-28" = "--remote-debugging-pipe"
    [pid=600][err]   "switch-27" = "--user-data-dir=/tmp/playwright_chromiumdev_profile-Dveenw"
    [pid=600][err]   "switch-26" = "--no-sandbox"
    [pid=600][err]   "switch-25" = "--no-service-autorun"
    [pid=600][err]   "switch-24" = "--use-mock-keychain"
    [pid=600][err]   "switch-23" = "--password-store=basic"
    [pid=600][err]   "switch-22" = "--enable-automation"
    [pid=600][err]   "switch-21" = "--no-first-run"
    [pid=600][err]   "switch-20" = "--metrics-recording-only"
    [pid=600][err]   "switch-19" = "--force-color-profile=srgb"
    [pid=600][err]   "switch-18" = "--disable-sync"
    [pid=600][err]   "switch-17" = "--disable-renderer-backgrounding"
    [pid=600][err]   "switch-16" = "--disable-prompt-on-repost"
    [pid=600][err]   "switch-15" = "--disable-popup-blocking"
    [pid=600][err]   "switch-14" = "--disable-ipc-flooding-protection"
    [pid=600][err]   "switch-13" = "--disable-hang-monitor"
    [pid=600][err]   "switch-12" = "--allow-pre-commit-input"
    [pid=600][err]   "switch-11" = "--disable-features=ImprovedCookieControls,LazyFrameLoading,Globa"
    [pid=600][err]   "switch-10" = "--disable-extensions"
    [pid=600][err]   "switch-9" = "--disable-dev-shm-usage"
    [pid=600][err]   "switch-8" = "--disable-default-apps"
    [pid=600][err]   "switch-7" = "--disable-component-extensions-with-background-pages"
    [pid=600][err]   "switch-6" = "--disable-client-side-phishing-detection"
    [pid=600][err]   "switch-5" = "--disable-breakpad"
    [pid=600][err]   "switch-4" = "--disable-backgrounding-occluded-windows"
    [pid=600][err]   "switch-3" = "--disable-background-timer-throttling"
    [pid=600][err]   "switch-2" = "--enable-features=NetworkService,NetworkServiceInProcess"
    [pid=600][err]   "switch-1" = "--disable-background-networking"
    [pid=600][err]   "num-switches" = "30"
    [pid=600][err]   "osarch" = "x86_64"
    [pid=600][err]   "pid" = "600"
    [pid=600][err]   "ptype" = "browser"
    [pid=600][err]
    [pid=600][err] [1118/015550.409146:ERROR:scoped_ptrace_attach.cc(27)] ptrace: Function not implemented (38)
    [pid=600][err] Received signal 6
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006b75a71 <unknown>
    [pid=600][err] #3 0x00400e1f43c0 <unknown>
    [pid=600][err] #4 0x00400ef3818b <unknown>
    [pid=600][err] #5 0x00400ef17859 <unknown>
    [pid=600][err] #6 0x004006b74d05 <unknown>
    [pid=600][err] #7 0x004006af433f <unknown>
    [pid=600][err] #8 0x004006af4a5e <unknown>
    [pid=600][err] #9 0x004003d7ba29 <unknown>
    [pid=600][err] #10 0x004003d19067 <unknown>
    [pid=600][err] #11 0x00400824b507 <unknown>
    [pid=600][err] #12 0x00400824b49a <unknown>
    [pid=600][err] #13 0x00400471509f <unknown>
    [pid=600][err] #14 0x004004715a4d <unknown>
    [pid=600][err] #15 0x004004711dfb <unknown>
    [pid=600][err] #16 0x00400667d692 <unknown>
    [pid=600][err] #17 0x00400667d157 <unknown>
    [pid=600][err] #18 0x00400667a9c5 <unknown>
    [pid=600][err] #19 0x00400667b49e <unknown>
    [pid=600][err] #20 0x00400343b226 <unknown>
    [pid=600][err] #21 0x00400ef190b3 <unknown>
    [pid=600][err] #22 0x00400343b02a <unknown>
    [pid=600][err]   r8: 0000000000000000  r9: 000000400e198310 r10: 0000000000000008 r11: 0000000000000000
    [pid=600][err]  r12: 000025e0000dd400 r13: 000000400e198570 r14: 000025e0000dd410 r15: aaaaaaaaaaaaaaaa
    [pid=600][err]   di: 0000000000000002  si: 000000400e198310  bp: 000000400e198560  bx: 000000401027f900
    [pid=600][err]   dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000027  sp: 000000400e198310
    [pid=600][err]   ip: 000000400ef3818b efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
    [pid=600][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
    [pid=600][err] [end of stack trace]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    =========================== logs ===========================
    <launching> /ms-playwright/chromium-930007/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-Dveenw --remote-debugging-pipe --no-startup-window
    <launched> pid=600
    [pid=600][err] [1118/015547.764472:ERROR:stack_trace_posix.cc(704)] Failed to parse the contents of /proc/self/maps
    [pid=600][err] [1118/015548.307639:ERROR:stack_trace_posix.cc(704)] Failed to parse the contents of /proc/self/maps
    [pid=600][err] [1118/015548.307646:ERROR:stack_trace_posix.cc(704)] Failed to parse the contents of /proc/self/maps
    [pid=600][err] [1118/015548.494378:FATAL:nacl_helper_linux.cc(435)] Check failed: nacl_sandbox->IsSingleThreaded().
    [pid=600][err] #0 0x004000240779 <unknown>
    [pid=600][err] #1 0x00400020c063 <unknown>
    [pid=600][err] #2 0x00400020e6d0 <unknown>
    [pid=600][err] #3 0x00400020f21e <unknown>
    [pid=600][err] #4 0x00400017fd6a <unknown>
    [pid=600][err] #5 0x004001e3e0b3 <unknown>
    [pid=600][err] #6 0x00400017f9ea <unknown>
    [pid=600][err]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    [pid=600][err] [618:618:1118/015548.584016:ERROR:nacl_fork_delegate_linux.cc(329)] Bad NaCl helper startup ack (0 bytes)
    [pid=600][err] [615:615:1118/015548.358993:FATAL:zygote_main_linux.cc(161)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006af3f10 <unknown>
    [pid=600][err] #3 0x004006af4a5e <unknown>
    [pid=600][err] #4 0x004006680c57 <unknown>
    [pid=600][err] #5 0x00400667b7ae <unknown>
    [pid=600][err] #6 0x00400667d16b <unknown>
    [pid=600][err] #7 0x00400667a9c5 <unknown>
    [pid=600][err] #8 0x00400667b49e <unknown>
    [pid=600][err] #9 0x00400343b226 <unknown>
    [pid=600][err] #10 0x00400ef190b3 <unknown>
    [pid=600][err] #11 0x00400343b02a <unknown>
    [pid=600][err] Crash keys:
    [pid=600][err]   "switch-8" = "--enable-crashpad"
    [pid=600][err]   "switch-7" = "--change-stack-guard-on-fork=enable"
    [pid=600][err]   "switch-6" = "--user-data-dir=/tmp/playwright_chromiumdev_profile-Dveenw"
    [pid=600][err]   "switch-5" = "--enable-crash-reporter=,"
    [pid=600][err]   "switch-4" = "--crashpad-handler-pid=605"
    [pid=600][err]   "switch-3" = "--enable-crashpad"
    [pid=600][err]   "switch-2" = "--no-sandbox"
    [pid=600][err]   "switch-1" = "--no-zygote-sandbox"
    [pid=600][err]   "num-switches" = "9"
    [pid=600][err]
    [pid=600][err] Received signal 6
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006b75a71 <unknown>
    [pid=600][err] #3 0x00400e1f43c0 <unknown>
    [pid=600][err] #4 0x00400ef3818b <unknown>
    [pid=600][err] #5 0x00400ef17859 <unknown>
    [pid=600][err] #6 0x004006b74d05 <unknown>
    [pid=600][err] #7 0x004006af433f [618:618:1118/015548.587728:FATAL:zygote_main_linux.cc(161)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006af3f10 <unknown>
    [pid=600][err] #3 0x004006af4a5e <unknown>
    [pid=600][err] #4 0x004006680c57 <unknown>
    [pid=600][err] #5 0x00400667b7ae <unknown>
    [pid=600][err] #6 0x00400667d16b <unknown>
    [pid=600][err] #7 0x00400667a9c5 <unknown>
    [pid=600][err] #8 0x00400667b49e <unknown>
    [pid=600][err] #9 0x00400343b226 <unknown>
    [pid=600][err] #10 0x00400ef190b3 <unknown>
    [pid=600][err] #11 0x00400343b02a <unknown>
    [pid=600][err] Crash keys:
    [pid=600][err]   "switch-7" = "--enable-crashpad"
    [pid=600][err]   "switch-6" = "--change-stack-guard-on-fork=enable"
    [pid=600][err]   "switch-5" = "--user-data-dir=/tmp/playwright_chromiumdev_profile-Dveenw"
    [pid=600][err]   "switch-4" = "--enable-crash-reporter=,"
    [pid=600][err]   "switch-3" = "--crashpad-handler-pid=605"
    [pid=600][err]   "switch-2" = "--enable-crashpad"
    [pid=600][err]   "switch-1" = "--no-sandbox"
    [pid=600][err]   "num-switches" = "8"
    [pid=600][err]
    [pid=600][err] Received signal 6
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #8 0x004006af4a5e <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #9 0x004006680c57 <unknown>
    [pid=600][err] #2 0x004006b75a71 <unknown>
    [pid=600][err] #10 0x00400667b7ae <unknown>
    [pid=600][err] #3 0x00400e1f43c0 <unknown>
    [pid=600][err] #11 0x00400667d16b <unknown>
    [pid=600][err] #4 0x00400ef3818b <unknown>
    [pid=600][err] #5 0x00400ef17859 <unknown>
    [pid=600][err] #6 0x004006b74d05 <unknown>
    [pid=600][err] #12 0x00400667a9c5 <unknown>
    [pid=600][err] #7 0x004006af433f <unknown>
    [pid=600][err] #13 0x00400667b49e <unknown>
    [pid=600][err] #8 0x004006af4a5e <unknown>
    [pid=600][err] #14 0x00400343b226 <unknown>
    [pid=600][err] #9 0x004006680c57 <unknown>
    [pid=600][err] #15 0x00400ef190b3 <unknown>
    [pid=600][err] #16 0x00400343b02a <unknown>
    [pid=600][err] #10 0x00400667b7ae <unknown>
    [pid=600][err]   r8: 0000000000000000  r9: 000000400e1986f0 r10: 0000000000000008 r11: 000000400f0b2780
    [pid=600][err]  r12: 00002448000ec500 r13: 000000400e198950 r14: 00002448000ec510 r15: aaaaaaaaaaaaaaaa
    [pid=600][err]   di: 0000000000000002  si: 000000400e1986f0  bp: 000000400e198940  bx: 000000401027f900
    [pid=600][err]   dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000027  sp: 000000400e1986f0
    [pid=600][err]   ip: 000000400ef3818b efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
    [pid=600][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
    [pid=600][err] [end of stack trace]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    [pid=600][err] <unknown>
    [pid=600][err] #11 0x00400667d16b <unknown>
    [pid=600][err] #12 0x00400667a9c5 <unknown>
    [pid=600][err] #13 0x00400667b49e <unknown>
    [pid=600][err] #14 0x00400343b226 <unknown>
    [pid=600][err] #15 0x00400ef190b3 <unknown>
    [pid=600][err] #16 0x00400343b02a <unknown>
    [pid=600][err]   r8: 0000000000000000  r9: 000000400e198710 r10: 0000000000000008 r11: 000000400f0b2780
    [pid=600][err]  r12: 0000109000184500 r13: 000000400e198970 r14: 0000109000184510 r15: aaaaaaaaaaaaaaaa
    [pid=600][err]   di: 0000000000000002  si: 000000400e198710  bp: 000000400e198960  bx: 000000401027f900
    [pid=600][err]   dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000027  sp: 000000400e198710
    [pid=600][err]   ip: 000000400ef3818b efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
    [pid=600][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
    [pid=600][err] [end of stack trace]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    [pid=600][err] [600:626:1118/015549.682667:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)
    [pid=600][err] [600:600:1118/015549.767331:FATAL:ozone_platform_x11.cc(238)] Check failed: x11::Connection::Get()->Ready(). Missing X server or $DISPLAY
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006af3f10 <unknown>
    [pid=600][err] #3 0x004006af4a5e <unknown>
    [pid=600][err] #4 0x004003d7ba29 <unknown>
    [pid=600][err] #5 0x004003d19067 <unknown>
    [pid=600][err] #6 0x00400824b507 <unknown>
    [pid=600][err] #7 0x00400824b49a <unknown>
    [pid=600][err] #8 0x00400471509f <unknown>
    [pid=600][err] #9 0x004004715a4d <unknown>
    [pid=600][err] #10 0x004004711dfb <unknown>
    [pid=600][err] #11 0x00400667d692 <unknown>
    [pid=600][err] #12 0x00400667d157 <unknown>
    [pid=600][err] #13 0x00400667a9c5 <unknown>
    [pid=600][err] #14 0x00400667b49e <unknown>
    [pid=600][err] #15 0x00400343b226 <unknown>
    [pid=600][err] #16 0x00400ef190b3 <unknown>
    [pid=600][err] #17 0x00400343b02a <unknown>
    [pid=600][err] Crash keys:
    [pid=600][err]   "io_scheduler_async_stack" = "0x40044F7FE4 0x0"
    [pid=600][err]   "variations" = "19ebe09a-720b026c,23a898eb-fc93cf74,5f2c0f7c-3f4a17df,e4a357e9-3f4a17df,"
    [pid=600][err]   "num-experiments" = "4"
    [pid=600][err]   "switch-30" = "--enable-crashpad"
    [pid=600][err]   "switch-29" = "--no-startup-window"
    [pid=600][err]   "switch-28" = "--remote-debugging-pipe"
    [pid=600][err]   "switch-27" = "--user-data-dir=/tmp/playwright_chromiumdev_profile-Dveenw"
    [pid=600][err]   "switch-26" = "--no-sandbox"
    [pid=600][err]   "switch-25" = "--no-service-autorun"
    [pid=600][err]   "switch-24" = "--use-mock-keychain"
    [pid=600][err]   "switch-23" = "--password-store=basic"
    [pid=600][err]   "switch-22" = "--enable-automation"
    [pid=600][err]   "switch-21" = "--no-first-run"
    [pid=600][err]   "switch-20" = "--metrics-recording-only"
    [pid=600][err]   "switch-19" = "--force-color-profile=srgb"
    [pid=600][err]   "switch-18" = "--disable-sync"
    [pid=600][err]   "switch-17" = "--disable-renderer-backgrounding"
    [pid=600][err]   "switch-16" = "--disable-prompt-on-repost"
    [pid=600][err]   "switch-15" = "--disable-popup-blocking"
    [pid=600][err]   "switch-14" = "--disable-ipc-flooding-protection"
    [pid=600][err]   "switch-13" = "--disable-hang-monitor"
    [pid=600][err]   "switch-12" = "--allow-pre-commit-input"
    [pid=600][err]   "switch-11" = "--disable-features=ImprovedCookieControls,LazyFrameLoading,Globa"
    [pid=600][err]   "switch-10" = "--disable-extensions"
    [pid=600][err]   "switch-9" = "--disable-dev-shm-usage"
    [pid=600][err]   "switch-8" = "--disable-default-apps"
    [pid=600][err]   "switch-7" = "--disable-component-extensions-with-background-pages"
    [pid=600][err]   "switch-6" = "--disable-client-side-phishing-detection"
    [pid=600][err]   "switch-5" = "--disable-breakpad"
    [pid=600][err]   "switch-4" = "--disable-backgrounding-occluded-windows"
    [pid=600][err]   "switch-3" = "--disable-background-timer-throttling"
    [pid=600][err]   "switch-2" = "--enable-features=NetworkService,NetworkServiceInProcess"
    [pid=600][err]   "switch-1" = "--disable-background-networking"
    [pid=600][err]   "num-switches" = "30"
    [pid=600][err]   "osarch" = "x86_64"
    [pid=600][err]   "pid" = "600"
    [pid=600][err]   "ptype" = "browser"
    [pid=600][err]
    [pid=600][err] [1118/015550.409146:ERROR:scoped_ptrace_attach.cc(27)] ptrace: Function not implemented (38)
    [pid=600][err] Received signal 6
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006b75a71 <unknown>
    [pid=600][err] #3 0x00400e1f43c0 <unknown>
    [pid=600][err] #4 0x00400ef3818b <unknown>
    [pid=600][err] #5 0x00400ef17859 <unknown>
    [pid=600][err] #6 0x004006b74d05 <unknown>
    [pid=600][err] #7 0x004006af433f <unknown>
    [pid=600][err] #8 0x004006af4a5e <unknown>
    [pid=600][err] #9 0x004003d7ba29 <unknown>
    [pid=600][err] #10 0x004003d19067 <unknown>
    [pid=600][err] #11 0x00400824b507 <unknown>
    [pid=600][err] #12 0x00400824b49a <unknown>
    [pid=600][err] #13 0x00400471509f <unknown>
    [pid=600][err] #14 0x004004715a4d <unknown>
    [pid=600][err] #15 0x004004711dfb <unknown>
    [pid=600][err] #16 0x00400667d692 <unknown>
    [pid=600][err] #17 0x00400667d157 <unknown>
    [pid=600][err] #18 0x00400667a9c5 <unknown>
    [pid=600][err] #19 0x00400667b49e <unknown>
    [pid=600][err] #20 0x00400343b226 <unknown>
    [pid=600][err] #21 0x00400ef190b3 <unknown>
    [pid=600][err] #22 0x00400343b02a <unknown>
    [pid=600][err]   r8: 0000000000000000  r9: 000000400e198310 r10: 0000000000000008 r11: 0000000000000000
    [pid=600][err]  r12: 000025e0000dd400 r13: 000000400e198570 r14: 000025e0000dd410 r15: aaaaaaaaaaaaaaaa
    [pid=600][err]   di: 0000000000000002  si: 000000400e198310  bp: 000000400e198560  bx: 000000401027f900
    [pid=600][err]   dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000027  sp: 000000400e198310
    [pid=600][err]   ip: 000000400ef3818b efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
    [pid=600][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
    [pid=600][err] [end of stack trace]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    ============================================================
```

答: Have you tried running your project via docker-compose? You can always attach your local files (e.g. your screenshots, test battery, etc) via volumes. Therefore you'll have the same files both locally and into your Docker application.</p>

Body:
Locally, I can do the following:

import { test, expect } from '@playwright/test';

test('should work', async ({ page }) => {
  await page.goto(`https://playwright.dev`);
  expect(await page.screenshot()).toMatchSnapshot('test.png');
});

npx playwright test --update-snapshots

This works fine, but I want to generate the files via Docker so they're the same as when they run in CI. On the docs, the command is:

docker run --rm --network host -v $(pwd):/work/ -w /work/ -it mcr.microsoft.com/playwright:v1.12.3-focal /bin/bash
npm install
npx playwright test --update-snapshots

This fails, just showing a red test. The docs don't mention much more than this, what is the solution here? I'm on an M1 Mac if it makes a difference.

    browserContext.newPage: Browser closed.
    ==================== Browser output: ====================
    [pid=600][err] #8 0x00400667b49e <unknown>
    [pid=600][err] #9 0x00400343b226 <unknown>
    [pid=600][err] #10 0x00400ef190b3 <unknown>
    [pid=600][err] #11 0x00400343b02a <unknown>
    [pid=600][err] Crash keys:
    [pid=600][err]   "switch-7" = "--enable-crashpad"
    [pid=600][err]   "switch-6" = "--change-stack-guard-on-fork=enable"
    [pid=600][err]   "switch-5" = "--user-data-dir=/tmp/playwright_chromiumdev_profile-Dveenw"
    [pid=600][err]   "switch-4" = "--enable-crash-reporter=,"
    [pid=600][err]   "switch-3" = "--crashpad-handler-pid=605"
    [pid=600][err]   "switch-2" = "--enable-crashpad"
    [pid=600][err]   "switch-1" = "--no-sandbox"
    [pid=600][err]   "num-switches" = "8"
    [pid=600][err]
    [pid=600][err] Received signal 6
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #8 0x004006af4a5e <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #9 0x004006680c57 <unknown>
    [pid=600][err] #2 0x004006b75a71 <unknown>
    [pid=600][err] #10 0x00400667b7ae <unknown>
    [pid=600][err] #3 0x00400e1f43c0 <unknown>
    [pid=600][err] #11 0x00400667d16b <unknown>
    [pid=600][err] #4 0x00400ef3818b <unknown>
    [pid=600][err] #5 0x00400ef17859 <unknown>
    [pid=600][err] #6 0x004006b74d05 <unknown>
    [pid=600][err] #12 0x00400667a9c5 <unknown>
    [pid=600][err] #7 0x004006af433f <unknown>
    [pid=600][err] #13 0x00400667b49e <unknown>
    [pid=600][err] #8 0x004006af4a5e <unknown>
    [pid=600][err] #14 0x00400343b226 <unknown>
    [pid=600][err] #9 0x004006680c57 <unknown>
    [pid=600][err] #15 0x00400ef190b3 <unknown>
    [pid=600][err] #16 0x00400343b02a <unknown>
    [pid=600][err] #10 0x00400667b7ae <unknown>
    [pid=600][err]   r8: 0000000000000000  r9: 000000400e1986f0 r10: 0000000000000008 r11: 000000400f0b2780
    [pid=600][err]  r12: 00002448000ec500 r13: 000000400e198950 r14: 00002448000ec510 r15: aaaaaaaaaaaaaaaa
    [pid=600][err]   di: 0000000000000002  si: 000000400e1986f0  bp: 000000400e198940  bx: 000000401027f900
    [pid=600][err]   dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000027  sp: 000000400e1986f0
    [pid=600][err]   ip: 000000400ef3818b efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
    [pid=600][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
    [pid=600][err] [end of stack trace]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    [pid=600][err] <unknown>
    [pid=600][err] #11 0x00400667d16b <unknown>
    [pid=600][err] #12 0x00400667a9c5 <unknown>
    [pid=600][err] #13 0x00400667b49e <unknown>
    [pid=600][err] #14 0x00400343b226 <unknown>
    [pid=600][err] #15 0x00400ef190b3 <unknown>
    [pid=600][err] #16 0x00400343b02a <unknown>
    [pid=600][err]   r8: 0000000000000000  r9: 000000400e198710 r10: 0000000000000008 r11: 000000400f0b2780
    [pid=600][err]  r12: 0000109000184500 r13: 000000400e198970 r14: 0000109000184510 r15: aaaaaaaaaaaaaaaa
    [pid=600][err]   di: 0000000000000002  si: 000000400e198710  bp: 000000400e198960  bx: 000000401027f900
    [pid=600][err]   dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000027  sp: 000000400e198710
    [pid=600][err]   ip: 000000400ef3818b efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
    [pid=600][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
    [pid=600][err] [end of stack trace]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    [pid=600][err] [600:626:1118/015549.682667:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)
    [pid=600][err] [600:600:1118/015549.767331:FATAL:ozone_platform_x11.cc(238)] Check failed: x11::Connection::Get()->Ready(). Missing X server or $DISPLAY
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006af3f10 <unknown>
    [pid=600][err] #3 0x004006af4a5e <unknown>
    [pid=600][err] #4 0x004003d7ba29 <unknown>
    [pid=600][err] #5 0x004003d19067 <unknown>
    [pid=600][err] #6 0x00400824b507 <unknown>
    [pid=600][err] #7 0x00400824b49a <unknown>
    [pid=600][err] #8 0x00400471509f <unknown>
    [pid=600][err] #9 0x004004715a4d <unknown>
    [pid=600][err] #10 0x004004711dfb <unknown>
    [pid=600][err] #11 0x00400667d692 <unknown>
    [pid=600][err] #12 0x00400667d157 <unknown>
    [pid=600][err] #13 0x00400667a9c5 <unknown>
    [pid=600][err] #14 0x00400667b49e <unknown>
    [pid=600][err] #15 0x00400343b226 <unknown>
    [pid=600][err] #16 0x00400ef190b3 <unknown>
    [pid=600][err] #17 0x00400343b02a <unknown>
    [pid=600][err] Crash keys:
    [pid=600][err]   "io_scheduler_async_stack" = "0x40044F7FE4 0x0"
    [pid=600][err]   "variations" = "19ebe09a-720b026c,23a898eb-fc93cf74,5f2c0f7c-3f4a17df,e4a357e9-3f4a17df,"
    [pid=600][err]   "num-experiments" = "4"
    [pid=600][err]   "switch-30" = "--enable-crashpad"
    [pid=600][err]   "switch-29" = "--no-startup-window"
    [pid=600][err]   "switch-28" = "--remote-debugging-pipe"
    [pid=600][err]   "switch-27" = "--user-data-dir=/tmp/playwright_chromiumdev_profile-Dveenw"
    [pid=600][err]   "switch-26" = "--no-sandbox"
    [pid=600][err]   "switch-25" = "--no-service-autorun"
    [pid=600][err]   "switch-24" = "--use-mock-keychain"
    [pid=600][err]   "switch-23" = "--password-store=basic"
    [pid=600][err]   "switch-22" = "--enable-automation"
    [pid=600][err]   "switch-21" = "--no-first-run"
    [pid=600][err]   "switch-20" = "--metrics-recording-only"
    [pid=600][err]   "switch-19" = "--force-color-profile=srgb"
    [pid=600][err]   "switch-18" = "--disable-sync"
    [pid=600][err]   "switch-17" = "--disable-renderer-backgrounding"
    [pid=600][err]   "switch-16" = "--disable-prompt-on-repost"
    [pid=600][err]   "switch-15" = "--disable-popup-blocking"
    [pid=600][err]   "switch-14" = "--disable-ipc-flooding-protection"
    [pid=600][err]   "switch-13" = "--disable-hang-monitor"
    [pid=600][err]   "switch-12" = "--allow-pre-commit-input"
    [pid=600][err]   "switch-11" = "--disable-features=ImprovedCookieControls,LazyFrameLoading,Globa"
    [pid=600][err]   "switch-10" = "--disable-extensions"
    [pid=600][err]   "switch-9" = "--disable-dev-shm-usage"
    [pid=600][err]   "switch-8" = "--disable-default-apps"
    [pid=600][err]   "switch-7" = "--disable-component-extensions-with-background-pages"
    [pid=600][err]   "switch-6" = "--disable-client-side-phishing-detection"
    [pid=600][err]   "switch-5" = "--disable-breakpad"
    [pid=600][err]   "switch-4" = "--disable-backgrounding-occluded-windows"
    [pid=600][err]   "switch-3" = "--disable-background-timer-throttling"
    [pid=600][err]   "switch-2" = "--enable-features=NetworkService,NetworkServiceInProcess"
    [pid=600][err]   "switch-1" = "--disable-background-networking"
    [pid=600][err]   "num-switches" = "30"
    [pid=600][err]   "osarch" = "x86_64"
    [pid=600][err]   "pid" = "600"
    [pid=600][err]   "ptype" = "browser"
    [pid=600][err]
    [pid=600][err] [1118/015550.409146:ERROR:scoped_ptrace_attach.cc(27)] ptrace: Function not implemented (38)
    [pid=600][err] Received signal 6
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006b75a71 <unknown>
    [pid=600][err] #3 0x00400e1f43c0 <unknown>
    [pid=600][err] #4 0x00400ef3818b <unknown>
    [pid=600][err] #5 0x00400ef17859 <unknown>
    [pid=600][err] #6 0x004006b74d05 <unknown>
    [pid=600][err] #7 0x004006af433f <unknown>
    [pid=600][err] #8 0x004006af4a5e <unknown>
    [pid=600][err] #9 0x004003d7ba29 <unknown>
    [pid=600][err] #10 0x004003d19067 <unknown>
    [pid=600][err] #11 0x00400824b507 <unknown>
    [pid=600][err] #12 0x00400824b49a <unknown>
    [pid=600][err] #13 0x00400471509f <unknown>
    [pid=600][err] #14 0x004004715a4d <unknown>
    [pid=600][err] #15 0x004004711dfb <unknown>
    [pid=600][err] #16 0x00400667d692 <unknown>
    [pid=600][err] #17 0x00400667d157 <unknown>
    [pid=600][err] #18 0x00400667a9c5 <unknown>
    [pid=600][err] #19 0x00400667b49e <unknown>
    [pid=600][err] #20 0x00400343b226 <unknown>
    [pid=600][err] #21 0x00400ef190b3 <unknown>
    [pid=600][err] #22 0x00400343b02a <unknown>
    [pid=600][err]   r8: 0000000000000000  r9: 000000400e198310 r10: 0000000000000008 r11: 0000000000000000
    [pid=600][err]  r12: 000025e0000dd400 r13: 000000400e198570 r14: 000025e0000dd410 r15: aaaaaaaaaaaaaaaa
    [pid=600][err]   di: 0000000000000002  si: 000000400e198310  bp: 000000400e198560  bx: 000000401027f900
    [pid=600][err]   dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000027  sp: 000000400e198310
    [pid=600][err]   ip: 000000400ef3818b efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
    [pid=600][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
    [pid=600][err] [end of stack trace]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    =========================== logs ===========================
    <launching> /ms-playwright/chromium-930007/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-Dveenw --remote-debugging-pipe --no-startup-window
    <launched> pid=600
    [pid=600][err] [1118/015547.764472:ERROR:stack_trace_posix.cc(704)] Failed to parse the contents of /proc/self/maps
    [pid=600][err] [1118/015548.307639:ERROR:stack_trace_posix.cc(704)] Failed to parse the contents of /proc/self/maps
    [pid=600][err] [1118/015548.307646:ERROR:stack_trace_posix.cc(704)] Failed to parse the contents of /proc/self/maps
    [pid=600][err] [1118/015548.494378:FATAL:nacl_helper_linux.cc(435)] Check failed: nacl_sandbox->IsSingleThreaded().
    [pid=600][err] #0 0x004000240779 <unknown>
    [pid=600][err] #1 0x00400020c063 <unknown>
    [pid=600][err] #2 0x00400020e6d0 <unknown>
    [pid=600][err] #3 0x00400020f21e <unknown>
    [pid=600][err] #4 0x00400017fd6a <unknown>
    [pid=600][err] #5 0x004001e3e0b3 <unknown>
    [pid=600][err] #6 0x00400017f9ea <unknown>
    [pid=600][err]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    [pid=600][err] [618:618:1118/015548.584016:ERROR:nacl_fork_delegate_linux.cc(329)] Bad NaCl helper startup ack (0 bytes)
    [pid=600][err] [615:615:1118/015548.358993:FATAL:zygote_main_linux.cc(161)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006af3f10 <unknown>
    [pid=600][err] #3 0x004006af4a5e <unknown>
    [pid=600][err] #4 0x004006680c57 <unknown>
    [pid=600][err] #5 0x00400667b7ae <unknown>
    [pid=600][err] #6 0x00400667d16b <unknown>
    [pid=600][err] #7 0x00400667a9c5 <unknown>
    [pid=600][err] #8 0x00400667b49e <unknown>
    [pid=600][err] #9 0x00400343b226 <unknown>
    [pid=600][err] #10 0x00400ef190b3 <unknown>
    [pid=600][err] #11 0x00400343b02a <unknown>
    [pid=600][err] Crash keys:
    [pid=600][err]   "switch-8" = "--enable-crashpad"
    [pid=600][err]   "switch-7" = "--change-stack-guard-on-fork=enable"
    [pid=600][err]   "switch-6" = "--user-data-dir=/tmp/playwright_chromiumdev_profile-Dveenw"
    [pid=600][err]   "switch-5" = "--enable-crash-reporter=,"
    [pid=600][err]   "switch-4" = "--crashpad-handler-pid=605"
    [pid=600][err]   "switch-3" = "--enable-crashpad"
    [pid=600][err]   "switch-2" = "--no-sandbox"
    [pid=600][err]   "switch-1" = "--no-zygote-sandbox"
    [pid=600][err]   "num-switches" = "9"
    [pid=600][err]
    [pid=600][err] Received signal 6
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006b75a71 <unknown>
    [pid=600][err] #3 0x00400e1f43c0 <unknown>
    [pid=600][err] #4 0x00400ef3818b <unknown>
    [pid=600][err] #5 0x00400ef17859 <unknown>
    [pid=600][err] #6 0x004006b74d05 <unknown>
    [pid=600][err] #7 0x004006af433f [618:618:1118/015548.587728:FATAL:zygote_main_linux.cc(161)] Check failed: sandbox::ThreadHelpers::IsSingleThreaded().
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006af3f10 <unknown>
    [pid=600][err] #3 0x004006af4a5e <unknown>
    [pid=600][err] #4 0x004006680c57 <unknown>
    [pid=600][err] #5 0x00400667b7ae <unknown>
    [pid=600][err] #6 0x00400667d16b <unknown>
    [pid=600][err] #7 0x00400667a9c5 <unknown>
    [pid=600][err] #8 0x00400667b49e <unknown>
    [pid=600][err] #9 0x00400343b226 <unknown>
    [pid=600][err] #10 0x00400ef190b3 <unknown>
    [pid=600][err] #11 0x00400343b02a <unknown>
    [pid=600][err] Crash keys:
    [pid=600][err]   "switch-7" = "--enable-crashpad"
    [pid=600][err]   "switch-6" = "--change-stack-guard-on-fork=enable"
    [pid=600][err]   "switch-5" = "--user-data-dir=/tmp/playwright_chromiumdev_profile-Dveenw"
    [pid=600][err]   "switch-4" = "--enable-crash-reporter=,"
    [pid=600][err]   "switch-3" = "--crashpad-handler-pid=605"
    [pid=600][err]   "switch-2" = "--enable-crashpad"
    [pid=600][err]   "switch-1" = "--no-sandbox"
    [pid=600][err]   "num-switches" = "8"
    [pid=600][err]
    [pid=600][err] Received signal 6
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #8 0x004006af4a5e <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #9 0x004006680c57 <unknown>
    [pid=600][err] #2 0x004006b75a71 <unknown>
    [pid=600][err] #10 0x00400667b7ae <unknown>
    [pid=600][err] #3 0x00400e1f43c0 <unknown>
    [pid=600][err] #11 0x00400667d16b <unknown>
    [pid=600][err] #4 0x00400ef3818b <unknown>
    [pid=600][err] #5 0x00400ef17859 <unknown>
    [pid=600][err] #6 0x004006b74d05 <unknown>
    [pid=600][err] #12 0x00400667a9c5 <unknown>
    [pid=600][err] #7 0x004006af433f <unknown>
    [pid=600][err] #13 0x00400667b49e <unknown>
    [pid=600][err] #8 0x004006af4a5e <unknown>
    [pid=600][err] #14 0x00400343b226 <unknown>
    [pid=600][err] #9 0x004006680c57 <unknown>
    [pid=600][err] #15 0x00400ef190b3 <unknown>
    [pid=600][err] #16 0x00400343b02a <unknown>
    [pid=600][err] #10 0x00400667b7ae <unknown>
    [pid=600][err]   r8: 0000000000000000  r9: 000000400e1986f0 r10: 0000000000000008 r11: 000000400f0b2780
    [pid=600][err]  r12: 00002448000ec500 r13: 000000400e198950 r14: 00002448000ec510 r15: aaaaaaaaaaaaaaaa
    [pid=600][err]   di: 0000000000000002  si: 000000400e1986f0  bp: 000000400e198940  bx: 000000401027f900
    [pid=600][err]   dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000027  sp: 000000400e1986f0
    [pid=600][err]   ip: 000000400ef3818b efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
    [pid=600][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
    [pid=600][err] [end of stack trace]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    [pid=600][err] <unknown>
    [pid=600][err] #11 0x00400667d16b <unknown>
    [pid=600][err] #12 0x00400667a9c5 <unknown>
    [pid=600][err] #13 0x00400667b49e <unknown>
    [pid=600][err] #14 0x00400343b226 <unknown>
    [pid=600][err] #15 0x00400ef190b3 <unknown>
    [pid=600][err] #16 0x00400343b02a <unknown>
    [pid=600][err]   r8: 0000000000000000  r9: 000000400e198710 r10: 0000000000000008 r11: 000000400f0b2780
    [pid=600][err]  r12: 0000109000184500 r13: 000000400e198970 r14: 0000109000184510 r15: aaaaaaaaaaaaaaaa
    [pid=600][err]   di: 0000000000000002  si: 000000400e198710  bp: 000000400e198960  bx: 000000401027f900
    [pid=600][err]   dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000027  sp: 000000400e198710
    [pid=600][err]   ip: 000000400ef3818b efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
    [pid=600][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
    [pid=600][err] [end of stack trace]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    [pid=600][err] [600:626:1118/015549.682667:ERROR:file_path_watcher_linux.cc(326)] inotify_init() failed: Function not implemented (38)
    [pid=600][err] [600:600:1118/015549.767331:FATAL:ozone_platform_x11.cc(238)] Check failed: x11::Connection::Get()->Ready(). Missing X server or $DISPLAY
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006af3f10 <unknown>
    [pid=600][err] #3 0x004006af4a5e <unknown>
    [pid=600][err] #4 0x004003d7ba29 <unknown>
    [pid=600][err] #5 0x004003d19067 <unknown>
    [pid=600][err] #6 0x00400824b507 <unknown>
    [pid=600][err] #7 0x00400824b49a <unknown>
    [pid=600][err] #8 0x00400471509f <unknown>
    [pid=600][err] #9 0x004004715a4d <unknown>
    [pid=600][err] #10 0x004004711dfb <unknown>
    [pid=600][err] #11 0x00400667d692 <unknown>
    [pid=600][err] #12 0x00400667d157 <unknown>
    [pid=600][err] #13 0x00400667a9c5 <unknown>
    [pid=600][err] #14 0x00400667b49e <unknown>
    [pid=600][err] #15 0x00400343b226 <unknown>
    [pid=600][err] #16 0x00400ef190b3 <unknown>
    [pid=600][err] #17 0x00400343b02a <unknown>
    [pid=600][err] Crash keys:
    [pid=600][err]   "io_scheduler_async_stack" = "0x40044F7FE4 0x0"
    [pid=600][err]   "variations" = "19ebe09a-720b026c,23a898eb-fc93cf74,5f2c0f7c-3f4a17df,e4a357e9-3f4a17df,"
    [pid=600][err]   "num-experiments" = "4"
    [pid=600][err]   "switch-30" = "--enable-crashpad"
    [pid=600][err]   "switch-29" = "--no-startup-window"
    [pid=600][err]   "switch-28" = "--remote-debugging-pipe"
    [pid=600][err]   "switch-27" = "--user-data-dir=/tmp/playwright_chromiumdev_profile-Dveenw"
    [pid=600][err]   "switch-26" = "--no-sandbox"
    [pid=600][err]   "switch-25" = "--no-service-autorun"
    [pid=600][err]   "switch-24" = "--use-mock-keychain"
    [pid=600][err]   "switch-23" = "--password-store=basic"
    [pid=600][err]   "switch-22" = "--enable-automation"
    [pid=600][err]   "switch-21" = "--no-first-run"
    [pid=600][err]   "switch-20" = "--metrics-recording-only"
    [pid=600][err]   "switch-19" = "--force-color-profile=srgb"
    [pid=600][err]   "switch-18" = "--disable-sync"
    [pid=600][err]   "switch-17" = "--disable-renderer-backgrounding"
    [pid=600][err]   "switch-16" = "--disable-prompt-on-repost"
    [pid=600][err]   "switch-15" = "--disable-popup-blocking"
    [pid=600][err]   "switch-14" = "--disable-ipc-flooding-protection"
    [pid=600][err]   "switch-13" = "--disable-hang-monitor"
    [pid=600][err]   "switch-12" = "--allow-pre-commit-input"
    [pid=600][err]   "switch-11" = "--disable-features=ImprovedCookieControls,LazyFrameLoading,Globa"
    [pid=600][err]   "switch-10" = "--disable-extensions"
    [pid=600][err]   "switch-9" = "--disable-dev-shm-usage"
    [pid=600][err]   "switch-8" = "--disable-default-apps"
    [pid=600][err]   "switch-7" = "--disable-component-extensions-with-background-pages"
    [pid=600][err]   "switch-6" = "--disable-client-side-phishing-detection"
    [pid=600][err]   "switch-5" = "--disable-breakpad"
    [pid=600][err]   "switch-4" = "--disable-backgrounding-occluded-windows"
    [pid=600][err]   "switch-3" = "--disable-background-timer-throttling"
    [pid=600][err]   "switch-2" = "--enable-features=NetworkService,NetworkServiceInProcess"
    [pid=600][err]   "switch-1" = "--disable-background-networking"
    [pid=600][err]   "num-switches" = "30"
    [pid=600][err]   "osarch" = "x86_64"
    [pid=600][err]   "pid" = "600"
    [pid=600][err]   "ptype" = "browser"
    [pid=600][err]
    [pid=600][err] [1118/015550.409146:ERROR:scoped_ptrace_attach.cc(27)] ptrace: Function not implemented (38)
    [pid=600][err] Received signal 6
    [pid=600][err] #0 0x004006b75f99 <unknown>
    [pid=600][err] #1 0x004006ae0513 <unknown>
    [pid=600][err] #2 0x004006b75a71 <unknown>
    [pid=600][err] #3 0x00400e1f43c0 <unknown>
    [pid=600][err] #4 0x00400ef3818b <unknown>
    [pid=600][err] #5 0x00400ef17859 <unknown>
    [pid=600][err] #6 0x004006b74d05 <unknown>
    [pid=600][err] #7 0x004006af433f <unknown>
    [pid=600][err] #8 0x004006af4a5e <unknown>
    [pid=600][err] #9 0x004003d7ba29 <unknown>
    [pid=600][err] #10 0x004003d19067 <unknown>
    [pid=600][err] #11 0x00400824b507 <unknown>
    [pid=600][err] #12 0x00400824b49a <unknown>
    [pid=600][err] #13 0x00400471509f <unknown>
    [pid=600][err] #14 0x004004715a4d <unknown>
    [pid=600][err] #15 0x004004711dfb <unknown>
    [pid=600][err] #16 0x00400667d692 <unknown>
    [pid=600][err] #17 0x00400667d157 <unknown>
    [pid=600][err] #18 0x00400667a9c5 <unknown>
    [pid=600][err] #19 0x00400667b49e <unknown>
    [pid=600][err] #20 0x00400343b226 <unknown>
    [pid=600][err] #21 0x00400ef190b3 <unknown>
    [pid=600][err] #22 0x00400343b02a <unknown>
    [pid=600][err]   r8: 0000000000000000  r9: 000000400e198310 r10: 0000000000000008 r11: 0000000000000000
    [pid=600][err]  r12: 000025e0000dd400 r13: 000000400e198570 r14: 000025e0000dd410 r15: aaaaaaaaaaaaaaaa
    [pid=600][err]   di: 0000000000000002  si: 000000400e198310  bp: 000000400e198560  bx: 000000401027f900
    [pid=600][err]   dx: 0000000000000000  ax: 0000000000000000  cx: 0000000000000027  sp: 000000400e198310
    [pid=600][err]   ip: 000000400ef3818b efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
    [pid=600][err]  trp: ffffffffffffffff msk: 0000000000000000 cr2: 0000000000000000
    [pid=600][err] [end of stack trace]
    [pid=600][err] qemu: uncaught target signal 6 (Aborted) - core dumped
    ============================================================


问:
Test case to test the styles associated with a button when hovering in robot framework
I am trying to achieve the below validation in robot framework.

The cursor changing to a hand when button is hovered

a highlighting border created around the button when hovered on the
button.
both happens at the same time when hovering the button.

Can anyone please help me with the keyword and respective values to be passed.

Also, I want to mention that all of these were defined inside the class like below :

for example :

and selector had all these kind of information:
.gMpiYI
    cursor: pointer;
    border-radius: 2px;
    color: #FFFFFF;
    background: #C25608;
    padding: 0.75rem 1rem;
    min-height: 2.5rem;
    font-weight: 700;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 1rem;
    border: none;

.gMpiYI:hover, .gMpiYI:focus
    color: #FFFFFF;
    border-color: transparent;
    background: #aa4b07;
    box-shadow: 0 0 0 2px #FFFFFF,0 0 0 5px #aa4b07;
    outline: none;```
<pre class="snippet-code-html lang-html prettyprint-override"><code>My button had inspect element like this :

<button type="button" class="uitk-button Buttoncomponent__Button-uuuau7-1 gMpiYI"><span>Default</span></button></code>```

答:
as per your current code snippet, I can only suggest you compare the class name using the get element attribute keyword</p>
```<code>${textToCompare}   Get Element attribute ${locator}@class
should be equal as string  ${textToCompare}   uitk-button Buttoncomponent__Button-uuuau7-1 gMpiYI:hover
</code>```

Body:
I am trying to achieve the below validation in robot framework.

The cursor changing to a hand when button is hovered

a highlighting border created around the button when hovered on the
button.
both happens at the same time when hovering the button.

Can anyone please help me with the keyword and respective values to be passed.

Also, I want to mention that all of these were defined inside the class like below :

for example :

and selector had all these kind of information:
.gMpiYI
    cursor: pointer;
    border-radius: 2px;
    color: #FFFFFF;
    background: #C25608;
    padding: 0.75rem 1rem;
    min-height: 2.5rem;
    font-weight: 700;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 1rem;
    border: none;

.gMpiYI:hover, .gMpiYI:focus
    color: #FFFFFF;
    border-color: transparent;
    background: #aa4b07;
    box-shadow: 0 0 0 2px #FFFFFF,0 0 0 5px #aa4b07;
    outline: none;

My button had inspect element like this :

<button type="button" class="uitk-button Buttoncomponent__Button-uuuau7-1 gMpiYI">Default</button>

Body:
as per your current code snippet, I can only suggest you compare the class name using the get element attribute keyword

${textToCompare}   Get Element attribute ${locator}@class
should be equal as string  ${textToCompare}   uitk-button Buttoncomponent__Button-uuuau7-1 gMpiYI:hover


问:
Remove whole parent div if contained child div is empty
I'm trying to achieve the following:

I have multiple divs with the class "et_pb_row_inner" that contain two columns each. Each of the columns contain a text container with the class "et_pb_text".

Here's the basic html:

```<code><div class="et_pb_row_inner">
   <div class="et_pb_column"><div class="et_pb_text"></div></div>
   <div class="et_pb_column"><div class="et_pb_text"></div></div>
</div>

<div class="et_pb_row_inner">
   <div class="et_pb_column"><div class="et_pb_text"></div></div>
   <div class="et_pb_column"><div class="et_pb_text"></div></div>
</div>

<div class="et_pb_row_inner">
   <div class="et_pb_column"><div class="et_pb_text"></div></div>
   <div class="et_pb_column"><div class="et_pb_text"></div></div>
</div>

</code>```

I need a way to check if the text in the second column of each row is empty and if so remove the whole row. Like so:

```<code><div class="et_pb_row_inner">
   <div class="et_pb_column"><div class="et_pb_text">HAS TEXT</div></div>
   <div class="et_pb_column"><div class="et_pb_text">HAS TEXT</div></div>
</div>

<div class="et_pb_row_inner"> <!-- second column text empty, remove whole row -->
   <div class="et_pb_column"><div class="et_pb_text">HAS TEXT</div></div>
   <div class="et_pb_column"><div class="et_pb_text">EMPTY</div></div>
</div>

<div class=".et_pb_row_inner"> <!-- second column text empty, remove whole row -->
   <div class="et_pb_column"><div class="et_pb_text">HAS TEXT</div></div>
   <div class="et_pb_column"><div class="et_pb_text">EMPTY</div></div>
</div>

</code>```

I found a code snippet and tried the following:

```<code>$(function() {
    $('.et_pb_row_inner').each(function() {
        if ($('.et_pb_text', this).text() == "" ) {
            $('.et_pb_row_inner').hide();
        }
    });
});
</code>```

It kind of works, but it removes ALL divs with the class "et_pb_row_inner", not just the ones that contain the empty text div.

I guess it's just tweaking the code a little, but I can't get it working.

Any ideas?

答:
First of all, in your HTML third row, you mistakenly added "." in class name

Now below snippet will get the job done

$(function() {
   $('.et_pb_row_inner').each(function(_, item) {
        let text = $(item).children().eq(1).text();
      if(text.trim() === "EMPTY"){
        $(item).remove();
      }
   });
 });```
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div class="et_pb_row_inner">
   <div class="et_pb_column"><div class="et_pb_text">HAS TEXT1</div></div>
   <div class="et_pb_column"><div class="et_pb_text">HAS TEXT</div></div>
</div>

<div class="et_pb_row_inner"> <!-- second column text empty, remove whole row -->
   <div class="et_pb_column"><div class="et_pb_text">HAS TEXT2</div></div>
   <div class="et_pb_column"><div class="et_pb_text">EMPTY</div></div>
</div>

<div class="et_pb_row_inner"> <!-- second column text empty, remove whole row -->
   <div class="et_pb_column"><div class="et_pb_text">HAS TEXT3</div></div>
   <div class="et_pb_column"><div class="et_pb_text">EMPTY</div></div>
</div></code>```

Edited:

Replaced the $(item).empty() with $(item).remove()

Body:
I'm trying to achieve the following:

I have multiple divs with the class "et_pb_row_inner" that contain two columns each. Each of the columns contain a text container with the class "et_pb_text".

Here's the basic html:

I need a way to check if the text in the second column of each row is empty and if so remove the whole row. Like so:

HAS TEXT

HAS TEXT

HAS TEXT

EMPTY

HAS TEXT

EMPTY

I found a code snippet and tried the following:

$(function() {
    $('.et_pb_row_inner').each(function() {
        if ($('.et_pb_text', this).text() == "" ) {
            $('.et_pb_row_inner').hide();
        }
    });
});

It kind of works, but it removes ALL divs with the class "et_pb_row_inner", not just the ones that contain the empty text div.

I guess it's just tweaking the code a little, but I can't get it working.

Any ideas?

Body:
First of all, in your HTML third row, you mistakenly added "." in class name

Now below snippet will get the job done

$(function() {
   $('.et_pb_row_inner').each(function(_, item) {
        let text = $(item).children().eq(1).text();
      if(text.trim() === "EMPTY"){
        $(item).remove();
      }
   });
 });

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div class="et_pb_row_inner">
   <div class="et_pb_column"><div class="et_pb_text">HAS TEXT1</div></div>
   <div class="et_pb_column"><div class="et_pb_text">HAS TEXT</div></div>
</div>

<div class="et_pb_row_inner"> <!-- second column text empty, remove whole row -->
   <div class="et_pb_column"><div class="et_pb_text">HAS TEXT2</div></div>
   <div class="et_pb_column"><div class="et_pb_text">EMPTY</div></div>
</div>

<div class="et_pb_row_inner"> <!-- second column text empty, remove whole row -->
   <div class="et_pb_column"><div class="et_pb_text">HAS TEXT3</div></div>
   <div class="et_pb_column"><div class="et_pb_text">EMPTY</div></div>
</div>

Edited:

Replaced the $(item).empty() with $(item).remove()


问:
IntersectionObserver triggers before element enters view
Using Vue, I have the following setup in a component:

<template>

    {{ content }}

</template>
```
<pre class="lang-js prettyprint-override"><code>// Composition API with <script setup>

const emit = defineEmit<{
  (e: "read", value: number): void
}>()

const readMarker = ref<HTMLSpanElement>()

let observer: IntersectionObserver;
onMounted(() => {
  if (!readMarker.value)
    return

  observer = new IntersectionObserver(
      () => {
        emit("read", 1)
      },
      {
        root: readMarker.value,
      },
  )
  observer.observe(readMarker.value)
})

onDeactivated(() => observer.disconnect())
</code>```

The idea is that when the user scrolls to the bottom of the content (rootMarker enters the view), the read event is emitted. When the parent receives the event, it loads another component like this and so on (@read.once="loadMore").

However, as soon as I load the page, the event fires immediately, without me having any time to scroll at all. The same event for subsequent instances also fire as soon as the each instance loads.

I also tried using null as the root and creating the observer outside onMounted (with onMounted only containing the observer.observe() call), but that changed nothing.

I have clearly misunderstood something about IntersectionObserver, but I'm really confused about this behaviour.

答: It turns out that if you want to observe scrolling on the viewport itself, the root of the IntersectionObserver has to be the document itself, whereas in my question I am trying to set readMarker.value as root, so the observer would only look in it and, of course, see it as "visible" right away.

Body:
Using Vue, I have the following setup in a component:

<template>

    {{ content }}

</template>

// Composition API with


问:
Scraping information from previous pages using LinkExtractors
I wanted to know if it is possible to scrape information from previous pages using LinkExtractors. This question is in relation to my previous question here

I have uploaded the answer to that question with a change to the xpath for country. The xpath provided, grabs the countries from the first page.

```<code>import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.crawler import CrawlerProcess
from scrapy.spiders import CrawlSpider, Rule
from scrapy.item import Field
from itemloaders.processors import TakeFirst
from scrapy.loader import ItemLoader

class ZooplasItem(scrapy.Item):
    stuff = Field()
    country = Field()

class ZooplasSpider(CrawlSpider):
    name = 'zooplas'
    allowed_domains = ['zoopla.co.uk']
    start_urls = ['https://www.zoopla.co.uk/overseas/']

    rules = (
        Rule(LinkExtractor(restrict_css='a.link-novisit'), follow=True), # follow the countries links
        Rule(LinkExtractor(restrict_css='div.paginate'), follow=True), # follow pagination links
        Rule(LinkExtractor(restrict_xpaths="//a[contains(@class,'listing-result')]"), callback='parse_item', follow=True), # follow the link to actual property listing
    )

    def parse_item(self, response):
        # here you are on the details page for each property
        loader = ItemLoader(ZooplasItem(), response=response)
        loader.default_output_processor = TakeFirst()
        loader.add_xpath("stuff", "//article[@class='dp-sidebar-wrapper__summary']//h1//text()")
        loader.add_xpath("country","(//ul[@class='list-inline list-unstyled'])[1]//li//a//text()")
        yield loader.load_item()

if __name__ == '__main__':
    process = CrawlerProcess(
        settings = {
            'USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36',
            'FEEDS': {
                'zoopla.jl': {
                    'format': 'jsonlines'
                }
            }
        }
    )
    process.crawl(ZooplasSpider)
    process.start()
</code>```

However, this prints out the following output:

```<code>'country':'(//ul[@class='list-inline list-unstyled'])[1]//li//a//text()'
</code>```

答:
CrawlSpider is meant for cases where you want to automatically follow links that match a particular pattern. If you want to obtain information from previous pages, you have to parse each page individually and pass information around via the meta request argument or the cb_kwargs argument. You can add any information to the meta value in any of the parse methods.

I have refactored the code above to use the normal scrapy Spider class and have passed the country value from the first page in the meta keyword and then captured it in subsequent parse methods.

import scrapy
from scrapy.crawler import CrawlerProcess
from scrapy.item import Field
from itemloaders.processors import TakeFirst
from scrapy.loader import ItemLoader

class ZooplasItem(scrapy.Item):
    stuff = Field()
    country = Field()

class ZooplasSpider(scrapy.Spider):
    name = 'zooplas'
    allowed_domains = ['zoopla.co.uk']
    start_urls = ['https://www.zoopla.co.uk/overseas/']

    def parse(self, response):
        # grab the countries links and follow them
        # you can do some other parsing here and pass the information down to the subsequent parse methods
        for link in response.xpath("(//ul[@class='list-inline list-unstyled'])[1]/li"):
            country = link.xpath("./h4/a/text()").get()
            url = link.xpath("./h4/a/@href").get()
            yield response.follow(url, meta={"country": country}, callback=self.parse_country)

    def parse_country(self, response):
        # follow link to individual listing and pass the country value in the meta object
        # you can pass any information in the meta dictionary
        for link in response.xpath("//a[contains(@class,'listing-result')]"):
            yield response.follow(link, meta={"country": response.meta.get("country")}, callback=self.parse_item)

        # follow pagination links
        next_page = response.xpath("//a[contains(text(),'Next')]/@href").get()
        if next_page:
            response.follow(next_page, callback=self.parse_country)

    def parse_item(self, response):
        # here you are on the details page for each property
        loader = ItemLoader(ZooplasItem(), response=response)
        loader.default_output_processor = TakeFirst()
        loader.add_xpath("stuff", "//article[@class='dp-sidebar-wrapper__summary']//h1//text()")
        loader.add_value("country",response.meta.get('country')) # retrieve the country name from the
        yield loader.load_item()

if __name__ == '__main__':
    process = CrawlerProcess(
        settings = {
            'USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36',
            'FEEDS': {
                'zoopla.jl': {
                    'format': 'jsonlines'
                }
            }
        }
    )
    process.crawl(ZooplasSpider)
    process.start()
```

Body:
I wanted to know if it is possible to scrape information from previous pages using LinkExtractors. This question is in relation to my previous question here

I have uploaded the answer to that question with a change to the xpath for country. The xpath provided, grabs the countries from the first page.

import scrapy
from scrapy.linkextractors import LinkExtractor
from scrapy.crawler import CrawlerProcess
from scrapy.spiders import CrawlSpider, Rule
from scrapy.item import Field
from itemloaders.processors import TakeFirst
from scrapy.loader import ItemLoader

class ZooplasItem(scrapy.Item):
    stuff = Field()
    country = Field()

class ZooplasSpider(CrawlSpider):
    name = 'zooplas'
    allowed_domains = ['zoopla.co.uk']
    start_urls = ['https://www.zoopla.co.uk/overseas/']

    rules = (
        Rule(LinkExtractor(restrict_css='a.link-novisit'), follow=True), # follow the countries links
        Rule(LinkExtractor(restrict_css='div.paginate'), follow=True), # follow pagination links
        Rule(LinkExtractor(restrict_xpaths="//a[contains(@class,'listing-result')]"), callback='parse_item', follow=True), # follow the link to actual property listing
    )

    def parse_item(self, response):
        # here you are on the details page for each property
        loader = ItemLoader(ZooplasItem(), response=response)
        loader.default_output_processor = TakeFirst()
        loader.add_xpath("stuff", "//article[@class='dp-sidebar-wrapper__summary']//h1//text()")
        loader.add_xpath("country","(//ul[@class='list-inline list-unstyled'])[1]//li//a//text()")
        yield loader.load_item()

if __name__ == '__main__':
    process = CrawlerProcess(
        settings = {
            'USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36',
            'FEEDS': {
                'zoopla.jl': {
                    'format': 'jsonlines'
                }
            }
        }
    )
    process.crawl(ZooplasSpider)
    process.start()

However, this prints out the following output:

'country':'(//ul[@class='list-inline list-unstyled'])[1]//li//a//text()'


问:
How to hide Code in Jupyter Notebook w/ VS Code?
I'm using VS Code to write Jupyter notebook as I feel more comfortable with it. I found out that there is no option to edit meta data of the cells in order to hide only select code cells. I also came across some answers suggesting to use # @hidden_cell in the code cell but that doesn't work or am I doing it wrong? not much information was available for this.
I tried using the command

```<code>jupyter nbconvert my_notebook.ipynb --no-input --to pdf
</code>```

and that works fine but it removes all the code. I wish to remove only specific code cells.

答:
You can use .env to hide the code.

```<code>hidden_code = (code)
</code>```

Then use the variable hidden_code inside brackets to use it.

Body:
I'm using VS Code to write Jupyter notebook as I feel more comfortable with it. I found out that there is no option to edit meta data of the cells in order to hide only select code cells. I also came across some answers suggesting to use # @hidden_cell in the code cell but that doesn't work or am I doing it wrong? not much information was available for this.
I tried using the command

jupyter nbconvert my_notebook.ipynb --no-input --to pdf

and that works fine but it removes all the code. I wish to remove only specific code cells.

Body:
You can use .env to hide the code.

hidden_code = (code)

Then use the variable hidden_code inside brackets to use it.


问:
Replace values from a string if they are present in an array of variables
Having the following array of objects:

```<code>const variables = [
  { name: '%NAME%', value: 'joe' },
  { name: '%EMAIL%', value: '%NAME%@mail.com' },
  { name: '%HOBBY%', value: 'tennis' }
];
</code>```

And the input string:

```<code>const inputString = `Hi, my name is %NAME%, I like %HOBBY%, you can contact me at %EMAIL%`;
</code>```

The function should take as arguments variables and inputString and return the following sting:

```<code>'Hi, my name is joe, I like tennis, you can contact me at joe@mail.com'
</code>```

Here is the function so far:

```<code>function doMagic(variables, inputString) {
  let output = inputString;
  for (let i = 0; i < variables.length; i++) {
     output = inputString.replace(variables[i].name, variables[i].value);
  }
  return output;
}
</code>```

Unfortunatelly, this only finds one occurrence, in case there are more, and it doesn't go into nested variables, like %EMAIL%.

Any ideas to improve?

答:
Looping backwards through the array, and using replaceAll() should do the trick.

const variables = [
  { name: '%NAME%', value: 'joe' },
  { name: '%EMAIL%', value: '%NAME%@mail.com' },
  { name: '%HOBBY%', value: 'tennis' },
];

const inputString = `Hi, my name is %NAME%', I like %HOBBY%, you can contact me at %EMAIL%`;

function doMagic(variables, inputString) {
  let output = inputString;
  variables.slice().reverse().forEach(variable => {
    output = output.replaceAll(variable.name, variable.value);
  })

  return output;
}

console.log(doMagic(variables, inputString));```
</div>
</div>
</p>
<p>Using regex and while(regex.test.output()) also does the trick.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const variables = [
  { name: '%NAME%', value: 'joe' },
  { name: '%EMAIL%', value: '%NAME%@mail.com' },
  { name: '%HOBBY%', value: 'tennis' },
];

const inputString = `Hi, my name is %NAME%', I like %HOBBY%, you can contact me at %EMAIL%`;

function doMagic(variables, inputString) {
  const regex = new RegExp("(" + variables.map(x => x.name).join("|") + ")", "g");
  let output = inputString;
  while (regex.test(output)) {
    output = output.replace(regex, m => {
      return variables.filter(x => x.name == m)[0].value;
    })
  }

  return output;
}

console.log(doMagic(variables, inputString));</code>```

Body:
Having the following array of objects:

const variables = [
  { name: '%NAME%', value: 'joe' },
  { name: '%EMAIL%', value: '%NAME%@mail.com' },
  { name: '%HOBBY%', value: 'tennis' }
];

And the input string:

const inputString = `Hi, my name is %NAME%, I like %HOBBY%, you can contact me at %EMAIL%`;

The function should take as arguments variables and inputString and return the following sting:

'Hi, my name is joe, I like tennis, you can contact me at joe@mail.com'

Here is the function so far:

function doMagic(variables, inputString) {
  let output = inputString;
  for (let i = 0; i < variables.length; i++) {
     output = inputString.replace(variables[i].name, variables[i].value);
  }
  return output;
}

Unfortunatelly, this only finds one occurrence, in case there are more, and it doesn't go into nested variables, like %EMAIL%.

Any ideas to improve?

Body:
Looping backwards through the array, and using replaceAll() should do the trick.

const variables = [
  { name: '%NAME%', value: 'joe' },
  { name: '%EMAIL%', value: '%NAME%@mail.com' },
  { name: '%HOBBY%', value: 'tennis' },
];

const inputString = `Hi, my name is %NAME%', I like %HOBBY%, you can contact me at %EMAIL%`;

function doMagic(variables, inputString) {
  let output = inputString;
  variables.slice().reverse().forEach(variable => {
    output = output.replaceAll(variable.name, variable.value);
  })

  return output;
}

console.log(doMagic(variables, inputString));

Using regex and while(regex.test.output()) also does the trick.

const variables = [
  { name: '%NAME%', value: 'joe' },
  { name: '%EMAIL%', value: '%NAME%@mail.com' },
  { name: '%HOBBY%', value: 'tennis' },
];

const inputString = `Hi, my name is %NAME%', I like %HOBBY%, you can contact me at %EMAIL%`;

function doMagic(variables, inputString) {
  const regex = new RegExp("(" + variables.map(x => x.name).join("|") + ")", "g");
  let output = inputString;
  while (regex.test(output)) {
    output = output.replace(regex, m => {
      return variables.filter(x => x.name == m)[0].value;
    })
  }

  return output;
}

console.log(doMagic(variables, inputString));


问:
failed to compute cache key: "/nginx/default" not found: not found
I was trying to copy a file from parent directory but I am getting error "failed to compute cache key: "/nginx/default" not found: not found"

What I did is COPY ["../nginx/default", "/etc/nginx/sites-enabled"].

Thanks for all the helps

See this image

答:
When you build an image, you have a 'build context' which usually is the directory of where the Dockerfile is. The build context is that directory and all directories below that directory.

For security reasons, a Dockerfile is not allowed to access files outside of the build context.

When you try to go up a directory with '../nginx/default', you move outside the build context, and that's not allowed.

You can either move your nginx config file so it is inside the build context, or you can move the Dockerfile up a level, so you can do

```<code>COPY ["./nginx/default", "/etc/nginx/sites-enabled"]
</code>```

Body:
When you build an image, you have a 'build context' which usually is the directory of where the Dockerfile is. The build context is that directory and all directories below that directory.

For security reasons, a Dockerfile is not allowed to access files outside of the build context.

When you try to go up a directory with '../nginx/default', you move outside the build context, and that's not allowed.

You can either move your nginx config file so it is inside the build context, or you can move the Dockerfile up a level, so you can do

COPY ["./nginx/default", "/etc/nginx/sites-enabled"]


问:
EC2 instance shuts down when disconnected from Cloud 9 despite pm2 working
I have a website (Nodejs) on EC2 instance (Ubuntu) which is accessible and runs via pm2 process

Problem is - After closing IDE (cloud 9) the website stops working after some time, As soon as I login back to "Cloud 9" pm2 kick-starts automatically after EC2 Instance restarts.
pm2 setup seems to be working fine that way. (I did run pm2 startup, pm2 save

From logs :

*PM2 log: App [app:0] exited with code [1] via signal [SIGINT]

PM2 error: Error: kill EPERM*

As mentioned in -- https://aws.amazon.com/cloud9/faqs/
AWS Cloud9 EC2 environment – Enables you to launch a new Amazon EC2 instance that Cloud9 connects to. By default, these instances stop 30 minutes after you close the IDE and start automatically when you open the IDE.

Does this means in PROD we can only do SSH so Instance does not stop and website remains live?
Or how do I ensure Instance is not stopping?

答:
First find the corresponding EC2 instance, and enable termination protection:

Secondly, in Cloud9, cloud9 > Project Settings > EC2 instance
and set Stop my environment to Never


问:
Tilde not recognized in Mac terminal
I have this weird situation on my Mac running OSX Lion where the ~ (tilda) does not go to my user directory. Instead when I type "cd ˜", I get:

```<code>-bash: cd: ˜: No such file or directory
</code>```

Any advice on how to fix this?

答:
I'm using the Brazilian ABNT2 layout.
Here  [~] + [Alt Gr] does the job.</p>

ContentLicense: CC BY-SA 3.0

Title: Tilde not recognized in Mac terminal

Body:
I have this weird situation on my Mac running OSX Lion where the ~ (tilda) does not go to my user directory. Instead when I type "cd ˜", I get:

-bash: cd: ˜: No such file or directory

Any advice on how to fix this?


问:
What's your #1 way to be careful with a live database?
For my customer I occasionally do work in their live database in order to fix a problem they have created for themselves, or in order to fix bad data that my product's bugs created.  Much like Unix root access, it's just dangerous.  What lessons should I learn ahead of time?

What is the #1 thing you do to be careful about operating on live data?

答: If you are using SQL Server 2005+ Management Studio, you can turn Implicit Transactions ON.</p>

OwnerDisplayName: Kevin Conner

ContentLicense: CC BY-SA 2.5

LastEditorDisplayName: Bill the Lizard

OwnerDisplayName: Fabricio


问:
What context does the scheduler code run in?
There are two cases where the scheduler code schedule() is invoked-

When a process voluntarily calls schedule()

Timer interrupt calls schedule()

In case 2, I think schedule() runs in interrupt context, but what about the first case? Does it run in the context of the process which invoked it?

Also are there any more scenarios which invoke schedule()?

答: When a process calls schedule() it runs in a system call context which is interrupt based. In the 2nd case a hardware interrupt triggers the schedule() call. In both cases it runs as an interrupt. AFAIK those are the only times that schedule() is called because most manipulation of scheduling involves modifying the kernel run queue of things to be scheduled although a process can be interrupted but that is usually done via an interrupt to tell the process to yield or the process yielding itself.