Skip to content

Commit 022ded2

Browse files
authored
Update platform_specific_instructions.md
1 parent 7f5d735 commit 022ded2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Diff for: doc/dev_guide/platform_specific_instructions.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,21 @@ For more information on multidex support, you can refer to the Android developer
4444

4545
### Web
4646

47-
If you're building a Flutter app for the web using the `printing` package, you may encounter a build error like:
47+
If you're building a Flutter app for the web, you may encounter a build error like:
4848

4949
```
50-
Error: A value of type 'JSString' can't be assigned to a variable of type 'String'.
50+
Launching lib/main.dart on Chrome in debug mode...
51+
../../../.pub-cache/hosted/pub.dev/printing-5.13.4/lib/printing_web.dart:218:16: Error:
52+
A value of type 'JSString' can't be assigned to a variable of type 'String'.
53+
.toJS;
54+
^
55+
Failed to compile application.
5156
```
5257

5358
This happens because `.toJS` is no longer required for converting Dart strings to JavaScript strings in recent Dart versions.
5459

5560
**Fix:**
56-
Update the `printing_web.dart` file in the `printing` package by removing `.toJS` from:
61+
Update the `printing_web.dart` file in the cached `printing` package by removing `.toJS` as done in the PR [here](https://github.com/DavBfr/dart_pdf/pull/1739/files)
5762

5863
```dart
5964
script.innerHTML =
@@ -67,5 +72,4 @@ script.innerHTML =
6772
'''function ${_frameId}_print(){var f=document.getElementById('$_frameId');f.focus();f.contentWindow.print();}''';
6873
```
6974

70-
This fix ensures compatibility with the latest Dart runtime. For more details, refer to [GitHub Issue #1791](https://github.com/DavBfr/dart_pdf/issues/1791).
7175
Read more about it here - https://github.com/DavBfr/dart_pdf/issues/1791

0 commit comments

Comments
 (0)