Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

LUIS as node app doesn't find LUIS config settings #124

Closed
v-geberr opened this issue May 1, 2018 · 4 comments
Closed

LUIS as node app doesn't find LUIS config settings #124

v-geberr opened this issue May 1, 2018 · 4 comments
Assignees
Labels
luis-cli luis-cli issue

Comments

@v-geberr
Copy link

v-geberr commented May 1, 2018

Information:

  • Tools Libraries: LUIS (luis apis as npm installed package called from typescript compiled file
  • Libraries' Versions: 1.0.26
  • OS: Win 10
  • Node: v8.9.1
  • Library installed from NPM

Issue Description:

Created typescript file that compiles and runs:
several issues:

  1. global fetch isn't found when run from node index.js. Worked when I added fetch to \lib\api\serviceBase.js
  2. LUIS config settings are not found if using just from node (not command line). I tried a .luisrc as well as environment variables.
  3. is npm test supposed to work with the .luisrc file? I added one but the tests are failing.

Commands Example:

Reproduction Steps:

  1. started with readme for ./LUIS
  2. created .luisrc as well as environment variables
  3. LUIS config settings are empty by the time fetch is called but I stepped through and it isn't calling the code that looks for env variables

As a side: I was going to submit a PR as a sample to get the npm project running.

Expected Behavior:

Actual Results:

@vishwacsena
Copy link
Contributor

@tom can you take a look?

@vishwacsena vishwacsena added the luis-cli luis-cli issue label May 6, 2018
@v-geberr
Copy link
Author

@vishwacsena @tomlm Would you prefer I submit a PR with the fixes? Or are the issues not showing up when you test?

@vishwacsena
Copy link
Contributor

@v-geberr - please go ahead and submit a PR. I haven't looked into it. Please add @tomlm as reviewer to the PR. Thanks!

@justinwilaby
Copy link
Contributor

The solution for this is found in the /bin/luis file. Since the cli is a node app that consumes the apis as a library, duplicating the global definition of the fetch method is preferred. e.g.
somewhere in your node program include this line:
global.fetch = require('node-fetch');

@vishwacsena vishwacsena added this to the release milestone Jun 20, 2018
@v-geberr v-geberr closed this as completed Jul 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
luis-cli luis-cli issue
Projects
None yet
Development

No branches or pull requests

4 participants