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 name 'function' after upgrade to 1.2.9 #314

Closed
pjunlin opened this issue Oct 7, 2020 · 7 comments
Closed

Cannot find name 'function' after upgrade to 1.2.9 #314

pjunlin opened this issue Oct 7, 2020 · 7 comments
Labels
Milestone

Comments

@pjunlin
Copy link

pjunlin commented Oct 7, 2020

Hi,
We meet npm run build error when upgrade this library to version 1.2.9, any idea about this? There is no issue for 1.2.7

node_modules/jsonschema/lib/index.d.ts:98:27 - error TS2304: Cannot find name 'function'.

98 preValidateProperty?: function;

@pjunlin
Copy link
Author

pjunlin commented Oct 7, 2020

@awwright , seems related to your submit in 4ae8610.
Thank you!

@awwright
Copy link
Collaborator

awwright commented Oct 7, 2020

@pjunlin What is giving you the error? I'm not sure how to write a test for this

@pjunlin
Copy link
Author

pjunlin commented Oct 7, 2020

@awwright does this
preValidateProperty?: function syntax related to specific node version , my node -v returns v12.18.0,
and my project has dev dependency on your latest 1.2.9 version jsonschema, and it just failed when run
npm run build

@pjunlin
Copy link
Author

pjunlin commented Oct 7, 2020

testjsonschema.zip
@awwright I upload a very simple project for you to test, just run npm i and npm run build
And it fails with

$ npm run build

testjsonschema@1.0.0 build C:\Users\i\Desktop\testjsonschema
tsc

node_modules/jsonschema/lib/index.d.ts:98:27 - error TS2304: Cannot find name 'function'.

98 preValidateProperty?: function;
~~~~~~~~

Found 1 error.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! testjsonschema@1.0.0 build: tsc
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the testjsonschema@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\i\AppData\Roaming\npm-cache_logs\2020-10-07T06_53_28_162Z-debug.log

@zsgalusz
Copy link

zsgalusz commented Oct 7, 2020

function is not valid typescript in the type definition there, it should be capitalised Function

@awwright
Copy link
Collaborator

awwright commented Oct 7, 2020

@pjunlin @zsgalusz This should be fixed in 1.2.10, c820ba8

Could you consider submitting a PR to add a test for this bug? I'm not sure where to start.

@awwright awwright added this to the v1.2.10 milestone Oct 7, 2020
@awwright awwright added the bug label Oct 7, 2020
mergify bot pushed a commit to aws/aws-cdk that referenced this issue Oct 7, 2020
bump the minor version to `1.2.10` to avoid a [bug](tdegrunt/jsonschema#314) in version `1.2.9`.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@awwright
Copy link
Collaborator

awwright commented Oct 7, 2020

I'm going to close this out because the bugfix is published. Please see #316 for adding tests.

@awwright awwright closed this as completed Oct 7, 2020
eladb pushed a commit to cdklabs/decdk that referenced this issue Jan 18, 2022
bump the minor version to `1.2.10` to avoid a [bug](tdegrunt/jsonschema#314) in version `1.2.9`.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants