PeculiarVentures / webcrypto-liner

webcrypto-liner is a polyfill that let's down-level User Agents (like IE/Edge) use libraries that depend on WebCrypto. (Keywords: Javascript, WebCrypto, Shim, Polyfill)
MIT License
148 stars 26 forks source link

Unable to build #71

Closed YuryStrozhevsky closed 3 years ago

YuryStrozhevsky commented 4 years ago

On Windows 10, fresh copy from GitHub:

D:\Downloads\webcrypto-liner-master (8)\webcrypto-liner-master>npm run build

> webcrypto-liner@1.1.2 build D:\Downloads\webcrypto-liner-master (8)\webcrypto-liner-master
> rollup -c

src/lib.ts → build/index.js, build/index.es.js...
[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
src\init.ts (3:28)
1: import { nativeSubtle } from "./native";
2:
3: function WrapFunction(subtle: any, name: string) {
                               ^
4:     const fn = subtle[name];
5:     // tslint:disable-next-line:only-arrow-functions
Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
    at error (D:\Downloads\webcrypto-liner-master (8)\webcrypto-liner-master\node_modules\rollup\dist\rollup.js:5365:30)
    at Module.error (D:\Downloads\webcrypto-liner-master (8)\webcrypto-liner-master\node_modules\rollup\dist\rollup.js:9708:9)
    at tryParse (D:\Downloads\webcrypto-liner-master (8)\webcrypto-liner-master\node_modules\rollup\dist\rollup.js:9617:16)
    at Module.setSource (D:\Downloads\webcrypto-liner-master (8)\webcrypto-liner-master\node_modules\rollup\dist\rollup.js:9935:33)
    at Promise.resolve.catch.then.then.then (D:\Downloads\webcrypto-liner-master (8)\webcrypto-liner-master\node_modules\rollup\dist\rollup.js:12205:20)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webcrypto-liner@1.1.2 build: `rollup -c`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the webcrypto-liner@1.1.2 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\y-str\AppData\Roaming\npm-cache\_logs\2020-01-04T10_21_13_366Z-debug.log

And I do recommend to make a real build checking on TravisCI: even if there is a badge build: passed at the moment TravisCI does not check build, only coverage.

microshine commented 4 years ago

@YuryStrozhevsky Travis CI uses prepare script which compiles source code

https://travis-ci.org/PeculiarVentures/webcrypto-liner/jobs/627175272#L248

Maybe the problem is in tslint version

YuryStrozhevsky commented 3 years ago

The problem was due to this issue. In short - full path to the project which is using rollup-plugin-typescript2 MUST not contain any parentheses.