Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Map instead of JSObject to update window.intercomSettings #410

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

deepak786
Copy link
Collaborator

@deepak786 deepak786 commented Feb 21, 2024

Using the JSObject was working in debug mode. But in the release mode it throws the following error during build.

The compiler crashed: Reference to dart:_js_types::JSObject::@methods::|staticInteropFactoryStub is not bound to an AST node. A procedure was expected
#0      Reference.asProcedure (package:kernel/canonical_name.dart:546:7)
#1      StaticInvocation.target (package:kernel/ast.dart:6470:43)
#2      StaticInteropClassEraser.visitStaticInvocation (package:_js_interop_checks/src/transformations/static_interop_class_eraser.dart:308:28)
#3      StaticInvocation.accept (package:kernel/ast.dart:6485:44)
#4      Transformer.transform (package:kernel/visitor.dart:1773:17)
#5      ReturnStatement.transformChildren (package:kernel/ast.dart:10069:22)
#6      Transformer.defaultTreeNode (package:kernel/visitor.dart:1807:10)
#7      TreeVisitorDefault.defaultStatement (package:kernel/visitor.dart:622:41)
#8      StatementVisitorDefaultMixin.visitReturnStatement (package:kernel/visitor.dart:377:51)
#9      ReturnStatement.accept (package:kernel/ast.dart:10055:43)
#10     Transformer.transform (package:kernel/visitor.dart:1773:17)
#11     Transformer.transformList (package:kernel/visitor.dart:1790:18)
#12     Block.transformChildren (package:kernel/ast.dart:9113:7)
#13     Transformer.defaultTreeNode (package:kernel/visitor.dart:1807:10)
#14     TreeVisitorDefault.defaultStatement (package:kernel/visitor.dart:622:41)
#15     StatementVisitorDefaultMixin.visitBlock (package:kernel/visitor.dart:345:31)
#16     Block.accept (package:kernel/ast.dart:9101:43)
#17     Transformer.transform (package:kernel/visitor.dart:1773:17)
#18     FunctionNode.transformChildren (package:kernel/ast.dart:3829:16)
#19     Transformer.defaultTreeNode (package:kernel/visitor.dart:1807:10)
#20     TreeVisitorDefaultMixin.visitFunctionNode (package:kernel/visitor.dart:577:45)
#21     FunctionNode.accept (package:kernel/ast.dart:3796:38)
#22     Transformer.transform (package:kernel/visitor.dart:1773:17)
#23     Procedure.transformChildren (package:kernel/ast.dart:3186:18)
#24     Transformer.defaultTreeNode (package:kernel/visitor.dart:1807:10)
#25     TreeVisitorDefault.defaultMember (package:kernel/visitor.dart:626:35)
#26     MemberVisitorDefaultMixin.visitProcedure (package:kernel/visitor.dart:411:39)
#27     StaticInteropClassEraser.visitProcedure (package:_js_interop_checks/src/transformations/static_interop_class_eraser.dart:287:18)
#28     Procedure.accept (package:kernel/ast.dart:3167:40)
#29     Transformer.transform (package:kernel/visitor.dart:1773:17)
#30     Transformer.transformList (package:kernel/visitor.dart:1790:18)
#31     Class.transformChildren (package:kernel/ast.dart:1498:7)
#32     Transformer.defaultTreeNode (package:kernel/visitor.dart:1807:10)
#33     TreeVisitorDefaultMixin.visitClass (package:kernel/visitor.dart:556:31)
#34     Class.accept (package:kernel/ast.dart:1444:38)
#35     Transformer.transform (package:kernel/visitor.dart:1773:17)
#36     Transformer.transformList (package:kernel/visitor.dart:1790:18)
#37     Library.transformChildren (package:kernel/ast.dart:605:7)
#38     Transformer.defaultTreeNode (package:kernel/visitor.dart:1807:10)
#39     TreeVisitorDefaultMixin.visitLibrary (package:kernel/visitor.dart:565:35)
#40     StaticInteropClassEraser.visitLibrary (package:_js_interop_checks/src/transformations/static_interop_class_eraser.dart:227:18)
#41     Library.accept (package:kernel/ast.dart:581:38)
#42     Transformer.transform (package:kernel/visitor.dart:1773:17)
#43     Transformer.transformList (package:kernel/visitor.dart:1790:18)
#44     Component.transformChildren (package:kernel/ast.dart:14443:7)
#45     Transformer.defaultTreeNode (package:kernel/visitor.dart:1807:10)
#46     TreeVisitorDefaultMixin.visitComponent (package:kernel/visitor.dart:600:39)
#47     _doTransformsOnKernelLoad (package:compiler/src/phase/load_kernel.dart:140:8)
#48     _loadFromKernel (package:compiler/src/phase/load_kernel.dart:207:3)
<asynchronous suspension>
#49     run (package:compiler/src/phase/load_kernel.dart:409:9)
<asynchronous suspension>
#50     Compiler.loadKernel (package:compiler/src/compiler.dart:395:9)
<asynchronous suspension>
#51     Compiler.produceKernel (package:compiler/src/compiler.dart:402:36)
<asynchronous suspension>
#52     Compiler.runSequentialPhases (package:compiler/src/compiler.dart:718:20)
<asynchronous suspension>
#53     Compiler.runInternal.<anonymous closure> (package:compiler/src/compiler.dart:318:7)
<asynchronous suspension>
#54     Compiler.runInternal (package:compiler/src/compiler.dart:317:5)
<asynchronous suspension>
#55     Compiler.run.<anonymous closure> (package:compiler/src/compiler.dart:238:11)
<asynchronous suspension>
#56     compile.<anonymous closure> (package:compiler/compiler_api.dart:252:30)
<asynchronous suspension>
#57     compile.compilationDone (package:compiler/src/dart2js.dart:745:3)
<asynchronous suspension>
#58     main (package:compiler/src/dart2js.dart:1265:3)
<asynchronous suspension>

This is the documentation of JSObject under js_interop (Flutter 3.16.9)

/// This is the supertype of all JS objects, but not other JS types, like
/// primitives. This is the only allowed `on` type for inline classes written by
/// users to model JS interop objects. See https://dart.dev/web/js-interop for
/// more details on how to use JS interop.

@deepak786 deepak786 self-assigned this Feb 21, 2024
@deepak786
Copy link
Collaborator Author

@Zazo032 did you get a time to check this PR?

@deepak786 deepak786 merged commit 0fab752 into master Feb 26, 2024
3 checks passed
@deepak786 deepak786 deleted the @deepak/fix_JSObject branch February 26, 2024 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants