Skip to content

ParseError: 'import' and 'export' may appear only with 'sourceType: module' #45

@lastlink

Description

@lastlink

I'm getting a build error when trying to import any of the libraries

node_modules\typeconv\dist\index.js:1
export * from "./types.js";
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

main.ts

import {
    getTypeScriptReader,
    getOpenApiWriter,
    makeConverter,
    getTypeScriptWriter,
    getOpenApiReader,
  } from "typeconv"

tsconfig.json

 "target": "es2016",                                  /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
    "lib": [
      "DOM",
      "ES2016"
    ], 
   "module": "CommonJS",                                /* Specify what module code is generated. */

package.json

    "build:client": "npm run mkdir:dist && browserify src/main.ts -p [ tsify --noImplicitAny ] > dist/bundle.js",

npm run build;client

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