Skip to content

SyntaxError: Unexpected token 'export' #28

@ericshuk

Description

@ericshuk

Describe the bug
I get the following error when trying to import the package like so import { downloadZip } from "client-zip";:

SyntaxError: Unexpected token 'export'
    at compileFunction (<anonymous>)
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    at Module._compile (node:internal/modules/cjs/loader:1065:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.client-zip (/Users/ericamshukov/Projects/dt_bridge_pipetrekker_spa/.next/server/pages/index.js:20570:18) {
  page: '/'
}

To Reproduce
Steps to reproduce the behavior:

  1. Import in TypeScript file
  2. npm run
  3. SyntaxError: Unexpected token 'export'

Additional context
I am developing a project in NextJS and TypeScript, but everything else is working properly.

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