Troubleshooting Guide
Common issues and solutions when working with LearnCard SDK
This guide addresses common issues encountered when developing with LearnCard SDK and provides practical solutions and workarounds.
Installation and Setup Issues
Module Resolution Errors
Issue: Errors like Cannot find module '@learncard/core'
or Cannot find module '@learncard/init'
Solutions:
Verify package installation:
Check for version mismatches between LearnCard packages:
Clear node_modules and reinstall:
WASM Loading Issues
Issue: Errors related to WASM loading, particularly in browsers or serverless environments
Error messages:
WebAssembly module is included in initial chunk
Error: Unable to load WASM module
Solutions:
For webpack, ensure proper WASM loading configuration:
For Next.js, use dynamic imports:
Provide your own WASM bundle path:
Credential Issuance and Verification Issues
Invalid Signature Errors
Issue: Verification equation was not satisfied
or Signature error
during credential verification
Solutions:
Ensure you're using the same wallet instance for verification that was used for issuance
Check for credential tampering or modification after issuance
Verify the credential format matches expected schema
Check if the credential has been properly signed:
DID Resolution Failures
Issue: Errors like Unable to resolve DID
or Not a valid DID
during verification
Solutions:
Verify the DID format:
Check network connectivity if resolving remote DIDs
For
did:web
, ensure the domain is accessible and properly configuredTry resolving the DID manually:
Storage and Retrieval Issues
URI Resolution Failures
Issue: Unable to retrieve credentials from URIs, getting null
or errors
Solutions:
Check URI format:
Verify network connectivity for remote storage
Ensure the credential exists at the specified location
For LearnCloud storage, check API connectivity:
Index Retrieval Issues
Issue: index.[provider].get()
returns empty array or missing credentials
Solutions:
Verify credentials were properly added to the index:
Ensure you're using the same wallet instance (same seed) that added the credentials
Check if the storage service is accessible
Plugin-Related Issues
Plugin Not Found
Issue: Errors like Cannot invoke method from undefined plugin: [methodName]
Solutions:
Ensure plugin is properly registered:
Check plugin initialization order (dependency plugins should be loaded first)
Verify plugin compatibility with your LearnCard Core version
Plugin Method Errors
Issue: Unexpected errors when calling plugin methods
Solutions:
Check method parameters match expected types
Verify plugin version compatibility with core
Enable debug mode if available:
Browser/Environment-Specific Issues
CORS Issues
Issue: CORS errors when accessing storage or DIDs in browser environments
Solutions:
Ensure your backend properly sets CORS headers
For development, consider using a CORS proxy
For Ceramic/LearnCloud, check endpoint configurations
Mobile Web View Incompatibilities
Issue: LearnCard functionality not working in mobile web views
Solutions:
Ensure WASM is supported in the web view
Check for any mobile-specific storage limitations
Consider using LearnCard Bridge HTTP API for mobile apps
Debugging Techniques
Enable Verbose Logging
Add a logging plugin to capture detailed information:
Inspect Credential Structure
For verification issues, inspect the credential structure:
Getting Help
If you continue to experience issues after trying the solutions in this guide:
Check the GitHub repository for open issues
Join the Learning Economy Discord for community support
Submit a detailed bug report with:
LearnCard SDK version
Node.js/browser version
Complete error message and stack trace
Minimal reproducible example
Environment details (OS, deployment context)
Last updated
Was this helpful?