Skip to content

Fix default imports#68

Open
dnicolson wants to merge 1 commit intowollardj:mainfrom
dnicolson:patch-2
Open

Fix default imports#68
dnicolson wants to merge 1 commit intowollardj:mainfrom
dnicolson:patch-2

Conversation

@dnicolson
Copy link
Copy Markdown
Contributor

This pull request fixes the following errors when running a Visual Studio Code Extension:

node_modules/simple-plist/dist/index.d.ts:1:21 - error TS1259: Module '"bplist-creator"' can only be default-imported using the 'esModuleInterop' flag

1 export { default as bplistCreator } from "bplist-creator";
                      ~~~~~~~~~~~~~

  node_modules/bplist-creator/bplistCreator.d.ts:7:3
    7   export = BPlistCreator;
        ~~~~~~~~~~~~~~~~~~~~~~~
    This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.

node_modules/simple-plist/dist/index.d.ts:2:21 - error TS1259: Module '"/Users/dave/x/node_modules/bplist-parser/bplistParser"' can only be default-imported using the 'esModuleInterop' flag

2 export { default as bplistParser } from "bplist-parser";
                      ~~~~~~~~~~~~

  node_modules/bplist-parser/bplistParser.d.ts:8:1
    8 export = bPlistParser
      ~~~~~~~~~~~~~~~~~~~~~
    This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag.


Found 2 errors in the same file, starting at: node_modules/simple-plist/dist/index.d.ts:1

Fixes changes introduced after #65.

@dnicolson
Copy link
Copy Markdown
Contributor Author

Hi @wollardj, can you please take a look at this?

@dnicolson
Copy link
Copy Markdown
Contributor Author

Here is a reduced example:

mkdir simple-plist-test
cd simple-plist-test
npm i typescript @types/node simple-plist@1.4.0
echo "import * as plist from 'simple-plist'; console.log(plist)" > index.ts
tsc index.ts

And applying this fix:

cd ..
git clone git@github.com:wollardj/simple-plist.git
cd simple-plist
git checkout v1.4.0
npm i
curl -OL https://github.com/wollardj/simple-plist/pull/68.diff
git apply 68.diff
npm run build && cp -R dist/* ../simple-plist-test/node_modules/simple-plist/dist/
cd ../simple-plist-test
tsc index.ts
node index.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant