Having a Dart web project with an entrypoint that is in a subfolder (e.g. '/web/app/main.dart') instead of the root ('/web/main.dart') fails with the new wasm compiler.
The issue is that the main.dart.js always fetches the .wasm file as if it would exist in the root:
Which results in:
The main.dart.js and main.mjs are correctly fetched from their sub-path.
The .wasm file is correctly generated at /app/main.wasm, but tried to be fetched from the root.
Steps to reproduce
Create new web project with dart create -t web test
Update depencency to build_web_compilers: ^4.1.0-beta.0
Description
Having a Dart web project with an entrypoint that is in a subfolder (e.g. '/web/app/main.dart') instead of the root ('/web/main.dart') fails with the new wasm compiler.
The issue is that the
main.dart.js
always fetches the.wasm
file as if it would exist in the root:Which results in:
main.dart.js
andmain.mjs
are correctly fetched from their sub-path..wasm
file is correctly generated at/app/main.wasm
, but tried to be fetched from the root.Steps to reproduce
dart create -t web test
build_web_compilers: ^4.1.0-beta.0
build.yaml
withweb/main.dart
toweb/app/main.dart
and adjust the script path inindex.html
accordinglydart run build_runner serve
and openlocalhost:8080
Context:
Tagging:
@kevmoo since this could also be a general wasm compilation issue @simolus3 since you worked on this