Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'bplist-creator' #58

Open
larryhuang opened this issue Dec 9, 2021 · 14 comments
Open

Cannot find module 'bplist-creator' #58

larryhuang opened this issue Dec 9, 2021 · 14 comments

Comments

@larryhuang
Copy link

Environment:

  • Node 16.9.1
  • electron 16.0.0
  • electron-builder 22.14.5
  • simple-plist 1.3.0
  • webpack 5.64.1
  • windows 11

Scenario

  • Developing in Windows 11 + Visual studio code
  • Run npm start to launch my application
  • show bplist-creator error

Error

  • Uncaught Exception
  • Error: Cannot find module 'bplist-creator'
    Screen Shot 2021-12-09 at 21 03 40
@rajmonotype
Copy link

Its still giving issue with node v14.18.0
and simple-plist version 1.3.0 not with 1.1.0

@wollardj
Copy link
Owner

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?

@dnicolson
Copy link
Contributor

I think the issue might relate to using ESM imports, I can reproduce the problem if I use import instead of require.

@realtril
Copy link

realtril commented Apr 6, 2022

@larryhuang have you find a way to fix the issue?

@realtril
Copy link

realtril commented Apr 6, 2022

@rajmonotype have you find a way to fix the issue?

@dnicolson
Copy link
Contributor

dnicolson commented Apr 10, 2022

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.

@realtril
Copy link

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.

@dnicolson how did you solve an issue?

@dnicolson
Copy link
Contributor

@realtril I don't have a solution, have you tried using CommonJS imports? For example:

const plist = require("simple-plist");

@realtril
Copy link

dnicolson

yeah, simple-plist is a subdependency. so all over the places it is being used by CommonJS imports.

@wollardj
Copy link
Owner

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.

Kudo added a commit to expo/expo-cli that referenced this issue Sep 23, 2022
# Why

`simple-plist@1.3.1` is a transitive dependency of the xcode package. it has [an incompatible issue](wollardj/simple-plist#58) with ncc. the issue is pending for a while without publishing newer version as latest dist-tag. that blocks us from updating install-expo-modules.

# How

replace xcode with the awesome xcparse. this pr introduces a `withXCParseXcodeProject` config-plugin internally.

# Test Plan

- ✅ unit test passed
- ✅ manual test on a react-native 0.68 project
- ✅ manual test on a react-native 0.69 project
@walkingbrad
Copy link

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:

  • node 18
  • typescript 4.5.3
  • ttypescript 1.5.13
// 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"
  ],
}

@dnicolson
Copy link
Contributor

@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 #68 (comment).

@davfive
Copy link

davfive commented Oct 5, 2023

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:
image

image

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
image

@walkingbrad
Copy link

"simple-plist": "next" does fix the compiler errors 🙏

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 a pull request may close this issue.

7 participants