Error Message:
Cross-origin request blocked: file:///path/to/module.js
✅ Solutions:
Error Message:
Failed to resolve module specifier "utils"
❌ Wrong:
import utils from './utils';
✅ Correct:
import utils from './utils.js';
Error Message:
SyntaxError: Cannot use import statement outside a module
✅ Solutions:
type="module"
to script tag"type": "module"
to package.jsonError Message:
require() of ES Module not supported
You're trying to require() an ES Module. Use import instead:
❌ Wrong:
const module = require('esm-module');
✅ Correct:
import module from 'esm-module';
# Run with inspector
node --inspect app.js
# Verbose loader output
node --loader-trace app.js
type="module"
in HTML