Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
makeReducer
✓ const { makeReducer } = require('strange-auth')
✗ const StrangeAuth = require('strange-auth'); const reducer = StrangeAuth.makeReducer; // okay but default import not used
CommonJS only; no ESM exports.
makeActions
✓ const { makeActions } = require('strange-auth')
✗ const StrangeAuth = require('strange-auth'); const actions = StrangeAuth.makeActions; // okay
Use named import via destructuring or direct property access.
types
✓ const { types } = require('strange-auth')
✗ import { types } from 'strange-auth' // ESM not supported
Not available as ES module; use require.
statuses
✓ const { statuses } = require('strange-auth')
✗ const statuses = require('strange-auth').statuses; // okay
Import via require; statuses object contains constants like WAITING.
default import
✓ const StrangeAuth = require('strange-auth')
✗ import StrangeAuth from 'strange-auth' // ESM not supported
Library is CJS-only; default require gives the module object.
Shows how to create a store with strange-auth reducer, define actions with a mock login, and import types/statuses.
const { createStore, combineReducers } = require('redux');
const { makeReducer, makeActions, types, statuses } = require('strange-auth');
const { connect } = require('react-redux');
const authReducer = makeReducer();
const rootReducer = combineReducers({ auth: authReducer });
const store = createStore(rootReducer);
const authActions = makeActions({
login: (username, password, cb) => {
setTimeout(() => {
if (username === 'user' && password === 'pass') {
cb(null, { credentials: { token: 'abc' }, artifacts: {} });
} else {
cb(new Error('Invalid credentials'));
}
}, 100);
}
});
console.log(types); // { LOGIN_ATTEMPT: ..., LOGIN_SUCCESS: ..., LOGIN_FAILURE: ..., LOGOUT_ATTEMPT: ..., LOGOUT_SUCCESS: ..., LOGOUT_FAILURE: ... }
console.log(statuses.WAITING); // 'WAITING'
Errors
Common errors & fixes
Cannot find module 'redux-thunk'
Missing redux-thunk peer dependency
fixRun: npm install redux-thunk@2.x
Uncaught TypeError: makeActions is not a function
Using import instead of require in a CJS-only environment
fixUse const { makeActions } = require('strange-auth') instead of import. Error: Invalid credentials (or custom error)
Login function implementation error
fixEnsure the callback is called with (null, { credentials, artifacts }) on success, or (error) on failure. Audit
Dependencies
reduxrequiredpeer dependency for store management
redux-thunkrequiredpeer dependency for async actions