Comments (4)
import-map-overrides inspects the DOM to find all import maps. See https://github.com/joeldenning/import-map-overrides/blob/4ddaa6a507e7221faa93fc1209e2eadeaa7de878/src/api/js-api.js#L194.
What does the following command return for you, in the browser console?
console.log(await importMapOverrides.getDefaultMap())
If it returns an empty import map, then there is either a bug in import-map-overrides or you code does not have proper <script type="systemjs-importmap">
elements in the DOM at the time that import-map-overrides executes.
Perhaps <script src="import-map-overrides.js"></script>
is in the incorrect location in the DOM??? See https://github.com/joeldenning/import-map-overrides/blob/master/docs/installation.md#browser
<!--
Make sure to put this BEFORE any <script type="module"> elements or any System.import() calls, but
AFTER all other import maps
-->
<script
type="text/javascript"
src="https://cdn.jsdelivr.net/npm/import-map-overrides/dist/import-map-overrides.js"
></script>
from import-map-overrides.
The return of getDefaultMap is empty.
console.log(await importMapOverrides.getDefaultMap())
{
imports: {}
scopes: {}
}
My html is as below. I think I put the import-map-overrides.js
in the right place. But it still empty.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title></title>
<link href="/layout/layout-52ec262e7e3533d54491.css" rel="stylesheet">
<script type="text/javascript">
// 浏览器版本检测,必须是 Chrome 内核并且 >= 80 的版本才支持
var downloadBrowserPath = '/static/downloadBrowser.html';
try {
var match_str;
var ua_str = navigator.userAgent.toLowerCase();
var browser_chi_Type = (match_str = ua_str.match(/chrome\/([\d.]+)/)) ? "chrome" : undefined;
var version = Number(match_str[1].split('.')[0]);
if (browser_chi_Type !== 'chrome') {
window.location.href = downloadBrowserPath;
}
if (browser_chi_Type === 'chrome' && version < 80) {
window.location.href = downloadBrowserPath;
}
} catch (e) {
window.location.href = downloadBrowserPath;
}
</script>
<script type="systemjs-importmap">
{
"imports": {}
}
</script>
<script src='/static/import-map-overrides.js'></script> <!-- [email protected] source code -->
<script src='/static/promise-polyfill.min.js'></script>
<script src='/static/system.min.js'></script>
<script src='/static/named-exports.min.js'></script>
<script src='/static/use-default.min.js'></script>
<script src='/static/amd.js'></script>
<script src='/static/tinymce/tinymce.min.js'></script>
</head>
<body>
<div id="layout"></div>
<script src="/layout/layout-52ec262e7e3533d54491.js"></script> <!-- System.import is called here -->
<import-map-overrides-full show-when-local-storage="overrides-ui"></import-map-overrides-full>
</body>
</html>
from import-map-overrides.
In the html file, the import map is empty. That is why there are no modules. What module are you expecting to show?
from import-map-overrides.
Related Issues (20)
- Infer same filename with port number HOT 2
- Using import-map-overrides for making an 'in-browser' IDE. HOT 1
- Confusing reload icon after adding an override HOT 6
- IE 11 broken HOT 4
- Overrides triggers cross-origin issue when loaded into iframe (MS Teams) HOT 1
- buttons in ui can get "bad" styling HOT 1
- Failed to execute `attachShadow` on `Element` in 3.0.0 HOT 10
- Server-side single maps - cookie should specify a path HOT 1
- Bug introduced by terser HOT 1
- Is there a way to disable Auto Dev Lib Override? HOT 2
- how can i create E2E cypress tests? HOT 4
- Hi, I have this error in the console : Shadow root cannot be created on a host which already hosts a shadow tree. HOT 7
- Is it possible to support SystemJS and native imports at the same time? HOT 1
- Import maps blocked in Safari HOT 2
- cross-origin when trying to embed the single-spa app, with devtools enabled, in an iframe HOT 1
- Add configuration to control where the UI button is positioned HOT 4
- Relative imports in an import map accessed from a remote JSON file should be resolved w.r.t. the domain of the remote, not the domain of the host HOT 3
- Attribute trigger-position does not have any effect HOT 3
- An import map is added after module script load was triggered. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from import-map-overrides.