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

🐛 fixed js require in NlpjsNlu #1541

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

sadlowskij
Copy link
Contributor

@sadlowskij sadlowskij commented Apr 21, 2023

Proposed Changes

When I change my lang model to a javascript file (in order to benefit from type definitions and comment function) the JovoDebugger (more concretely NlpjsNlu) throws an Error Cannot find module 'models/en.js'.

When using .json this works well, as this is imported with fs.readFile(filePath) which uses the current working directory for relative paths:

Relative paths will be resolved relative to the current working directory as determined by calling process.cwd().

see docs

require does not do that out of the box, which is why I added this in that case.

Types of Changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed

@aswetlow
Copy link
Member

Thank you!

@aswetlow aswetlow requested a review from jankoenig April 24, 2023 13:23
@aswetlow aswetlow merged commit 89f2090 into jovotech:v4/dev Apr 24, 2023
6 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.

None yet

3 participants