You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When it should just come back as the exact contents.
Details
This also uncovers another issue related to how we should be able to support using ESM with non standard module types like JSON and images, since import just uses fetch, to a browser, a request for JSON, to a browser they both look the same, so there is currently no way for us to distinguish the differences between these two
Will need to setup a discussion for this and drop down to using an internal API for now that can get "hints" along the lines of import assertions to help keep us moving, ex.
importjsonfrom'/package.json?type=json';
However, this need for query params is dependent on #599 and requires a bit of a work around for now, so needing to make an exception to solve both at the same time.
The text was updated successfully, but these errors were encountered:
thescientist13
changed the title
fetching any JSON file that is _not_ graph.json always returns an ES module
fetching any JSON file that is not graph.json always returns an ES module
May 15, 2021
Type of Change
Summary
Just noticed as part of working on #516 that if you try and do something like this
Based on our current logic, it will always come back as ESM, e.g.
export default { ... }
When it should just come back as the exact contents.
Details
This also uncovers another issue related to how we should be able to support using ESM with non standard module types like JSON and images, since
import
just usesfetch
, to a browser, a request for JSON, to a browser they both look the same, so there is currently no way for us to distinguish the differences between these twoWill need to setup a discussion for this and drop down to using an internal API for now that can get "hints" along the lines of import assertions to help keep us moving, ex.
The text was updated successfully, but these errors were encountered: