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

Microservices Example Update #387

Merged
merged 2 commits into from
Feb 20, 2025
Merged

Conversation

ashleybisram
Copy link
Contributor

@ashleybisram ashleybisram commented Feb 20, 2025

Please review this @Peter2oussaint , @apinkhasov101 , @Gitfrich .

Types of changes

  • Bugfix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Refactor (change which changes the codebase without affecting its external behavior)
  • Non-breaking change (fix or feature that would cause existing functionality to work as expected)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Purpose

  • To correct the error from the server.js file in the examples/microservices/client/src folder stating that Chronos was not a constructor.
  • Corrected the following error: Failed to load Chronos module: ReferenceError: __dirname is not defined

Approach

  • We removed the importing of Chronos from the chronos_npm_package/dist/chronos.js from the const ChronosModule on line 16 in the server.js and imported Chronos prior to the try block const ChronosModule is declared in the following fashion using destructuring : import {Chronos} from '../../../../chronos_npm_package/dist/chronos.js' and assigning Chronos to the const ChronosModule.
  • We updated the app.use on line 33 of the server.js file in the examples/microservices/client/src folder which used __dirname which we replaced with the relative path by changing it to the following code that resolved the error: app.use('/assets', express.static('assets'));

Copy link
Contributor

@apinkhasov101 apinkhasov101 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ashleybisram ashleybisram merged commit c0790ef into open-source-labs:master Feb 20, 2025
0 of 2 checks passed
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 this pull request may close these issues.

4 participants