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

express dynamic routes #466

Closed
amitgilad3 opened this issue Feb 26, 2019 · 2 comments · Fixed by #468
Closed

express dynamic routes #466

amitgilad3 opened this issue Feb 26, 2019 · 2 comments · Fixed by #468
Labels
bug Something isn't working community integrations

Comments

@amitgilad3
Copy link

amitgilad3 commented Feb 26, 2019

I have a microservice that can handle dynamic routes.
i added dd-trace and now my application crashes every time somebody makes a request.
express": "^4.16.2"
express-promise-router: "^3.0.1",

example:
method: 'get'
route: '/:path(*)'

Error:
SyntaxError: Invalid regular expression: /^/(*)(?:/)?$/: Nothing to repeat
at new RegExp ()
at tokensToRegExp (/Users/Amit/cocycles/bit/warehouse/node_modules/dd-trace/node_modules/path-to-regexp/index.js:346:10)
at stringToRegexp (/Users/Amit/cocycles/bit/warehouse/node_modules/dd-trace/node_modules/path-to-regexp/index.js:288:10)
at pathToRegexp (/Users/Amit/cocycles/bit/warehouse/node_modules/dd-trace/node_modules/path-to-regexp/index.js:370:10)
at Object.test (/Users/Amit/cocycles/bit/warehouse/node_modules/dd-trace/src/plugins/router.js:131:19)
at Function.processParamsWithTrace [as process_params] (/Users/Amit/cocycles/bit/warehouse/node_modules/dd-trace/src/plugins/router.js:27:27)
at next (/Users/Amit/cocycles/bit/warehouse/node_modules/express/lib/router/index.js:275:10)
at Function.handle (/Users/Amit/cocycles/bit/warehouse/node_modules/express/lib/router/index.js:174:3)
at Function.handleWithTracer [as handle] (/Users/Amit/cocycles/bit/warehouse/node_modules/dd-trace/src/plugins/router.js:12:21)
at Layer.router (/Users/Amit/cocycles/bit/warehouse/node_modules/express/lib/router/index.js:47:12)
at web.wrapMiddleware (/Users/Amit/cocycles/bit/warehouse/node_modules/dd-trace/src/plugins/router.js:115:21)
at Scope._activate (/Users/Amit/cocycles/bit/warehouse/node_modules/dd-trace/src/scope/new/scope.js:38:14)
at Scope.activate (/Users/Amit/cocycles/bit/warehouse/node_modules/dd-trace/src/scope/new/base.js:13:17)
at Object.wrapMiddleware (/Users/Amit/cocycles/bit/warehouse/node_modules/dd-trace/src/plugins/util/web.js:90:27)
at callHandle (/Users/Amit/cocycles/bit/warehouse/node_modules/dd-trace/src/plugins/router.js:113:14)
at /Users/Amit/cocycles/bit/warehouse/node_modules/dd-trace/src/plugins/router.js:62:14

this only happens when i require dd-trace, when i run the application without data dog everything works
i think the issue is cause because im using express-promise-router and if so is there any solution ?

@rochdev rochdev added bug Something isn't working community integrations labels Feb 26, 2019
@rochdev
Copy link
Member

rochdev commented Feb 26, 2019

I'll have to look into it as it's not clear which component would cause this. express uses path-to-regexp internally which is the same library that we use in the integration, and is the one throwing.

@rochdev
Copy link
Member

rochdev commented Feb 26, 2019

I can replicate with only express and the same path, so definitely an issue with the integration's handling of paths.

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

Successfully merging a pull request may close this issue.

2 participants