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

lighthouse dependency is not working properly in aio-cli #196

Closed
anagarwa opened this issue Apr 25, 2020 · 1 comment
Closed

lighthouse dependency is not working properly in aio-cli #196

anagarwa opened this issue Apr 25, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@anagarwa
Copy link

anagarwa commented Apr 25, 2020

Describe the bug
adding a dependency of lighthouse in aio-cli's generic action does not work properly. Action will build without error but it will give a error in response when invoked

To Reproduce
Steps to reproduce the behavior:

  1. created a generic action with command

aio app init

  1. added a line in index.js of action
    const lighthouse = require('lighthouse')
  2. run command (please note that i have not included the dependency in package neither i have run npm install lighthouse so far)

aio app run --local

  1. action was built and run successfully without error which should not be the case it should throw error of package missing, below is the print on console

Local Dev Server
ℹ checking if java is installed...
ℹ checking if docker is installed...
ℹ checking if docker is running...
ℹ starting local OpenWhisk stack..
ℹ saving .env to /Users/anagarwa/Desktop/Code/adobeio/fourth/fourth/.env.app.save and writing new .env with local OpenWhisk guest credentials..
ℹ redeploying actions..
ℹ -> http://localhost:3233/api/v1/web/guest/fourth-0.0.1/fourth
ℹ writing credentials to tmp wskdebug config '.wskdebug.props.tmp'..
ℹ injecting backend urls into frontend config
ℹ starting local frontend server ..
ℹ local frontend server running at http://localhost:9080
ℹ setting up vscode debug configuration files..
ℹ press CTRL+C to terminate dev environment
⠋ Local Dev Server
To view your local application:
-> http://localhost:9080
To view your local application in the Experience Cloud shell:
-> https://experience.adobe.com/?devMode=true#/myapps/?localDevUrl=http://localhost:9080
⠼ Local Dev Server

  1. but when I tried to run action in web browser, it shows below error
{
  "code": "Y2hU3sbPbBX3eMRuitH3u5JV1WQwM0fs",
  "error": "There was an error processing your request."
}
  1. Since dependency was not included so far, I run below command

npm install lighthouse
after this lighthouse dependency was added in package.json, and same was available in node_modules.

  1. tried to built and run the action again with

aio app run --local

  1. again no error displayed , it was successfull below is the output of console

Local Dev Server
ℹ checking if java is installed...
ℹ checking if docker is installed...
ℹ checking if docker is running...
ℹ starting local OpenWhisk stack..
ℹ saving .env to /Users/anagarwa/Desktop/Code/adobeio/fourth/fourth/.env.app.save and writing new .env with local OpenWhisk guest credentials..
ℹ redeploying actions..
ℹ -> http://localhost:3233/api/v1/web/guest/fourth-0.0.1/fourth
ℹ writing credentials to tmp wskdebug config '.wskdebug.props.tmp'..
ℹ injecting backend urls into frontend config
ℹ starting local frontend server ..
ℹ local frontend server running at http://localhost:9080
ℹ setting up vscode debug configuration files..
ℹ press CTRL+C to terminate dev environment
⠋ Local Dev Server
To view your local application:
-> http://localhost:9080
To view your local application in the Experience Cloud shell:
-> https://experience.adobe.com/?devMode=true#/myapps/?localDevUrl=http://localhost:9080
⠇ Local Dev Server

  1. Tried to invoke the action from web browser , below error message was displayed
    {
    "code": "QFLddhNhh8cOZVo9LgZ1sqkSyUjOSekU",
    "error": "There was an error processing your request."
    }

Expected behavior

  1. ) If lighthouse dependency was not included in package.json , during building the action a proper error was should be throws like in case of other packages.
    2.) after including the dependency of lighthouse, action should work properly.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: MacOS 10.13.6
  • Browser chrome 81.0.4044.122
  • node version 10.19.0

please note that, in case if I write a action with wskdeploy , I was able to successfully invoke the action with lighthouse

@meryllblanchet meryllblanchet added the bug Something isn't working label Apr 25, 2020
@meryllblanchet
Copy link
Contributor

Thanks for reporting the bug @anagarwa .
I think it related to #101 . We're working on exposing the webpack configuration for developers who would need to adapt it to their dependencies.

cc @sarahxxu @purplecabbage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants