# SystemJS Errors This page lists the SystemJS errors that you may encounter. ## 1 ### Import Map contains invalid JSON SystemJS Error #1 occurs when you have a `` element in your HTML page that has invalid JSON content (See [import maps documentation](https://github.com/systemjs/systemjs/blob/master/docs/import-maps.md)). A common mistake that causes this a trailing comma on the last module in the import map, which is invalid JSON. ```html ``` Note that this error also can occur for external import maps (those with `src=""` attribute). Check the network tab of your browser devtools to verify that the response body for the external import map is valid json. ## 2 ### Unable to resolve bare specifier SystemJS Error #2 occurs when you attempt to load a module that doesn't have a URL associated with it. Bare specifiers must be defined by import maps in SystemJS. To fix the error, add the module to your import map: ```html ``` A "specifier" is the string name of a module. A specifier may be a URL (`/thing.js` or `https://unpkg.com/vue`) or a "bare specifier" (`vue`). Error #3 most commonly occurs when using bare specifiers. "Resolution" refers to converting a specifier into a URL. This happens in any of the following scenarios: - a module is loaded directly - `System.import('specifier')` - a module is loaded as a dependency - `System.register(['specifier'], ...)` or `define(['specifier'], ...)` - a module is resolved manually - `System.resolve('specifier')` To fix this error, you may either use [import maps](/docs/import-maps.md) or [hook System.resolve](/docs/hooks.md#resolveid-parenturl---string): ```html ``` ## 3 ## Module did not instantiate SystemJS Error #3 occurs when a module fails to instantiate. This occurs when the instantiate hook returns a Promise that resolves with no value. This generally occurs when a module was downloaded and executed but did not call [`System.register()`](/docs/api.md#systemregisterdeps-declare) (or `define()` for AMD modules). To fix, ensure that the module calls System.register during its initial, top-level execution. Instantiation refers to downloading and executing the code for a module. The instantiation for a single module refers to an array that represents the module's dependencies, exports, and code. SystemJS has various methods of instantiating modules, generally involving either a ` ``` SystemJS Error #6 is logged by SystemJS to implement [Step 6.1 of this part of the import maps spec](https://wicg.github.io/import-maps/#sort-and-normalize-a-specifier-map). ## 7 ### AMD require is not supported SystemJS Error #7 occurs when you attempt to use the [AMD require() function](https://github.com/amdjs/amdjs-api/wiki/require). SystemJS supports much of AMD's core functionality, but does not currently support all of the extensions to AMD, including AMD require. This could be implemented in a custom extension for your organization, if needed. ## 8 ### Named AMD modules require the named-register extra SystemJS Error #8 occurs when you attempt to register a named AMD module, but have not included the [named-register extra](/README.md#extras). A named AMD module is created by calling `define('name', ...)`. To diagnose, first determine which module is the named AMD module. You can do so by checking the stacktrace in the browser console, or by placing a breakpoint in your devtools to pause on all uncaught exceptions. A common cause of this issue is that you are using webpack's [`output.library` option](https://webpack.js.org/configuration/output/#outputlibrary) or rollup's [`output.name` option](https://rollupjs.org/guide/en/#outputname), which both result in named AMD define. If your module is being imported by SystemJS, there is no benefit to keeping the library name, and you should remove it. Another common cause of this issue is for a third party scripts to call `define()` as part of their UMD build. Such scripts may call `define()` even when not triggered by `System.import()`, which can cause this error. In such cases, consider removing the SystemJS AMD extra entirely, so that they do not call `define()` at all. If none of those apply to your situation, consider adding the named-register extra: ```html ``` ## 9 ### Failed to fetch module - wrong HTTP status SystemJS Error #9 occurs when SystemJS attempted to load a module with [`fetch()`](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API), but the HTTP response status was not >= 200 and < 300. This error occurs when using either the module-types or transform extras. The module-types extension is included in `system.js`, but not in `s.js`. When using the transform extra, SystemJS uses `fetch()` to load all modules. However, when using the module-types extension (included in system.js), SystemJS uses `fetch()` instead of `