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.
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 likegetEntries()("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 theentry.bundlefile).I tried installing the Babel transform-import-meta plugin, but it didn't help.
Is there a workaround? Many thanks in advance.