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

Comments

Projects
None yet
3 participants
@nightroman

nightroman commented Apr 25, 2018

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.

@Tarmil Tarmil added the bug label Apr 25, 2018

@nightroman

This comment has been minimized.

nightroman commented Apr 25, 2018

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" />

nightroman added a commit to nightroman/RunSitelet that referenced this issue Apr 26, 2018

@Jand42

This comment has been minimized.

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.

@Jand42 Jand42 closed this in f672d9f May 3, 2018

@Tarmil Tarmil added the 4.2.10.257 label May 7, 2018

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