Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Errors thrown when evaluating ModuleRoute properties kill the server #213

Closed
smackfu opened this issue Jun 25, 2020 · 8 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@smackfu
Copy link
Member

smackfu commented Jun 25, 2020

🐞 Bug Report

Describe the bug

Errors thrown when evaluating ModuleRoute properties kill the server.

$ npm start
...
> @americanexpress/one-app@5.2.0 serve-module /opt/one-app
> serve-module "/opt/module-workspace/my-module"

log: one-app-dev-cdn only using locally served modules
✔ 👕 one-app-dev-cdn server listening on port 3001
✔ 👖 one-app-dev-proxy server listening on port 3002
✔ 📊 Metrics server listening on port 3005
✔ 🌎 One App server listening on port 3000
✔ Polled Holocron Module map: no updates (polling again in 8s)
ReferenceError: a is not defined
    at http://localhost:3001/static/modules/my-module/3.1.0/my-module.node.js:9992:15
    at passChildrenProps (/opt/one-app/node_modules/holocron-module-route/lib/ModuleRouteUtils.js:33:52)
    at /opt/one-app/node_modules/holocron-module-route/lib/ModuleRouteUtils.js:72:27
$

To Reproduce

  1. Create a childRoutes variable with a ModuleRoute that throws an error when evaluating the properties.
export default () => [
  <ModuleRoute path="test" property={a.b} />,
];
  1. Navigate to http://localhost:3000/test

  2. Server exits.

Expected behavior

Server stays running and prints an error handler message.

System information

  • OS: macOS
  • Browser (if applies) Chrome
  • Version of one-app: 5.2.0
  • Node version: 10.13.0
  • Are you using building one-app from source or using the release Docker image? Docker image
  • Hosting platform for one-app server: n/a
  • Hosting platform/CDN for your one-app modules: n/a
@smackfu smackfu added the bug Something isn't working label Jun 25, 2020
@oneamexbot
Copy link
Contributor

Hey @smackfu! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly.

If you need any help, you can request an invite to our Slack community that typically always has someone willing to help."

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity.

@JamesSingleton
Copy link
Contributor

With the latest changes in One App, I believe this is fixed. I tried with the following examples and the app does not crash and the page loads.

const a = {
  b: 'hello',
};

const childRoutes = () => [
  <ModuleRoute path="/" property={a.b} />,
];
const a = 'hello';

const childRoutes = () => [
  <ModuleRoute path="/" property={a} />,
];

@smackfu
Copy link
Member Author

smackfu commented Oct 2, 2020

@JamesSingleton unfortunately, just ran into this again on v5.7.0. Crashed the process.

I think my reproduce example was unclear -- you should NOT define the a variable. It should be undefined.

@JamesSingleton JamesSingleton reopened this Oct 2, 2020
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2020

This issue is stale because it has been open 30 days with no activity.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity.

@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants