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

npx eik package-alias allows setting alias to non existant version #10

Closed
hennikul opened this issue Sep 10, 2021 · 1 comment · Fixed by eik-lib/core#276
Closed

npx eik package-alias allows setting alias to non existant version #10

hennikul opened this issue Sep 10, 2021 · 1 comment · Fixed by eik-lib/core#276

Comments

@hennikul
Copy link

Short description:
When running npx eik package-alias user 0.13.31 0 and no version 0.13.31 existing in Eik, the output indicates that
this is not allowed and that nothing happens, but in reality the alias v0 is updated to a non existing version resulting in 404 when used in import-maps.

Expected behaviour:
Output remains "The server was unable to locate the required resource", but alias is not updated to non existing version.

Full description:
We had an incident in our production environment yesterday resulting from a series of unfortunate events. Our first problem was that a module that should have been named @amedia/user in Eik was previously named user, and an alias had been created with version 0, and this was used in import-maps in two of our applications.

When creating a new version of this module, our npm publish step uploaded @amedia/user version 0.13.31. Our documentation
said that we should run this command:
npx eik package-alias user 0.13.31 0

The output of this command was:

   ╭───────────────────────╮
   │                       │
   │   Eik CLI (v1.8.42)   │
   │                       │
   ╰───────────────────────╯

⚠ The server was unable to locate the required resource

So this looks like a noop, and the fix was to run npx eik package-alias @amedia/user 0.13.31 0, which shows clearly that the alias for @amedia/user v0 is updated in Eik to version 0.13.31. We updated our documentation and use of wrong module name in import-maps, since this was clearly a bug in our end.

But then stuff started breaking in production. While waiting for new builds with fixed import-maps, the old alias for 'user' started failing in production. First with 503 errors, and later with 404. We did not initially understand what was going on, since our understanding was that only @amedia/user v0 had been successfuly updated. Rolling out new builds fixed the situation, and we later understood that the updated of 'user' had actually updated v0 to 0.13.31 even though the output indicated that it didn't do anything. Since no version 0.13.31 existed of 'user', this alias failed in user's browsers.

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

Successfully merging a pull request may close this issue.

2 participants