gristlabs/ts-interface-checker

Uncaught TypeError: r is not a function

gusarov opened this issue · 1 comments

It all works in development mode, but fails in prod, even ng serve --prod

main.3373bd908bf1d098cd2f.js:1 Uncaught TypeError: r is not a function
    at e.createCheckers (main.3373bd908bf1d098cd2f.js:1)
    at Module.zUnb (main.3373bd908bf1d098cd2f.js:1)
    at l (runtime.8fbc2fd6f12647d93e24.js:1)
    at Object.0 (main.3373bd908bf1d098cd2f.js:1)
    at l (runtime.8fbc2fd6f12647d93e24.js:1)
    at t (runtime.8fbc2fd6f12647d93e24.js:1)
    at Array.r [as push] (runtime.8fbc2fd6f12647d93e24.js:1)
    at main.3373bd908bf1d098cd2f.js:1

My code is:

import { UserProfile } from '../_model/userProfile';
import { createCheckers } from 'ts-interface-checker';
const { UserProfile } = createCheckers(todoUserTI, userProfileTI);

and *TI files are generated from the model

"ts-interface-checker": "^0.1.13",
"ts-interface-builder": "^0.2.2",

Did you figure this out? If there is a difference between dev and prod, that seems likely a build-related issue. From your example, I can't tell what todoUserTI and userProfileTI are, but it sounds like in prod they are not what they are supposed to be.