Skip to content
This repository was archived by the owner on Jun 15, 2024. It is now read-only.
This repository was archived by the owner on Jun 15, 2024. It is now read-only.

Runtime Typescript error occurs when running bundled source for iOS  #8

@jboeijenga

Description

@jboeijenga

Hi @Merott ,

I'm trying this plugin for both iOS and Android to run and it works fine. Only after bundling the source I get a runtime error on iOS. This happens in the __extends method on the PDFViewDelegate class.

The error I get in the console is:
JS ERROR TypeError: Attempted to assign to readonly property.

And it happens the following method on assigning the constructor:
var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); };

When I remove this __extends method from the compiled js file it works fine. Also when not bundling source it works fine.

Do you have any idea how to get the plugin also working in bundled code?

Thanks!

update:
I see Nativescript adds the noEmitHelpers option to their tsconfig. This prevents typescript from adding the __extends method to the compiled output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions