adobe / aio-lib-runtime

Adobe I/O Javascript SDK implementing a value-add layer for Adobe I/O Runtime
https://www.adobe.io
Apache License 2.0
3 stars 20 forks source link

Using npm module (inline-css) in global packages.json leads to error in webpack #30

Closed steffenrosi closed 3 years ago

steffenrosi commented 4 years ago

Expected Behaviour

Normal packaging and deployment

Actual Behaviour

Error when executing aio app run --local

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

mac osx 10.14.5 node v13.2.0 npm 6.13.1

Sample Code that illustrates the problem

Logs taken while reproducing problem

[13:47:48] sroesing:my-first-aio-app $ > Local Dev Server
ℹ checking if docker is installed...
ℹ checking if docker is running...
ℹ starting local OpenWhisk stack..
⠸ Local Dev Server
        ____      ___                   _    _ _     _     _
       /\   \    / _ \ _ __   ___ _ __ | |  | | |__ (_)___| | __
  /\  /__\   \  | | | | '_ \ / _ \ '_ \| |  | | '_ \| / __| |/ /
 /  \____ \  /  | |_| | |_) |  __/ | | | |/\| | | | | \__ \   <
 \   \  /  \/    \___/| .__/ \___|_| |_|__/\__|_| |_|_|___/_|\_\
  \___\/ tm           |_|
Git Commit: 6de96ed, Build Date: 2019-07-31T10:53:17+0530
================================================================================
Running pre flight checks ...
⠴ Local Dev Server[  OK   ] 'docker' cli found. (Docker version 19.03.2, build 6a30dfc)
[  OK   ] 'docker' version 19.3.2 is newer than minimum supported 18.3.0
⠧ Local Dev Server[  OK   ] 'docker' is running.
⠇ Local Dev Server[  OK   ] 'wsk' cli found.
⠙ Local Dev Server[ WARN  ] Configure wsk via below command to connect to this server as [guest]
wsk property set --apihost 'http://localhost:3233' --auth '23bc46b1-71f6-4ed5-8c54-816aa4f8c502:123zO3xZCLrMN6v2BKK1dXYFpXlPkccOFqm12CdAsMgRU4VrNZ9lyGVCGuMDGIwP'
[  OK   ] Server port [3233] is free
================================================================================
⠼ Local Dev Server[2019-11-27T14:09:11.214Z] [INFO] Starting OpenWhisk standalone on port 3233
⠏ Local Dev Server[2019-11-27T14:09:11.649Z] [INFO] Slf4jLogger started
⠹ Local Dev Server[2019-11-27T14:09:11.917Z] [INFO] Using [/Users/sroesing/.openwhisk/standalone/server-3233] as data directory
⠧ Local Dev Server[2019-11-27T14:09:12.331Z] [INFO] [#tid_sid_unknown] [MemoryArtifactStore] Created MemoryStore for [subjects]
⠏ Local Dev Server[2019-11-27T14:09:12.434Z] [INFO] [#tid_sid_cli] [MemoryArtifactStore] [GET] 'subjects' finding document: 'id: guest' [marker:database_getDocument_start:227]
[2019-11-27T14:09:12.439Z] [INFO] Starting the Kamon(SystemMetrics) module
⠙ Local Dev Server[2019-11-27T14:09:12.616Z] [INFO] [#tid_sid_cli] [MemoryArtifactStore]  [marker:database_getDocument_finish:410:1]
⠹ Local Dev Server[2019-11-27T14:09:12.660Z] [INFO] [#tid_sid_cli] [MemoryArtifactStore] [PUT] 'subjects' saving document: 'id: guest, rev: null' [marker:database_saveDocument_start:455]
[2019-11-27T14:09:12.665Z] [INFO] [#tid_sid_cli] [MemoryArtifactStore]  [marker:database_saveDocument_finish:460:5]
[2019-11-27T14:09:12.666Z] [INFO] [#tid_sid_userBootstrap] [StandaloneOpenWhisk] Created user [guest]
[2019-11-27T14:09:12.718Z] [INFO] [#tid_sid_cli] [MemoryArtifactStore] [GET] 'subjects' finding document: 'id: whisk.system' [marker:database_getDocument_start:34]
[2019-11-27T14:09:12.718Z] [INFO] [#tid_sid_cli] [MemoryArtifactStore]  [marker:database_getDocument_finish:34:0]
[2019-11-27T14:09:12.721Z] [INFO] [#tid_sid_cli] [MemoryArtifactStore] [PUT] 'subjects' saving document: 'id: whisk.system, rev: null' [marker:database_saveDocument_start:37]
[2019-11-27T14:09:12.721Z] [INFO] [#tid_sid_cli] [MemoryArtifactStore]  [marker:database_saveDocument_finish:37:0]
[2019-11-27T14:09:12.722Z] [INFO] [#tid_sid_userBootstrap] [StandaloneOpenWhisk] Created user [whisk.system]
⠸ Local Dev Server[2019-11-27T14:09:12.798Z] [INFO] The kamon.reporters setting is empty, no reporters have been started.
⠴ Local Dev Server[2019-11-27T14:09:12.984Z] [INFO] [#tid_sid_unknown] [Config] system set value for limits.triggers.fires.perMinute
[2019-11-27T14:09:12.984Z] [INFO] [#tid_sid_unknown] [Config] system set value for limits.actions.sequence.maxLength
[2019-11-27T14:09:12.984Z] [INFO] [#tid_sid_unknown] [Config] system set value for limits.actions.invokes.concurrent
[2019-11-27T14:09:12.985Z] [INFO] [#tid_sid_unknown] [Config] system set value for whisk.api.host.name
[2019-11-27T14:09:12.985Z] [INFO] [#tid_sid_unknown] [Config] system set value for limits.actions.invokes.perMinute
[2019-11-27T14:09:12.985Z] [INFO] [#tid_sid_unknown] [Config] system set value for whisk.api.host.proto
[2019-11-27T14:09:12.985Z] [INFO] [#tid_sid_unknown] [Config] system set value for whisk.api.host.port
[2019-11-27T14:09:12.985Z] [INFO] [#tid_sid_unknown] [Config] system set value for runtimes.manifest
[2019-11-27T14:09:12.986Z] [INFO] [#tid_sid_unknown] [Config] system set value for port
⠧ Local Dev Server[2019-11-27T14:09:13.139Z] [INFO] [#tid_sid_unknown] [LeanMessagingProvider] topic completedstandalone created
[2019-11-27T14:09:13.140Z] [INFO] [#tid_sid_unknown] [LeanMessagingProvider] topic health created
[2019-11-27T14:09:13.140Z] [INFO] [#tid_sid_unknown] [LeanMessagingProvider] topic cacheInvalidation created
[2019-11-27T14:09:13.140Z] [INFO] [#tid_sid_unknown] [LeanMessagingProvider] topic events created
⠋ Local Dev Server[2019-11-27T14:09:13.372Z] [INFO] [#tid_sid_controller] [Controller] starting controller instance standalone [marker:controller_startup_counter:1299]
⠙ Local Dev Server[2019-11-27T14:09:13.442Z] [INFO] [#tid_sid_unknown] [MemoryArtifactStore] Created MemoryStore for [whisks]
[2019-11-27T14:09:13.466Z] [INFO] [#tid_sid_dispatcher] [MessageFeed] handler capacity = 128, pipeline fill at = 128, pipeline depth = 256
⠹ Local Dev Server[2019-11-27T14:09:13.488Z] [INFO] [#tid_sid_dispatcher] [MessageFeed] handler capacity = 128, pipeline fill at = 128, pipeline depth = 256
⠼ Local Dev Server[2019-11-27T14:09:13.704Z] [INFO] [#tid_sid_unknown] [ExtendedDockerClient] Detected docker client version 19.03.2
[2019-11-27T14:09:13.705Z] [INFO] [#tid_sid_unknown] [InvokerReactive] LogStoreProvider: class org.apache.openwhisk.core.containerpool.docker.DockerCliLogStore
⠦ Local Dev Server[2019-11-27T14:09:13.818Z] [INFO] [#tid_sid_unknown] [DockerForMacClient] Detected docker client version 19.03.2
⠧ Local Dev Server[2019-11-27T14:09:13.957Z] [INFO] [#tid_sid_unknown] [StandaloneDockerContainerFactory] Standalone docker container factory config pullStandardImages: true
[2019-11-27T14:09:13.959Z] [INFO] [#tid_sid_invoker] [DockerForMacClient] running /usr/local/bin/docker ps --quiet --no-trunc --all --filter name=wsk0_ (timeout: 1 minute) [marker:invoker_docker.ps_start:1885]
⠇ Local Dev Server[2019-11-27T14:09:14.038Z] [INFO] [#tid_sid_invoker] [DockerForMacClient]  [marker:invoker_docker.ps_finish:1964:79]
⠏ Local Dev Server[2019-11-27T14:09:14.056Z] [INFO] [#tid_sid_invoker] [StandaloneDockerContainerFactory] removing 0 action containers.
⠙ Local Dev Server[2019-11-27T14:09:14.256Z] [INFO] [#tid_sid_unknown] [MemoryArtifactStore] Created MemoryStore for [activations]
⠹ Local Dev Server[2019-11-27T14:09:14.345Z] [INFO] [#tid_sid_invoker] [MemoryArtifactStore] [QUERY] 'subjects' searching 'namespaceThrottlings/blockedNamespaces [marker:database_queryView_start:2271]
[2019-11-27T14:09:14.354Z] [INFO] [#tid_sid_invoker] [MemoryArtifactStore]  [marker:database_queryView_finish:2281:9]
[2019-11-27T14:09:14.357Z] [INFO] [#tid_sid_unknown] [InvokerReactive] updated blacklist to 0 entries
⠸ Local Dev Server[2019-11-27T14:09:14.424Z] [INFO] [#tid_sid_dispatcher] [MessageFeed] handler capacity = 40, pipeline fill at = 40, pipeline depth = 80
⠴ Local Dev Server[2019-11-27T14:09:14.544Z] [INFO] [#tid_sid_controller] [Controller] loadbalancer initialized: LeanBalancer
[2019-11-27T14:09:14.544Z] [INFO] [#tid_sid_invokerWarmup] [ContainerPool] pre-warming 2 nodejs:10 256 MB
⠦ Local Dev Server[2019-11-27T14:09:14.629Z] [INFO] [#tid_sid_controller] [KindRestrictor] all kinds are allowed, the white-list is not specified
[2019-11-27T14:09:14.643Z] [INFO] [#tid_sid_invokerWarmup] [DockerForMacClient] running /usr/local/bin/docker pull openwhisk/action-nodejs-v10:nightly (timeout: 10 minutes) [marker:invoker_docker.pull_start:2569]
[2019-11-27T14:09:14.645Z] [INFO] [#tid_sid_invokerWarmup] [DockerForMacClient] running /usr/local/bin/docker pull openwhisk/action-nodejs-v10:nightly (timeout: 10 minutes) [marker:invoker_docker.pull_start:2569]
⠇ Local Dev Server[2019-11-27T14:09:14.837Z] [INFO] [#tid_sid_unknown] [ExtendedDockerClient] Detected docker client version 19.03.2
⠸ Local Dev Server[2019-11-27T14:09:15.260Z] [INFO] [#tid_sid_controller] [ActionsApi] actionSequenceLimit '50'
⠹ Local Dev ServerWaiting for OpenWhisk server at http://localhost:3233 to start since 1.109 ms
⠧ Local Dev Server[2019-11-27T14:09:16.406Z] [INFO] [#tid_sid_invokerWarmup] [DockerForMacClient]  [marker:invoker_docker.pull_finish:4333:1763]
[2019-11-27T14:09:16.407Z] [INFO] [#tid_sid_unknown] [StandaloneDockerContainerFactory] Pulled OpenWhisk provided image openwhisk/action-nodejs-v10:nightly
[2019-11-27T14:09:16.407Z] [INFO] [#tid_sid_unknown] [StandaloneDockerContainerFactory] Pulled OpenWhisk provided image openwhisk/action-nodejs-v10:nightly
⠇ Local Dev Server[2019-11-27T14:09:16.449Z] [INFO] [#tid_sid_invokerWarmup] [DockerForMacClient] running /usr/local/bin/docker run -d -p 0:8080 --cpu-shares 256 --memory 256m --memory-swap 256m --network bridge -e __OW_API_HOST=http://host.docker.internal:3233 --name wsk0_1_prewarm_nodejs10 --cap-drop NET_RAW --cap-drop NET_ADMIN --ulimit nofile=1024:1024 --pids-limit 1024 --log-driver json-file openwhisk/action-nodejs-v10:nightly (timeout: 1 minute) [marker:invoker_docker.run_start:4376]
[2019-11-27T14:09:16.450Z] [INFO] [#tid_sid_invokerWarmup] [DockerForMacClient] running /usr/local/bin/docker run -d -p 0:8080 --cpu-shares 256 --memory 256m --memory-swap 256m --network bridge -e __OW_API_HOST=http://host.docker.internal:3233 --name wsk0_2_prewarm_nodejs10 --cap-drop NET_RAW --cap-drop NET_ADMIN --ulimit nofile=1024:1024 --pids-limit 1024 --log-driver json-file openwhisk/action-nodejs-v10:nightly (timeout: 1 minute) [marker:invoker_docker.run_start:4376]
[2019-11-27T14:09:16.453Z] [INFO] [#tid_klmHdHGDE1UcUjVSzv7nspOblTilP5jW] GET /api/v1
⠏ Local Dev Server[2019-11-27T14:09:16.533Z] [INFO] [#tid_sid_invokerWarmup] [DockerForMacClient]  [marker:invoker_docker.pull_finish:4459:1889]
[2019-11-27T14:09:16.560Z] [INFO] [#tid_klmHdHGDE1UcUjVSzv7nspOblTilP5jW] [BasicHttpService] [marker:http_get.200_counter:115:115]
ℹ saving .env to .env.app.save and writing new .env with local OpenWhisk guest credentials..
ℹ redeploying actions..
⠙ Local Dev Serverresetting .env file...
killing local OpenWhisk process...
✖ Local Dev Server
[2019-11-27T14:09:16.834Z] [INFO] [#tid_sid_invoker] [DockerForMacClient] running /usr/local/bin/docker ps --quiet --no-trunc --all --filter name=wsk0_ (timeout: 1 minute) [marker:invoker_docker.ps_start:4761]
Error: action build failed, webpack compilation errors:
./actions/hello/index.js
Module not found: Error: Can't resolve 'inline-css' in '/Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/actions/hello'
resolve 'inline-css' in '/Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/actions/hello'
  Parsed request is a module
  using description file: /Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/package.json (relative path: ./actions/hello)
    resolve as module
      /Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/actions/hello/node_modules doesn't exist or is not a directory
      /Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/actions/node_modules doesn't exist or is not a directory
      /Users/sroesing/Development/aio/my-first-aio-app/node_modules doesn't exist or is not a directory
      /Users/sroesing/Development/aio/node_modules doesn't exist or is not a directory
      /Users/sroesing/Development/node_modules doesn't exist or is not a directory
      /Users/sroesing/node_modules doesn't exist or is not a directory
      /Users/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      looking for modules in /Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/node_modules
        using description file: /Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/package.json (relative path: ./node_modules)
          using description file: /Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/package.json (relative path: ./node_modules/inline-css)
            no extension
              /Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/node_modules/inline-css doesn't exist
            .js
              /Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/node_modules/inline-css.js doesn't exist
            as directory
              /Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/node_modules/inline-css doesn't exist
[/Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/actions/hello/node_modules]
[/Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/actions/node_modules]
[/Users/sroesing/Development/aio/my-first-aio-app/node_modules]
[/Users/sroesing/Development/aio/node_modules]
[/Users/sroesing/Development/node_modules]
[/Users/sroesing/node_modules]
[/Users/node_modules]
[/node_modules]
[/Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/node_modules/inline-css]
[/Users/sroesing/Development/aio/my-first-aio-app/my-first-aio-app/node_modules/inline-css.js]
 @ ./actions/hello/index.js 9:18-39
 @ multi ./actions/hello/index.js
    at /usr/local/lib/node_modules/@adobe/aio-cli/node_modules/@adobe/aio-app-scripts/scripts/build.actions.js:84:46
    at finalCallback (/usr/local/lib/node_modules/@adobe/aio-cli/node_modules/webpack/lib/Compiler.js:257:39)
    at /usr/local/lib/node_modules/@adobe/aio-cli/node_modules/webpack/lib/Compiler.js:273:13
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/usr/local/lib/node_modules/@adobe/aio-cli/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
    at AsyncSeriesHook.lazyCompileHook (/usr/local/lib/node_modules/@adobe/aio-cli/node_modules/tapable/lib/Hook.js:154:20)
    at onCompiled (/usr/local/lib/node_modules/@adobe/aio-cli/node_modules/webpack/lib/Compiler.js:271:21)
    at /usr/local/lib/node_modules/@adobe/aio-cli/node_modules/webpack/lib/Compiler.js:681:15
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/usr/local/lib/node_modules/@adobe/aio-cli/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:4:1)
    at AsyncSeriesHook.lazyCompileHook (/usr/local/lib/node_modules/@adobe/aio-cli/node_modules/tapable/lib/Hook.js:154:20)
    at /usr/local/lib/node_modules/@adobe/aio-cli/node_modules/webpack/lib/Compiler.js:678:31
[2019-11-27T14:09:16.913Z] [INFO] [#tid_sid_invoker] [DockerForMacClient]  [marker:invoker_docker.ps_finish:4840:79]
[2019-11-27T14:09:16.914Z] [INFO] [#tid_sid_invoker] [StandaloneDockerContainerFactory] removing 2 action containers.
[2019-11-27T14:09:16.916Z] [INFO] [#tid_sid_invoker] [DockerForMacClient] running /usr/local/bin/docker rm -f 1b92666678596a34b2488dacbc3fdddecb80719ae78fdf448aa674c709e3a38a (timeout: 1 minute) [marker:invoker_docker.rm_start:4843]
[2019-11-27T14:09:16.917Z] [INFO] [#tid_sid_invoker] [DockerForMacClient] running /usr/local/bin/docker rm -f 7aea8f64ea942db221292150b6e0a78856caefdd9c408a7ce9af64f4cd3e8e4a (timeout: 1 minute) [marker:invoker_docker.rm_start:4844]
[14:09:16] sroesing:my-first-aio-app $ Waiting for OpenWhisk server at http://localhost:3233 to start since 1.009 s
[2019-11-27T14:09:17.162Z] [INFO] [#tid_sid_invokerWarmup] [DockerForMacClient]  [marker:invoker_docker.run_finish:5089:713]
[2019-11-27T14:09:17.163Z] [INFO] [#tid_sid_invokerWarmup] [DockerForMacClient] running /usr/local/bin/docker inspect --format {{(index (index .NetworkSettings.Ports "8080/tcp") 0).HostPort}} 7aea8f64ea942db221292150b6e0a78856caefdd9c408a7ce9af64f4cd3e8e4a (timeout: 10 seconds) [marker:invoker_docker.inspect_start:5089]
[2019-11-27T14:09:17.243Z] [INFO] [#tid_sid_invokerWarmup] [DockerForMacClient]  [marker:invoker_docker.inspect_finish:5170:81]
[2019-11-27T14:09:17.291Z] [INFO] [#tid_sid_invokerWarmup] [DockerForMacClient]  [marker:invoker_docker.run_finish:5217:841]
[2019-11-27T14:09:17.291Z] [INFO] [#tid_sid_invokerWarmup] [DockerForMacClient] running /usr/local/bin/docker inspect --format {{(index (index .NetworkSettings.Ports "8080/tcp") 0).HostPort}} 1b92666678596a34b2488dacbc3fdddecb80719ae78fdf448aa674c709e3a38a (timeout: 10 seconds) [marker:invoker_docker.inspect_start:5218]
[2019-11-27T14:09:17.358Z] [INFO] [#tid_sid_invokerWarmup] [DockerForMacClient]  [marker:invoker_docker.inspect_finish:5285:67]
[2019-11-27T14:09:17.916Z] [INFO] [#tid_sid_invoker] [DockerForMacClient]  [marker:invoker_docker.rm_finish:5843:999]
Waiting for OpenWhisk server at http://localhost:3233 to start since 2.013 s
[2019-11-27T14:09:18.030Z] [INFO] [#tid_sid_invoker] [DockerForMacClient]  [marker:invoker_docker.rm_finish:5957:1114]
[2019-11-27T14:09:18.038Z] [INFO] [#tid_sid_unknown] [Controller] Shutting down Kamon with coordinated shutdown
moritzraho commented 4 years ago

Thanks @steffenrosi for reporting the issue.

Workaround: build zip action instead of bundle with webpack

meryllblanchet commented 4 years ago

@moritzraho what would be the long-term solution? Allow developers to provide their own webpack configuration?