Closed xvrh closed 2 months ago
I have also get same error on complilation in web
Target dart2js failed: ProcessException: Process exited abnormally with exit code 1: ../../.pub-cache/hosted/pub.dev/printing-5.13.2/lib/printing_web.dart:132:19: Error: The operator '[]=' isn't defined for the class 'Window'. web.window['module'] = module; ^ ../../.pub-cache/hosted/pub.dev/printing-5.13.2/lib/printing_web.dart:135:19: Error: The operator '[]=' isn't defined for the class 'Window'. web.window['exports'] = exports; ^
Im also experiencing the same issue . Any help
../../../.pub-cache/hosted/pub.dev/printing-5.13.2/lib/printing_web.dart:132:19: Error: The operator '[]=' isn't defined for the class 'Window'. Try correcting the operator to an existing operator, or defining a '[]=' operator. web.window['module'] = module; ^
For me the same
Looks like the problem is with the 1.1.0 upgrade of the "web" package.
open printing_web.dart by clicking on the ../../../.pub-cache/hosted/pub.dev/printing-5.13.2/lib/printing_web.dart:132:19:
import 'dart:js' as js;
// Other imports and code...
replace the web.window with js.context // Corrected lines js.context['module'] = module; js.context['exports'] = exports;
this works for me
Changing the cached version will have issues if you do CI/CD or have multiple machines on the same project. Another temporary fix is to lock web
to 1.0.0
dependencies:
web: 1.0.0
Changing the cached version will have issues if you do CI/CD or have multiple machines on the same project. Another temporary fix is to lock
web
to1.0.0
dependencies: web: 1.0.0
More correct way:
dependency_overrides:
web: 1.0.0
/C:/Users/.../AppData/Local/Pub/Cache/hosted/pub.dev/printing-5.13.2/lib/printing_web.dart:132:19: Error: The operator '[]=' isn't defined for the class 'Window'. Try correcting the operator to an existing operator, or defining a '[]=' operator. web.window['module'] = module; ^ /C:/Users/.../AppData/Local/Pub/Cache/hosted/pub.dev/printing-5.13.2/lib/printing_web.dart:135:19: Error: The operator '[]=' isn't defined for the class 'Window'. Try correcting the operator to an existing operator, or defining a '[]=' operator. web.window['exports'] = exports; ^ Failed to compile application.
same for me
dependencies:
web: 1.0.0
and
replace the web.window with js.context
// Corrected lines
js.context['module'] = module;
js.context['exports'] = exports;
didn't work
The master branch is compatible, I'll publish a new version soon.
Fixed in printing 5.13.3
package:printing doesn't work with the latest version of package:web (1.1.0)
There is a compilation error when compiling for the Web
To Reproduce Compile a Flutter app for the web plaform with both package:printing and package:web: 1.1.0
Desktop (please complete the following information):