schultek / jaspr

Modern web framework for building websites in Dart. Supports SPAs, SSR and SSG.
https://jasprpad.schultek.de
MIT License
1.07k stars 65 forks source link

Auto generated platform import doesn't compile due to file not found error #114

Closed fusion44 closed 11 months ago

fusion44 commented 11 months ago

Description Auto generating platform imports yields a file not found error during compilation. I've tested this with the basic template.

Steps To Reproduce

  1. Activate jaspr through dart pub global activate jaspr_cli
  2. Create a new project with jaspr create -t basic my_app
  3. Add a component with a platform specific import (@Import.onWeb('dart:html', show: [#window]))
  4. See the following error(s) in console
[BUILDER] [ERROR] Response:--dart-sdk-summary=file:///home/f44/dev/flutter/bin/cache/flutter_web_sdk/kernel/ddc_outline_sound.dill --output=/tmp/scratch_spacePILRGT/packages/platform_import_test/app.ddc.dill --packages-file=org-dartlang-app:///.dart_tool/package_config.json --multi-root-scheme=org-dartlang-app --exclude-non-sources --summary-only --target=ddc --libraries-file=file:///home/f44/dev/flutter/bin/cache/flutter_web_sdk/libraries.json --reuse-compiler-result --use-incremental-compiler --used-inputs=/tmp/kernel_builder_OXMFYH/used_inputs.txt --input-summary=org-dartlang-app:///packages/jaspr/jaspr.ddc.dill --input-summary=org-dartlang-app:///packages/jaspr/src/browser/js_data.ddc.dill --input-summary=org-dartlang-app:///packages/meta/meta.ddc.dill --input-summary=org-dartlang-app:///packages/binary_codec/binary_codec.ddc.dill --input-summary=org-dartlang-app:///packages/js/js.ddc.dill --input-summary=org-dartlang-app:///packages/meta/meta_meta.ddc.dill --input-summary=org-dartlang-app:///packages/jaspr/html.ddc.dill --source=package:platform_import_test/app.dart --source=package:platform_import_test/app.g.dart
[BUILDER] [ERROR] org-dartlang-app:///packages/platform_import_test/components/settings_content.imports.dart:4:1: Error: Error when reading 'org-dartlang-app:///packages/platform_import_test/generated/imports/_web.dart': File not found
[BUILDER] [ERROR] export '../generated/imports/_web.dart'
[BUILDER] [ERROR] ^
[BUILDER] [ERROR] AssetNotFoundException: platform_import_test|lib/components/settings_content.imports.ddc.dill
[BUILDER] [ERROR] Error compiling dartdevc module:platform_import_test|lib/components/settings_content.imports.ddc.js
[BUILDER] [ERROR] 
[BUILDER] [ERROR] packages/platform_import_test/components/settings_content.imports.dart:4:1: Error: Error when reading 'packages/platform_import_test/generated/imports/_web.dart': File not found
[BUILDER] [ERROR] export '../generated/imports/_web.dart'
[BUILDER] [ERROR] ^
[BUILDER] [ERROR] Failed after 424ms

Expected Behavior No such error.

Additional Context Minimal example to reproduce the error: https://github.com/fusion44/jaspr_platform_import_test

The Dart LSP does find all files without problem.

schultek commented 11 months ago

In your repo it appears all files are generated correctly. Strange.

I will try to reproduce this.

schultek commented 11 months ago

Seems to be an issue with jaspr_web_compilers

schultek commented 11 months ago

Should work now after running pub upgrade