Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

typescript - Angular2-signaturepad used with angular gives module not found error

I am using angular2-signaturepad in my ionic angular app. It was compiling and working till a month back. Now when it compiles it gives below two errors

error TS2307: Cannot find module 'angular2-signaturepad/signature-pad' or its corresponding type declarations.
error TS2305: Module '"../../../../node_modules/angular2-signaturepad/angular2-signaturepad"' has no exported member 'SignaturePadModule'.

On checking the build logs,The one that errored has
Compiling angular2-signaturepad : es2015 as esm2015

the build that worked had
[21:50:13]: ? Compiling angular2-signaturepad : main as commonjs

I have tried to add a postinstall step in package.json for ngcc to compile all possible options,

"postinstall": "ngcc --tsconfig tsconfig.json", It now compiled below

[20:05:34]: ? Compiling angular2-signaturepad : esm2015 as esm2015
[20:05:34]: ? Compiling angular2-signaturepad : main as umd

Build still gave same two errors.

I am using ionic with angular 10.
I feel like I am missing something basic and simple. Appreciate any help with this!

question from:https://stackoverflow.com/questions/65836752/angular2-signaturepad-used-with-angular-gives-module-not-found-error

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...