fluttercommunity / fluttercommunity/wakelock_plus

Loading of no_sleep.js does not respect assetBase

Open
#19 7 comments 1 reaction 0 assignees View on GitHub
Dominant language
Dart
Stars
109
Forks
97
Avg merge
5d 4h
Merged PRs (30d)
2

Description

I'm using a package that depends on wakelock_plus, and on the first attempt to make a web build it seemed to work fine. However, our app is designed to be embedded into other web applications and when doing so it broke because it returned a 404 not found when trying to load no_sleep.js. This is because it tries to load it from the root of the domain instead of the assetBase.

I analyzed the generated main.dart.js and fixed it locally after the built. I first thought it was a bug in Flutter and have been searching in existing issues. I found something similar and posted a comment. But then a member of the Flutter team pointed to me that this was not their code, but part of this package, and advised to use the getAssetUrl API.

Below the link of his comment with some additional details: [https://github.com/flutter/flutter/issues/121417#issuecomment-1945212351](https://github.com/flutter/flutter/issues/121417#issuecomment-1945212351)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.