Skip to content

Using zip.js with Expo (Babel/Metro) #651

@yanagi0

Description

@yanagi0

I'm trying to use zip.js with an Expo RN project (uses Babel txpiler and Metro bundler).

I managed to install the npm package using: npx expo install "@zip.js/zip.js" (the quotes were required).

If I make use of the package like this: const { ZipReader, BlobReader } = require("@zip.js/zip.js"); then it works as expected, but I have type problems with things like getEntries() ("implicitly has type "any", etc.)

If I try to make use of the package like this: import { ZipReader, BlobReader } from "@zip.js/zip.js"; then the type problems go away, but on web the bundling fails. I see this at the console: Uncaught SyntaxError: import.meta may only appear in a module (in the entry.bundle file).

I tried installing the Babel transform-import-meta plugin, but it didn't help.

Is there a workaround? Many thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions