Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

yarn run prepack fails for newly generated plugin #62

Closed
amtrack opened this issue Nov 15, 2019 · 5 comments
Closed

yarn run prepack fails for newly generated plugin #62

amtrack opened this issue Nov 15, 2019 · 5 comments

Comments

@amtrack
Copy link

amtrack commented Nov 15, 2019

Summary

yarn run prepack throws error TS2440: Import declaration conflicts with local declaration of 'ConfigContents'

Steps To Reproduce:

$ sfdx plugins:generate foo # accept all defaults
$ cd foo
$ yarn run prepack

Expected result

yarn run prepack should succeed

Actual result

yarn run v1.19.1
$ rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme
node_modules/@salesforce/core/lib/config/configStore.d.ts:4:10 - error TS2440: Import declaration conflicts with local declaration of 'ConfigContents'.

4 import { ConfigContents } from './configStore';
           ~~~~~~~~~~~~~~


Found 1 error.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Additional information

It seems that this started to fail since typescript was being resolved to v3.7.2 on generating the plugin.

SFDX CLI Version: sfdx-cli/7.33.2 darwin-x64 node-v12.12.0

$ sfdx plugins --core
@oclif/plugin-commands 1.2.3 (core)
@oclif/plugin-help 2.2.1 (core)
@oclif/plugin-not-found 1.2.3 (core)
@oclif/plugin-plugins 1.7.8 (core)
@oclif/plugin-update 1.3.9 (core)
@oclif/plugin-warn-if-update-available 1.7.0 (core)
@oclif/plugin-which 1.0.3 (core)
@salesforce/sfdx-trust 3.0.7 (core)
analytics 1.2.2 (core)
generator 1.1.2 (core)
salesforcedx 47.6.2 (core)
├─ salesforce-alm 47.9.0 (core)
└─ salesforcedx-templates 47.6.2 (core)
sfdx-cli 7.33.2 (core)

OS and version: MacOS Catalina (10.15.1)

@tnoonan-salesforce
Copy link
Collaborator

I just published a new version of core with this fix.

https://www.npmjs.com/package/@salesforce/core

2.1.5

You'll need to delete the yarn.lock and run yarn again.

@amtrack
Copy link
Author

amtrack commented Nov 15, 2019

@tnoonan-salesforce Thanks! 👍

amtrack added a commit to amtrack/sfdx-browserforce-plugin that referenced this issue Jan 12, 2020
This resolves an issue with multiple indirect dependencies to @salesforce/core.
See forcedotcom/sfdx-plugin-generate#62 for more.
@dieffrei
Copy link

@amtrack does it work for you?
I updated dependency in my package.json file and deleted yarn.lock and still getting the same error.
$ rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme
node_modules/@salesforce/command/node_modules/@salesforce/core/lib/config/configStore.d.ts:4:10 - error TS2440: Import declaration conflicts with local declaration of 'ConfigContents'.

@amtrack
Copy link
Author

amtrack commented Feb 27, 2020

@dieffrei Yes, deleting the yarn.lock and running yarn again to regenerate the file actually worked for me.
If this problem still persists as you described, I would try to inspect the yarn.lock file and search for different versions of @salesforce/core to determine packages that might depend on older version.
Also make sure that there is no package-lock.json file by accident.
Is the the git repo publicly available which you're having problems with, so I could have a look?

@dieffrei
Copy link

dieffrei commented Mar 3, 2020

Thank you @amtrack It helped!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants