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

WebSharper silently fails to download resources, then fails with UseDownloadedResources #943

Closed
nightroman opened this issue Apr 25, 2018 · 2 comments
Assignees

Comments

@nightroman
Copy link

Scenario:

  • The project file has WebSharperDownloadResources set to true.
  • The app.config has UseDownloadedResources set to true.
  • Turn off the internet connection.
    • This step is artificial but the problem is real on temporary connection issues.
  • Make sure the project is clean, i.e. does not have previously downloaded resources.

Build and run such a WebSharper project with the above conditions.

As a result,

  • The folder WebSharper\WebSharper.JQuery.Resources.JQuery is empty (expected to have downloaded jquery-3.1.1.min.js)
  • When started, the web page fails to load the missing local jquery-3.1.1.min.js

Moreover, restore the internet connection (or imagine the temporary downtime is
over), build and run again. The build is not triggered (all is up-to-date, I
presume) and the resources are not downloaded. The build has to be cleaned,
"made dirty", and started again -- then only it works.

Suggestion: if WebSharper fails to download a resource then it should fail or
at least write a warning.

@nightroman
Copy link
Author

FWIW, my workaround or an alternative approach:

  • Copy once downloaded jquery-3.1.1.min.js as my local file Content/js/jquery-3.1.1.min.js.
  • Remove <WebSharperDownloadResources>true</WebSharperDownloadResources> from the project.
  • In app.config set <add key="WebSharper.JQuery.Resources.JQuery" value="Content/js/jquery-3.1.1.min.js" />

@Jand42
Copy link
Member

Jand42 commented May 2, 2018

Currently WebSharperDownloadResources accepts true and false. I would make true throw an error on compile-time and expand the available values by adding a new option "WarnOnly" that gives only a warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants