# Runtime
This page collects runtime-related error codes and common troubleshooting guidance.
## Error Codes
- [RUNTIME-001](#runtime-001)
- [RUNTIME-002](#runtime-002)
- [RUNTIME-003](#runtime-003)
- [RUNTIME-004](#runtime-004)
- [RUNTIME-005](#runtime-005)
- [RUNTIME-006](#runtime-006)
- [RUNTIME-007](#runtime-007)
- [RUNTIME-008](#runtime-008)
- [RUNTIME-009](#runtime-009)
## RUNTIME-001
### A preload for '[http://resource-url](http://resource-url)' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
#### Reason
When the producer URL is a manifest, loading this producer module will automatically preload the corresponding resources. If the above warning occurs, it is because the default preload does not configure credentials, while the actual `load remote script` carries the corresponding credentials, causing the preload to fail.
#### Solution
Add a runtime plugin via [runtimePlugins](/configure/runtimeplugins.md) and configure the `crossorigin` attribute in the [createLink](/plugin/dev/index.md#createlink) hook. Its value needs to be consistent with the actual `load script`.
For example, to modify the crossorigin attribute of the preloaded link to `anonymous`:
```ts title="runtimePlugin.ts"
import { ModuleFederationRuntimePlugin } from '@module-federation/runtime/types';
export default function MFLinkPlugin(): ModuleFederationRuntimePlugin {
return {
name: 'link-plugin',
createLink({ url }) {
const link = document.createElement('link');
link.setAttribute('href', url);
link.setAttribute('rel', 'preload');
link.setAttribute('as', 'script');
link.setAttribute('crossorigin', 'anonymous');
return link
}
};
}
```
Failed to get remoteEntry exports.
- Error Code:
RUNTIME-001
The remote entry interface does not contain "init"
- Error Code:
RUNTIME-002
Failed to get manifest.
- Error Code:
RUNTIME-003
Failed to locate remote.
- Error Code:
RUNTIME-004
Invalid loadShareSync function call from bundler runtime
- Error Code:
RUNTIME-005
Invalid loadShareSync function call from runtime
- Error Code:
RUNTIME-006
Failed to get remote snapshot.
- Error Code:
RUNTIME-007
Failed to load script resources.
- Error Code:
RUNTIME-008
Please call createInstance first.
- Error Code:
RUNTIME-009
### A preload for '[http://resource-url](http://resource-url)' is found, but is not used because the request credentials mode does not match. Consider taking a look at crossorigin attribute.
#### Reason
When the producer URL is a manifest, loading this producer module will automatically preload the corresponding resources. If the above warning occurs, it is because the default preload does not configure credentials, while the actual `load remote script` carries the corresponding credentials, causing the preload to fail.
#### Solution
Add a runtime plugin via [runtimePlugins](/configure/runtimeplugins.md) and configure the `crossorigin` attribute in the [createLink](/plugin/dev/index.md#createlink) hook. Its value needs to be consistent with the actual `load script`.
For example, to modify the crossorigin attribute of the preloaded link to `anonymous`:
```ts title="runtimePlugin.ts"
import { ModuleFederationRuntimePlugin } from '@module-federation/runtime/types';
export default function MFLinkPlugin(): ModuleFederationRuntimePlugin {
return {
name: 'link-plugin',
createLink({ url }) {
const link = document.createElement('link');
link.setAttribute('href', url);
link.setAttribute('rel', 'preload');
link.setAttribute('as', 'script');
link.setAttribute('crossorigin', 'anonymous');
return link
}
};
}
```