Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

working with typescript #28

Open
tgeconf opened this issue Jun 3, 2020 · 3 comments
Open

working with typescript #28

tgeconf opened this issue Jun 3, 2020 · 3 comments

Comments

@tgeconf
Copy link

tgeconf commented Jun 3, 2020

I am trying to use this in a typescript project. But I just can't make it work. Is it possible to use this in typescript?

@transitive-bullshit
Copy link
Owner

It's a normal JS package that should definitely be usable via TS.

If you can give more info on the errors or issues you're running into, that'd be helpful.

@tgeconf
Copy link
Author

tgeconf commented Jun 4, 2020

Sorry I am new in writing declaration files. Dont know if this is the case. I just wrote a rough declaration file like:
declare module 'puppeteer-lottie' { const func: (opts: any) => Promise<any> export default func; }

and I got errors:

`ERROR in ./node_modules/cross-spawn/index.js
Module not found: Error: Can't resolve 'child_process' in 'C:\workspace\github\CanisGEditor\node_modules\cross-spawn'
@ ./node_modules/cross-spawn/index.js 3:11-35
@ ./node_modules/execa/index.js
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/execa/index.js
Module not found: Error: Can't resolve 'child_process' in 'C:\workspace\github\CanisGEditor\node_modules\execa'
@ ./node_modules/execa/index.js 3:21-45
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/puppeteer-lottie/index.js
Module not found: Error: Can't resolve 'child_process' in 'C:\workspace\github\CanisGEditor\node_modules\puppeteer-lottie'
@ ./node_modules/puppeteer-lottie/index.js 11:18-42
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/cross-spawn/lib/util/readShebang.js
Module not found: Error: Can't resolve 'fs' in 'C:\workspace\github\CanisGEditor\node_modules\cross-spawn\lib\util'
@ ./node_modules/cross-spawn/lib/util/readShebang.js 3:11-24
@ ./node_modules/cross-spawn/lib/parse.js
@ ./node_modules/cross-spawn/index.js
@ ./node_modules/execa/index.js
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/fs-extra/lib/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\workspace\github\CanisGEditor\node_modules\fs-extra\lib'
@ ./node_modules/fs-extra/lib/index.js 23:11-24
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/graceful-fs/graceful-fs.js
Module not found: Error: Can't resolve 'fs' in 'C:\workspace\github\CanisGEditor\node_modules\graceful-fs'
@ ./node_modules/graceful-fs/graceful-fs.js 1:9-22
@ ./node_modules/fs-extra/lib/fs/index.js
@ ./node_modules/fs-extra/lib/index.js
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/isexe/windows.js
Module not found: Error: Can't resolve 'fs' in 'C:\workspace\github\CanisGEditor\node_modules\isexe'
@ ./node_modules/isexe/windows.js 4:9-22
@ ./node_modules/isexe/index.js
@ ./node_modules/which/which.js
@ ./node_modules/cross-spawn/lib/util/resolveCommand.js
@ ./node_modules/cross-spawn/lib/parse.js
@ ./node_modules/cross-spawn/index.js
@ ./node_modules/execa/index.js
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/isexe/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\workspace\github\CanisGEditor\node_modules\isexe'
@ ./node_modules/isexe/index.js 1:9-22
@ ./node_modules/which/which.js
@ ./node_modules/cross-spawn/lib/util/resolveCommand.js
@ ./node_modules/cross-spawn/lib/parse.js
@ ./node_modules/cross-spawn/index.js
@ ./node_modules/execa/index.js
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/isexe/mode.js
Module not found: Error: Can't resolve 'fs' in 'C:\workspace\github\CanisGEditor\node_modules\isexe'
@ ./node_modules/isexe/mode.js 4:9-22
@ ./node_modules/isexe/index.js
@ ./node_modules/which/which.js
@ ./node_modules/cross-spawn/lib/util/resolveCommand.js
@ ./node_modules/cross-spawn/lib/parse.js
@ ./node_modules/cross-spawn/index.js
@ ./node_modules/execa/index.js
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/jsonfile/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\workspace\github\CanisGEditor\node_modules\jsonfile'
@ ./node_modules/jsonfile/index.js 5:8-21
@ ./node_modules/fs-extra/lib/json/jsonfile.js
@ ./node_modules/fs-extra/lib/json/index.js
@ ./node_modules/fs-extra/lib/index.js
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/ow/dist/source/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\workspace\github\CanisGEditor\node_modules\ow\dist\source'
@ ./node_modules/ow/dist/source/index.js 1:27109-27122
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/temp-dir/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\workspace\github\CanisGEditor\node_modules\temp-dir'
@ ./node_modules/temp-dir/index.js 2:11-24
@ ./node_modules/tempy/index.js
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/tempy/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\workspace\github\CanisGEditor\node_modules\tempy'
@ ./node_modules/tempy/index.js 2:11-24
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/ora/index.js
Module not found: Error: Can't resolve 'readline' in 'C:\workspace\github\CanisGEditor\node_modules\ora'
@ ./node_modules/ora/index.js 2:17-36
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts

ERROR in ./node_modules/puppeteer/lib/WebSocketTransport.js
Module not found: Error: Can't resolve 'ws' in 'C:\workspace\github\CanisGEditor\node_modules\puppeteer\lib'
@ ./node_modules/puppeteer/lib/WebSocketTransport.js 16:18-31
@ ./node_modules/puppeteer/lib/Launcher.js
@ ./node_modules/puppeteer/lib/Puppeteer.js
@ ./node_modules/puppeteer/index.js
@ ./node_modules/puppeteer-lottie/index.js
@ ./src/components/nav.ts
@ ./src/app.ts`

@Fr4nZ82
Copy link

Fr4nZ82 commented Aug 22, 2020

have u tried only declare module "puppeteer-lottie";?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants