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

Unable to load source maps when dart web project is not hosted in root folder. #2353

Open
anantha-krish opened this issue Jan 23, 2024 · 2 comments
Labels
good first issue A good starting issue for contributors (issues with this label will appear in /contribute) package:webdev type-enhancement A request for a change that isn't a bug

Comments

@anantha-krish
Copy link

anantha-krish commented Jan 23, 2024

Hi Team,

Our team migrated from the Google web tool kit to Dart recently.
Where

  • v1 folder is legacy web project build using GWT framework
  • v2 folder is migrated web project using Dart SDK.

Our web server hosts both versions from different folder paths.
We were trying the source mapping feature supported by webdev using command 'webdev build --no-release'

Unfortunately, the scripts were not imported properly due to the invalid import file path set by bootstrap.js & require.js.
On further debugging, I understood the issue is because of the baseUrl function which returns "/" instead of expected "/v2".
Reading through the documentation, I found some suggestions related to adding <base href="/v2">, which do resolve the issue, but caused page routing and image loading issues.

I was able to resolve the issue by returning "/v2" by default instead of "/" in baseUrl Function of generated bootstrap.js and require.js.

Hence I request the team to add an new command line argument to set baseUrl of project.
Ex: webdev build --no-release --base-url="/v2"

@elliette elliette added type-enhancement A request for a change that isn't a bug good first issue A good starting issue for contributors (issues with this label will appear in /contribute) labels Jan 27, 2024
@elliette
Copy link
Collaborator

Hi @anantha-krish! Thanks for the suggestion. We welcome community contributions for new features like this. If you open a PR for this, I am happy to review it.

Out of curiosity, are you using a web framework or pure Dart for your application?

@anantha-krish
Copy link
Author

Hi @elliette ,

It's better to be handled by a consistent webdev contributor. Please have a look at your free time, it will be a great help.
We are using pure Dart for our web project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good starting issue for contributors (issues with this label will appear in /contribute) package:webdev type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants