question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Poor assumptions about file protocol lead to failure.

See original GitHub issue

Some environments allow local file access from JavaScript. In particular, Electron-based environments, such as the HTML preview window in Visual Studio Code, allow this.

There are at least two different places in Babylon where a poor assumption about the presence of file: in a string leads to local file access failure. One is on line 460 of Babylon.Tools.LoadImage and another is on line 540 of Babylon.Tools.LoadFile.

The presence of file: leads Babylon to look in FilesInput.FilesToLoad, which is not correct for this case. The intended behavior in this use case is to send the full XHR request to the file-protocol URL as-is.

For Windows-based local-drive filenames, this problem can be worked around: The Windows drive letter is enough of a clue to Chromium to load from the local file, even without the file protocol being specifically named on the front of the URL. But on Mac/Linux/Unix systems, or even on Windows network shares, there is no drive letter on the front of the URL, and the URL ends up looking like a host-relative root path, not a file-protocol path. Adding an explicit file: protocol to the front of such URLs is the only available fix, but Babylon sees that and refuses to issue an XHR request at all.

/cc @bghgary @sbtron This is deeply related to the issue blocking the glTF Extension for VSCode from working on other platforms, see https://github.com/AnalyticalGraphicsInc/gltf-vscode/issues/58#issuecomment-345111944

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
deltakoshcommented, Nov 17, 2017

Or even better : We could try first to load from filesInput and if not found then simply issue an xhr Thoughts?

1reaction
deltakoshcommented, Nov 17, 2017

Ok better now!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Protocol Design Assumptions and PEPs
Protocol designers have often made – implicit or explicit – assumptions about the deployment environments of their protocols.
Read more >
When "ASLR" Is Not Really ASLR - The Case of Incorrect ...
The problem is that mingw-w64 doesn't produce a relocation table when linking executables with the "Dynamic base" option.
Read more >
Full article: Policy failure and the policy-implementation gap
Faulty policy design can stem from many causes: a poor understanding of the problem; insufficient knowledge of the implementation context; ...
Read more >
RFC 4367 - What's in a Name: False Assumptions about DNS ...
Those assumptions can often be false, resulting in a variety of failure conditions. This document discusses this problem in more detail and makes ......
Read more >
7.4. Expert Information - Wireshark
Assumption : The protocol field has incomplete data and was dissected based on assumed value. Checksum: A checksum was invalid. Comment ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found