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

Getting Started should probably include a ESM example for the 'Your First Plugin' section #5292

Closed
2 tasks done
mc6415 opened this issue Jan 25, 2024 · 2 comments · Fixed by #5294
Closed
2 tasks done
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@mc6415
Copy link

mc6415 commented Jan 25, 2024

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the issue has not already been raised

Issue

Currently in the documentation under Getting Started and Your First Plugin here

There is no ESM example for the plugin, this should probably be added as there's no real mention until that point of the fastify-plugin library until the next section so if you just followed the code verbatim you get an error around the module not having an export named default

@climba03003 climba03003 added documentation Improvements or additions to documentation good first issue Good for newcomers labels Jan 26, 2024
@metcoder95
Copy link
Member

Thanks for the report, would you like to submit a PR for it?

atilagulers added a commit to atilagulers/fastify that referenced this issue Jan 26, 2024
Following issue fastify#5292, this commit introduces an ESM example in the 'Your First Plugin' section of the documentation, enhancing clarity for new contributors. 
Additionally, it updates the `package.json` to include `"type": "module"`, ensuring compatibility with ESM syntax and preventing module resolution errors for users following the documentation.


Signed-off-by: Atila Guler <128936466+atilagulers@users.noreply.github.com>
@atilagulers
Copy link
Contributor

@metcoder95 i've submitted the PR for issue #5292 as suggested.

It includes the ESM example in the 'Your First Plugin' section along with a snipped for "type: "module" configuration in the documentation to clarify setup for ESM. Looking forward to the review and feedback.

@Fdawgs Fdawgs linked a pull request Jan 27, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants