jaredwray / fumanchu

Handlebars + Helpers Together :heart:
https://fumanchu.org
MIT License
11 stars 2 forks source link

import * as handlebars from '@jaredwray/fumanchu'; does not work in v1.4.0 #53

Closed hkjeffchan closed 3 months ago

hkjeffchan commented 3 months ago

The framework(nestjs) I am using is still with "module": "commonjs" and I used to import like this: import * as handlebars from '@jaredwray/fumanchu'; handlebars.compile(receiptSubjectFile);

Everything works fine in 1.3.0

But in 1.4.0, typescript will complain the line: handlebars.compile(receiptSubjectFile);

it can run correctly at runtime but the typescript syntax check will say "Property compile does not exist on type..."


If I import like this: import handlebars from '@jaredwray/fumanchu'; handlebars.compile(receiptSubjectFile);

handlebars.compile will fail in runtime as handlebars is undefined


If I import like this: const handlebars = require('@jaredwray/fumanchu'); handlebars.compile(receiptSubjectFile);

it works on runtime and lint

jaredwray commented 3 months ago

reverted back the index.d.ts to see if that solves it.

hkjeffchan commented 3 months ago

Work perfectly now. Thanks!