Repository navigation
Description
Steps to reproduce
- Create new Flutter Project
- Add widget previews to any widget
- Add
passkeysdependency to the project - Run
flutter widget-preview start
Expected results
Widget preview should open in a browser or communicate error properly for easier resolution from developer side. Maybe there is a way to copy web setup from project where preview is used
Actual results
widget_preview_scaffold uses project as dependency, therefore passkeys added as transitive dependency. It could be properly setup in original project, but it is not gonna be setup in widget_preview_scaffold, so when using previews, it crashes with error
Error: Passkeys Web SDK not loaded. Please include the Passkeys Web SDK (bundle.js) in your
HTML file. You can find it on
https://github.com/corbado/flutter-passkeys/releases/download/2.4.0/bundle.jsAdding Passkeys Web SDK to project's index.html is not working, because issue in index.html in widget_preview_scaffold.
When adding SDK there, there is a need to add that html file to git, because otherwise it will be reset after running flutter clean. And as far as i understand this workaround should not work after #179039, so the solution would be to add it there manually whenever it resets.
Maybe it can be classified as a package issue, but from frameworks side there is little information on whats going on and it required tricky workaround
Code sample
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.38.3, on macOS 26.1 25B78 darwin-arm64, locale en-UA) [3.1s]
• Flutter version 3.38.3 on channel stable at /Users/zddarova/.asdf/installs/flutter/3.38.3-stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 19074d12f7 (3 weeks ago), 2025-11-20 17:53:13 -0500
• Engine revision 13e658725d
• Dart version 3.10.1
• DevTools version 2.51.1
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations,
enable-native-assets, omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [6.8s]
• Android SDK at /Users/zddarova/Library/Android/sdk
• Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
• Platform android-36, build-tools 35.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 26.1.1) [3.9s]
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 17B100
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [8ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (3 available) [6.1s]
• macOS (desktop) • macos • darwin-arm64 • macOS 26.1 25B78 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 142.0.7444.176
[✓] Network resources [1,344ms]
• All expected network resources are available.
• No issues found!
Activity
zddarova commentedon Dec 8, 2025
as a workaround, i added preview's
index.htmlto git by callingand added there a Passkey SDK
index.html
[-][widget-preview] Preview crashes over Passkey[/-][+][widget-preview] Preview crashes when project uses dependancy that requires web setup[/+]tirth-patel-nc commentedon Dec 9, 2025
Thanks for the report. Seeing the same behaviour with latest SDK versions.
bkonyi commentedon Dec 9, 2025
Thanks for filing this @zddarova! I really appreciate you providing the reproduction information and sample project, it's very helpful.
I just took a look at the project, and I notice that the only reference to
passkeysis in the pubspec, but not in the actual project code. I just want to confirm that's expected as I would have thought that, in this situation, thepasskeyslogic would not be included in the compiled application at all.Looking at
package:passkeys_web, I see that the plugin author has decided to close the window if thebundle.jsisn't detected. That's not great, and it'd probably be better if they just printed a warning and let runtime errors be thrown (the widget previewer would likely handle them and display the errors in place of individual previews). However, that's obviously not something that projects depending on that package can control.I think I'll need to investigate:
index.html).Plugin support for widget previews is effectively best-effort (if they work, they work, if not, 🤷), but the presence of plugin dependencies shouldn't prevent the widget previewer from running.
zddarova commentedon Dec 9, 2025
Yes, that’s correct — the
passkeyspackage was added as a dependency, but it’s not used anywhere in the project code.RamiroEda commentedon Dec 18, 2025
The same issue occurs with
pdfxpackage.This is because the generated
index.htmlfile doesn't have the required scripts.flutter-triage-bot commentedon Apr 14, 2026
This issue is assigned to @bkonyi but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!
[widget-preview] Copy host web directory to widget preview scaffold (f…
github-actions commentedon Jul 14, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.