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

"has no exported member 'FakeTimerInstallOpts'" error when building out of the box #184

Open
RupertBarrow opened this issue Dec 9, 2022 · 1 comment

Comments

@RupertBarrow
Copy link

Summary

Building out of the box generates the following error : has no exported member 'FakeTimerInstallOpts'

Steps To Reproduce:

  1. yarn install
  2. yarn prepack

Expected result

Should build

Actual result

% yarn prepack
yarn run v1.22.19
$ yarn run build && oclif-dev manifest
$ yarn run clean:lib && yarn compile
$ shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json
$ tsc -b
node_modules/@types/sinon/index.d.ts:1447:53 - error TS2694: Namespace '"/Users/rupert/Downloads/plugin-metadata-hook-demo-master/node_modules/@sinonjs/fake-timers/types/fake-timers-src"' has no exported member 'FakeTimerInstallOpts'.

1447 useFakeTimers: boolean | Partial<FakeTimers.FakeTimerInstallOpts>;
~~~~~~~~~~~~~~~~~~~~

node_modules/@types/sinon/index.d.ts:1569:67 - error TS2694: Namespace '"/Users/rupert/Downloads/plugin-metadata-hook-demo-master/node_modules/@sinonjs/fake-timers/types/fake-timers-src"' has no exported member 'FakeTimerInstallOpts'.

1569 useFakeTimers(config?: number | Date | Partial<FakeTimers.FakeTimerInstallOpts>): SinonFakeTimers;
~~~~~~~~~~~~~~~~~~~~
Found 2 errors.

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
rupert@MacBook-Pro-de-Rupert plugin-metadata-hook-demo-master %

Additional information

I'm using TypeScript version 4.4.4

VS Code Version:

SFDX CLI Version:

OS and version: MacOS 11.7.1

@RupertBarrow
Copy link
Author

I managed to build with no errors by changing package.json :
added :

    "@sinonjs/commons": "^1.8.3",
    "@sinonjs/fake-timers": "^8.1.0",
    "@sinonjs/samsam": "^6.0.2"

to dependencies

added :

    "@sinonjs/eslint-config": "^4.0.2",
    "@sinonjs/eslint-plugin-no-prototype-methods": "^0.1.1",
    "@sinonjs/referee": "^8.0.2"

to devDependencies
(to use Sinon 12.0.43 instead of 11.1.2 :
https://github.com/sinonjs/sinon/blob/a38306f822ae743097685d00e9ee0f92f9949cb8/package.json )

and replaced TypeScript version by :
"typescript": "4.4.4",

(possibly an unrelated issue : conflist between TS 4.5.4 (which I have by default on my Mac) and OCLIF.

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

1 participant