Open martin-fuhrer opened 2 years ago
That is strange. When you remove the minify command, you can see the error is coming from axios
trying to split a package.json without a version
prop https://github.com/axios/axios/blob/5112ba3ee1cdd287638f4cc81d7dd0edaf67ca15/lib/helpers/validator.js#L15
The workaround is adding a version
property to your package.json
It is interesting, but how it can works with @zeit/ncc then ? The dependencies are the same and the package.json too.
It seems like its resolving the wrong package.json here
It doesn't fail when using JS source, only TS source so that makes me think the baseUrl
in tsconfig.json
is causing the issue.
cc @guybedford
If it's just the _resolved
, _integrity
and _from
fields that are different, those are metadata markers added by npm, so it could be a metadata difference. Or are there other fields diffing apart from those?
@guybedford In this case, its not just the private fields, its actually the wrong package.json (it uses the root package.json from the cwd instead of node_modules/axios/package.json)
We updated one of our projects from @zeit/ncc to @vercel/ncc and get a runtime error "TypeError: Cannot read property 'split' of undefined" since then. I could nail it down to a function import from @azure/ms-rest-nodeauth.
The attached file contains a minimal project demonstrating the error. To reproduce it, please execute these commands:
When going back to @zeit/ncc, the error doesn't occur anymore:
ncc-test.tar.gz