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

Problems compiling from source #51

Open
robertgzr opened this issue May 10, 2019 · 1 comment
Open

Problems compiling from source #51

robertgzr opened this issue May 10, 2019 · 1 comment

Comments

@robertgzr
Copy link

After following the instructions here I run into the following two errors:

/src/node_modules/.bin/tsc --pretty -p ./browser
node_modules/@types/webcomponents.js/index.d.ts:39:9 - error TS2687: All declarations of 'extends' must have identical modifiers.

39         extends?: string;
           ~~~~~~~

That can be resolved by applying the following patch to node_modules/@types/webcomponents.js/index.d.ts:

@@ -36,7 + +36,7 @@
 declare global {
     // This contains duplicates of some types in lib.dom.d.ts in order to support typescript 2.0
     interface ElementDefinitionOptions {
-        extends?: string;
+        extends: string;
     }

     interface ShadowRoot extends DocumentFragment {

And after that

/src/node_modules/.bin/tsc --pretty -p ./renderer
node_modules/marked-sanitizer-github/index.ts:200:46 - error TS2345: Argument of type '{ onopentag: (name: string, attrs: { [s: string]: string; }) => void; oncomment: () => void; }' is not assignable to parameter of type 'DomHandler'.
  Property 'onparserinit' is missing in type '{ onopentag: (name: string, attrs: { [s: string]: string; }) => void; oncomment: () => void; }'.

200     private readonly parser = new HTMLParser({
                                                 ~
201         onopentag: (name, attrs) => {
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
208         // Note: onerror is not handled because no error occurs while only parsing an opening tag
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
209     });
    ~~~~~

To resolve that I needed to add all the callbacks defined by the HTMLParser object to the initialization in node_modules/marked-sanitizer-github/index.ts:

@@ -206,6 +206,15 @@
         },
         // Note: CDATA (cdatastart) is not handled
         // Note: onerror is not handled because no error occurs while only parsing an opening tag
+        onparserinit: () => {},
+        onend: () => {},
+        onreset: () => {},
+        onerror: () => {},
+        onclosetag: () => {},
+        oncommentend: () => {},
+        ontext: () => {},
+        oncdatastart: () => {},
+        onprocessinginstruction: () => {},
     });

     reset() {
@robertgzr
Copy link
Author

Also hijacking this issue to ask about your opinion of packaging Shiba as an AppImage?

It should be easy to integrate by making use of electron-builder :)

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

1 participant