Skip to content

Project in "web-nodejs-with-db-sample" devfile sample is not compatible with node. #15649

@rhopp

Description

@rhopp

Describe the bug

Since this commit, the sample cannot be run in workspace created from this sample devfile.

Trying to run the sample ends up with

/projects/nodejs-mongo-app/EmployeeDB/app.js:30
app.use((req, res, next) => {
                          ^
SyntaxError: Unexpected token >
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:935:3

Seems like the node version we are using in this devfile does not support () => {} notation of inline functions.

Che version

  • latest
  • nightly
  • other: please specify

Steps to reproduce

  1. Create workspace from https://github.com/redhat-developer/devfile/blob/master/samples/web-nodejs-with-db-sample/devfile.yaml
  2. Try to run the example
  3. Observe failure.

Expected behavior

Example should be albe to run.

Runtime

  • kubernetes (include output of kubectl version)
  • Openshift (include output of oc version)
  • minikube (include output of minikube version and kubectl version)
  • minishift (include output of minishift version and oc version)
  • docker-desktop + K8S (include output of docker version and kubectl version)
  • other: (please specify)

Screenshots

Installation method

  • chectl
  • che-operator
  • minishift-addon
  • I don't know

Environment

  • my computer
    • Windows
    • Linux
    • macOS
  • Cloud
    • Amazon
    • Azure
    • GCE
    • other (please specify)
  • other: Codeready Workspaces 2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/sampleskind/bugOutline of a bug - must adhere to the bug report template.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.severity/P2Has a minor but important impact to the usage or development of the system.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions