Skip to content

Conversation

@angelosilvestre
Copy link
Collaborator

[web] Export stub test extension file. (Resolves #2895)

We export some test extensions in the lib folder, including code related to golden tests. This breaks the build with the following build error:

Target dart2js failed: ProcessException: Process exited abnormally with exit code 1:
../../.pub-cache/hosted/pub.dev/super_editor-0.3.0-dev.45/lib/src/test/flutter_extensions/test_tools_goldens.dart:236:55:
Error: The getter 'basedir' isn't defined for the type 'LocalFileComparator'.
 - 'LocalFileComparator' is from 'package:flutter_test/src/_goldens_web.dart'
 ('../../flutter/packages/flutter_test/lib/src/_goldens_web.dart').
        (goldenFileComparator as LocalFileComparator).basedir.path,
                                                      ^^^^^^^
../../.pub-cache/hosted/pub.dev/super_editor-0.3.0-dev.45/lib/src/test/flutter_extensions/test_tools_goldens.dart:256:14:
Error: Too many positional arguments: 0 allowed, but 1 found.
        super(Uri.parse(testBaseDirectory));
             ^
../../.pub-cache/hosted/pub.dev/super_editor-0.3.0-dev.45/lib/src/test/flutter_extensions/test_tools_goldens.dart:291:11:
Error: The method 'generateFailureOutput' isn't defined for the type 'PixelDiffGoldenComparator'.
 - 'PixelDiffGoldenComparator' is from 'package:super_editor/src/test/flutter_extensions/test_tools_goldens.dart'
 ('../../.pub-cache/hosted/pub.dev/super_editor-0.3.0-dev.45/lib/src/test/flutter_extensions/test_tools_goldens.dart').
    await generateFailureOutput(result, golden, basedir);
          ^^^^^^^^^^^^^^^^^^^^^
Error: Compilation failed.

To fix that. I modified the file that exports these extensions to export a stub file when building for web.

@matthew-carroll matthew-carroll merged commit c85d731 into main Jan 20, 2026
25 checks passed
@matthew-carroll matthew-carroll deleted the 2895_web-build-issue branch January 20, 2026 05:57
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.

[Super Editor][Bug] - Web compilation issue with added test dependencies

3 participants