Open larryhuang opened 3 years ago
Its still giving issue with node v14.18.0 and simple-plist version 1.3.0 not with 1.1.0
I haven't seen this issue myself and I can't seem to reproduce it locally with node v16.13.0 on macOS. @rajmonotype are you also on Windows by chance?
I think the issue might relate to using ESM imports, I can reproduce the problem if I use import
instead of require
.
@larryhuang have you find a way to fix the issue?
@rajmonotype have you find a way to fix the issue?
The issue I'm experiencing appears to relate to changes in version 1.3.1 where a default export is incompatible with version 1.3.0 for ESM imports but still may be relevant to this issue.
CommonJS imports work with 1.3.1 but ESM imports have issues with missing types in bplist-creator
and bplist-parser
and there is no default export in bplist-parser
.
The issue I'm experiencing appears to relate to changes in version 1.3.1 where a default export is incompatible with version 1.3.0 for ESM imports but still may be relevant to this issue.
CommonJS imports work with 1.3.1 but ESM imports have issues with missing types in
bplist-creator
andbplist-parser
and there is no default export inbplist-parser
.
@dnicolson how did you solve an issue?
@realtril I don't have a solution, have you tried using CommonJS imports? For example:
const plist = require("simple-plist");
yeah, simple-plist
is a subdependency. so all over the places it is being used by CommonJS imports.
Hey @larryhuang et al. I've just released v1.4.0 over on npm under the next
tag. I realize this issue is old, but if anyone listed here is still struggling with the issue, please give 1.4.0 a shot and let me know if it does the trick.
I had this issue on the latest stable 1.3.1
. Upgrading to 1.4.0
changes which module this breaks on:
import plist from "simple-plist"
yarn run v1.22.19
$ npx ttsc
node_modules/simple-plist/dist/parse.d.ts:3:33 - error TS7016: Could not find a declaration file for module 'plist'. '/Users/myusername/path/to/my/repo/node_modules/plist/index.js' implicitly has an 'any' type.
Try `npm i --save-dev @types/plist` if it exists or add a new declaration (.d.ts) file containing `declare module 'plist';`
3 import type { PlistValue } from "plist";
~~~~~~~
Found 1 error in node_modules/simple-plist/dist/parse.d.ts:3
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Environment:
// tsconfig.json
{
"compilerOptions": {
"esModuleInterop": true,
"module": "commonjs",
"noImplicitReturns": true,
"noUnusedLocals": true,
"outDir": "dist",
"plugins": [
{
"transform": "typia/lib/transform"
}
],
"sourceMap": true,
"strict": true,
"target": "es2017"
},
"compileOnSave": true,
"include": [
"src"
],
}
@walkingbrad there are no default exports, according to the documentation you need to import named exports:
import * as plist from "simple-plist";
With version 1.4.0 I see different errors outlined in https://github.com/wollardj/simple-plist/pull/68#issuecomment-1666886401.
Hey @larryhuang et al. I've just released v1.4.0 over on npm under the
next
tag. I realize this issue is old, but if anyone listed here is still struggling with the issue, please give 1.4.0 a shot and let me know if it does the trick.
I've just tried 1.4.0-0 and it fixes my issue, compiling fine now. Is there an ETA for when 1.4.0 will be fully released or if the type issues can be fixed in the 1.3 branch?
What I was seeing: with import plist from 'simple-plist'
My errors:
I also got errors with bplistCreator
when I was noodling around trying to get around it.
Here's the full set of errors shown in vscode Problems when I look at the file
"simple-plist": "next"
does fix the compiler errors 🙏
Environment:
Scenario
Error