Repository navigation
Labels
area: upstreamoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
Bug Report
- I would like to work on a fix!
Current behavior
I'm using aws sam to deploy lambdas with babel.
I have babel in dependencies
"dependencies": {
"@babel/runtime": "^7.9.2",
}
I'm running
npm install
npm run build
sam build
sam deploy
process breaks on sam deploy with error
the only project with date older than 1980 I could find is babel
find -not -newermt 'jan 01, 1980'
node_modules/@babel/parser/CHANGELOG.md
node_modules/@babel/parser/LICENSE
node_modules/@babel/parser/README.md
node_modules/@babel/parser/bin/babel-parser.js
node_modules/@babel/parser/lib/index.js
node_modules/@babel/parser/lib/index.js.map
node_modules/@babel/parser/typings/babel-parser.d.ts
node_modules/@babel/types/LICENSE
node_modules/@babel/types/README.md
node_modules/@babel/types/lib/asserts/assertNode.js
node_modules/@babel/types/lib/asserts/generated/index.js
node_modules/@babel/types/lib/builders/builder.js
node_modules/@babel/types/lib/builders/flow/createFlowUnionType.js
node_modules/@babel/types/lib/builders/flow/createTypeAnnotationBasedOnTyp
node_modules/@babel/types/lib/builders/generated/index.js
node_modules/@babel/types/lib/builders/react/buildChildren.js
node_modules/@babel/types/lib/builders/typescript/createTSUnionType.js
node_modules/@babel/types/lib/clone/clone.js
node_modules/@babel/types/lib/clone/cloneDeep.js
node_modules/@babel/types/lib/clone/cloneDeepWithoutLoc.js
node_modules/@babel/types/lib/clone/cloneNode.js
node_modules/@babel/types/lib/clone/cloneWithoutLoc.js
node_modules/@babel/types/lib/comments/addComment.js
node_modules/@babel/types/lib/comments/addComments.js
node_modules/@babel/types/lib/comments/inheritInnerComments.js
node_modules/@babel/types/lib/comments/inheritLeadingComments.js
node_modules/@babel/types/lib/comments/inheritTrailingComments.js
node_modules/@babel/types/lib/comments/inheritsComments.js
node_modules/@babel/types/lib/comments/removeComments.js
node_modules/@babel/types/lib/constants/generated/index.js
node_modules/@babel/types/lib/constants/index.js
node_modules/@babel/types/lib/converters/ensureBlock.js
node_modules/@babel/types/lib/converters/gatherSequenceExpressions.js
node_modules/@babel/types/lib/converters/toBindingIdentifierName.js
node_modules/@babel/types/lib/converters/toBlock.js
node_modules/@babel/types/lib/converters/toComputedKey.js
node_modules/@babel/types/lib/converters/toExpression.js
node_modules/@babel/types/lib/converters/toIdentifier.js
node_modules/@babel/types/lib/converters/toKeyAlias.js
node_modules/@babel/types/lib/converters/toSequenceExpression.js
node_modules/@babel/types/lib/converters/toStatement.js
node_modules/@babel/types/lib/converters/valueToNode.js
node_modules/@babel/types/lib/definitions/core.js
node_modules/@babel/types/lib/definitions/experimental.js
node_modules/@babel/types/lib/definitions/flow.js
node_modules/@babel/types/lib/definitions/index.js
node_modules/@babel/types/lib/definitions/jsx.js
node_modules/@babel/types/lib/definitions/misc.js
node_modules/@babel/types/lib/definitions/placeholders.js
node_modules/@babel/types/lib/definitions/typescript.js
node_modules/@babel/types/lib/definitions/utils.js
node_modules/@babel/types/lib/index.d.ts
node_modules/@babel/types/lib/index.js
node_modules/@babel/types/lib/index.js.flow
node_modules/@babel/types/lib/modifications/appendToMemberExpression.js
node_modules/@babel/types/lib/modifications/flow/removeTypeDuplicates.js
node_modules/@babel/types/lib/modifications/inherits.js
node_modules/@babel/types/lib/modifications/prependToMemberExpression.js
node_modules/@babel/types/lib/modifications/removeProperties.js
node_modules/@babel/types/lib/modifications/removePropertiesDeep.js
node_modules/@babel/types/lib/modifications/typescript/removeTypeDuplicate
node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js
node_modules/@babel/types/lib/retrievers/getOuterBindingIdentifiers.js
node_modules/@babel/types/lib/traverse/traverse.js
node_modules/@babel/types/lib/traverse/traverseFast.js
node_modules/@babel/types/lib/utils/inherit.js
node_modules/@babel/types/lib/utils/react/cleanJSXElementLiteralChild.js
node_modules/@babel/types/lib/utils/shallowEqual.js
node_modules/@babel/types/lib/validators/buildMatchMemberExpression.js
node_modules/@babel/types/lib/validators/generated/index.js
node_modules/@babel/types/lib/validators/is.js
node_modules/@babel/types/lib/validators/isBinding.js
node_modules/@babel/types/lib/validators/isBlockScoped.js
node_modules/@babel/types/lib/validators/isImmutable.js
node_modules/@babel/types/lib/validators/isLet.js
node_modules/@babel/types/lib/validators/isNode.js
node_modules/@babel/types/lib/validators/isNodesEquivalent.js
node_modules/@babel/types/lib/validators/isPlaceholderType.js
node_modules/@babel/types/lib/validators/isReferenced.js
node_modules/@babel/types/lib/validators/isScope.js
node_modules/@babel/types/lib/validators/isSpecifierDefault.js
node_modules/@babel/types/lib/validators/isType.js
node_modules/@babel/types/lib/validators/isValidES3Identifier.js
node_modules/@babel/types/lib/validators/isValidIdentifier.js
node_modules/@babel/types/lib/validators/isVar.js
node_modules/@babel/types/lib/validators/matchesPattern.js
node_modules/@babel/types/lib/validators/react/isCompatTag.js
node_modules/@babel/types/lib/validators/react/isReactComponent.js
node_modules/@babel/types/lib/validators/validate.js
node_modules/@babel/types/scripts/generateTypeHelpers.js
node_modules/@babel/types/scripts/generators/docs.js
node_modules/@babel/types/scripts/generators/flow.js
node_modules/@babel/types/scripts/generators/generateAsserts.js
node_modules/@babel/types/scripts/generators/generateBuilders.js
node_modules/@babel/types/scripts/generators/generateConstants.js
node_modules/@babel/types/scripts/generators/generateValidators.js
node_modules/@babel/types/scripts/generators/typescript.js
node_modules/@babel/types/scripts/utils/formatBuilderName.js
node_modules/@babel/types/scripts/utils/lowerFirst.js
node_modules/@babel/types/scripts/utils/stringifyValidator.js
node_modules/@babel/types/scripts/utils/toFunctionName.js
Possible Solution
moving file timestamp in tarball in npm to more safe 1980+
I know that npm locks dates for tarballed files, but usually date is in 1985 which is supported by zip.
Additional context
this causes problems in many lambdas and really annoying. there are simple workaround, but this potentially breaks caching.
I'm not sure if babel project is right place, but It will be awesome if you could fix this (moving file date to more safe 1980+) or point in which project this behavior is maintained
Reacted by Hayk Hakobyan, Sherzod and ThisIsWebGoat
Metadata
Metadata
Assignees
Labels
area: upstreamoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue
Activity
babel-bot commentedon Sep 30, 2020
Hey @maratsh! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.
If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite."
nicolo-ribaudo commentedon Sep 30, 2020
This will be fixed by releasing a new Babel version after a new yarn version is released: yarnpkg/berry#1882
arcanis commentedon Sep 30, 2020
We're planning to make the release by the end of the week, will ping here once it's published (or you can use
yarn set version from sourcesto use master, which is very close from what will be shipped).nicolo-ribaudo commentedon Sep 30, 2020
@maratsh Until we release a new version, you can use this workaround (nicolo-ribaudo/babel-preset-current-node-syntax#6 (comment)):
maratsh commentedon Oct 1, 2020
Thank you. Yes, we already do.
arcanis commentedon Oct 2, 2020
We've just released Yarn 2.3, which should address this problem!
nicolo-ribaudo commentedon Oct 2, 2020
Thanks! I'm preparing a PR to update it here.
afittz commentedon Oct 14, 2020
@nicolo-ribaudo Looks like the same issue is happening on the npm package version 7.12.0.
JLHwung commentedon Oct 14, 2020
@afittz I can not reproduce this on
@babel/[email protected]Can you attach the output of
nicolo-ribaudo commentedon Oct 14, 2020
Or even better, the output of
find -not -newermt 'jan 01, 1980'afittz commentedon Oct 14, 2020
I'm on Windows, so I think this is the equivalent.
I don't get the issue when I run
npm install @babel/[email protected] -EWhen I install latest I see the issue.
npm install @babel/runtime@latestFile stamps as requested:

nicolo-ribaudo commentedon Oct 14, 2020
Does
node_modules/@babel/runtime/package.jsonsay that it's 7.12.0?afittz commentedon Oct 14, 2020
I should also note that every file in the extracted package (node_modules/@babel/runtime), save for package.json, has the 1979 modified date. It appears to be the same list as the originally reported issue.
The comment above came in as I was typing the above. Yes, the package.json file shows 7.12.0:
{
"_from": "@babel/runtime@latest",
"_id": "@babel/[email protected]",
...,
"_resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.12.0.tgz",
...
}
nicolo-ribaudo commentedon Oct 14, 2020
I can reproduce it
afittz commentedon Oct 14, 2020
If it helps, I downloaded the package and 7-Zip also shows the same dates.
nicolo-ribaudo commentedon Oct 14, 2020
I did some investigation.
The original issue is that ZIP doesn't support dates older than January 1st, 1980, 0:00:00. For this reason, yarn sets "January 1st, 1980, 0:00:00 UTC" as the file modified date.
However, I believe that you are in the UTC-6 timezone (or similar), and thus see it as December 31st, 1979.
Zips store the local date and not the UTC one (source, search for
local time): for this reason, it's still failing for you.@arcanis In order to fix this bug, I think that yarn should add 1 days to that date, so that it works in every timezone.
arcanis commentedon Oct 14, 2020
We'll do that change, but it seems to highlight a problem in the zip packer that people use - it means that the generated zip will have different checksum depending on the timezone for the server that generates the archive 😕
nicolo-ribaudo commentedon Oct 14, 2020
@arcanis My feelings for zip went from "neutral" to "make it disappear" in the last 30 mins 🙃
JLHwung commentedon Oct 14, 2020
I have added a todo list about 7.12.1 publish: Essentially we should republish every affected packages: babel/notes#78 (comment).
nicolo-ribaudo commentedon Oct 15, 2020
This should be fixed in 7.12.1 (just released)
ThisIsWebGoat commentedon Oct 19, 2020
Tested deployment of latest version using AWS CodeBuild / CodePipeline and can confirm it's working now! Thanks!