Closed marcioamr closed 5 years ago
Havent tried with typescript. There are no definitions (d.ts).
I try to use in javascript app with node but has the same error
You are trying to go with JS but you are getting a TS error? I don't get it. Node does not support imports by default if you mean that you are having the error from the description and not the one from the title. And you may be trying to load the code from src when you should work with the one in dist
No activity. Closing.
update, the same error.
rooty@linux:~/node_modules/node-signpdf$ node src/signpdf.test.js
[sudo] password for rooty:
/home/rooty/node_modules/node-signpdf/src/signpdf.test.js:1
import PDFDocument from 'pdfkit';
^^^^^^^^^^^
SyntaxError: Unexpected identifier
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Thanks.
removing "strict": true in tsconfig.json worked for me
I got this error when I tried to run this code: