-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/engine
#42941Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: debuggingDebugging, breakpoints, expression evaluationDebugging, breakpoints, expression evaluationfound in release: 3.11Found to occur in 3.11Found to occur in 3.11found in release: 3.7Found to occur in 3.7Found to occur in 3.7has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specifically
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
Steps to reproduce
Add next code in browser console:
let script = document.createElement('script');
script.onload = function() {
console.log('pica', window.pica);
};
script.src = 'https://cdn.jsdelivr.net/npm/[email protected]/dist/pica.min.js';
document.head.appendChild(script);If I use debug mode, the pica or window.pica is undefined.
But the global var is define in release mode.
The code sample have the dart code, the browser code just quickly to reproduce it.
Expected results
The pica can be used in debug mode.
Actual results
The pica is undefined in debug mode.
Code sample
Code sample
import 'dart:html' as html;
import 'package:js/js.dart' as js;
Future<void> _loadScript() async {
// Use dart to add
final head = html.window.document.getElementsByTagName('head').first;
final scriptNode = html.ScriptElement();
scriptNode.src = 'https://cdn.jsdelivr.net/npm/[email protected]/dist/pica.min.js';
scriptNode.onLoad.listen((event) {
_log('pica loaded');
_log(js.context['pica']);
});
head.append(scriptNode);
}
bool _showLog = true;
void _log(Object? message) {
if (_showLog) {
// ignore: avoid_print
print(message?.toString());
}
}Screenshots or Video
Logs
Logs
Flutter Doctor output
Doctor output
$ flutter doctor -v
[!] Flutter (Channel stable, 3.7.0, on macOS 12.6 21G115 darwin-x64, locale zh-Hans-CN)
• Flutter version 3.7.0 on channel stable at /Volumes/SanDisk_2T/sdk/flutter/fvm/versions/3.7.0
! Upstream repository https://gitee.com/mirrors/Flutter.git is not a standard remote.
Set environment variable "FLUTTER_GIT_URL" to https://gitee.com/mirrors/Flutter.git to dismiss this error.
• Framework revision b06b8b2710 (3 个月前), 2023-01-23 16:55:55 -0800
• Engine revision b24591ed32
• Dart version 2.19.0
• DevTools version 2.20.1
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/jinglongcai/sdk/android/sdk
• Platform android-33, build-tools 33.0.0
• ANDROID_HOME = /Users/jinglongcai/sdk/android/sdk
• Java binary at: /Users/jinglongcai/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-1/213.7172.25.2113.9014738/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14A309
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.3)
• Android Studio at /Users/jinglongcai/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-1/213.7172.25.2113.9014738/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
[✓] Android Studio (version 2021.2)
• Android Studio at /Users/jinglongcai/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-1/212.5712.43.2112.8815526/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/AndroidStudio-4.1.0.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.3.2)
• IntelliJ at /Users/jinglongcai/Applications/JetBrains Toolbox/IntelliJ IDEA Ultimate.app
• Flutter plugin version 72.1.4
• Dart plugin version 223.8617.8
[✓] IntelliJ IDEA Community Edition (version 2022.3.2)
• IntelliJ at /Users/jinglongcai/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/223.8617.56/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] IntelliJ IDEA Community Edition (version 2022.3.1)
• IntelliJ at /Users/jinglongcai/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/223.8214.52/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] IntelliJ IDEA Ultimate Edition (version 2022.3)
• IntelliJ at /Users/jinglongcai/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/223.7571.182/IntelliJ IDEA.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] IntelliJ IDEA Ultimate Edition (version 2022.3.2)
• IntelliJ at /Users/jinglongcai/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/223.8617.56/IntelliJ IDEA.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.78.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.62.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 12.6 21G115 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 112.0.5615.137
[✓] HTTP Host Availability
• All required HTTP hosts are availableMatthiee
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: debuggingDebugging, breakpoints, expression evaluationDebugging, breakpoints, expression evaluationfound in release: 3.11Found to occur in 3.11Found to occur in 3.11found in release: 3.7Found to occur in 3.7Found to occur in 3.7has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyWeb applications specifically

