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

Make Basic example from the README runnable in CommonJS environment #2378

Open
uglide opened this issue Jan 16, 2023 · 3 comments
Open

Make Basic example from the README runnable in CommonJS environment #2378

uglide opened this issue Jan 16, 2023 · 3 comments
Labels
Documentation Evaluating This ticket is still taken into consideration without a clear path forward.

Comments

@uglide
Copy link
Contributor

uglide commented Jan 16, 2023

The basic example in the README makes many assumptions about user environment and skills like a proper type field set in the closest package.json, or the user has copy-pasted the example to a file with .mjs extension.

In most cases, users will face the following problems:

  • (node:59910) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
  • SyntaxError: await is only valid in async functions and the top level bodies of modules
  • No clear output is made, so it's hard to determine whether the example was executed successfully or not

Environment:

  • Node.js Version: v19 or any
  • Redis Server Version: Any
  • Node Redis Version: Any
  • Platform: Any
@uglide uglide added the Bug label Jan 16, 2023
@leibale leibale added Evaluating This ticket is still taken into consideration without a clear path forward. Documentation and removed Bug labels Jan 17, 2023
@chayim
Copy link
Contributor

chayim commented Jan 17, 2023

@leibale @shacharPash Can you guys pair on this?

@RenatoExpert
Copy link

@uglide You mean to write a more complete code example or what?

@pratik9333
Copy link

pratik9333 commented Jan 26, 2023

Can I work on this? @uglide

@leibale leibale mentioned this issue Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Evaluating This ticket is still taken into consideration without a clear path forward.
Projects
None yet
Development

No branches or pull requests

6 participants