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

issue on a clean sails.js during sails lift #42

Open
webmasterslava opened this issue Dec 15, 2015 · 4 comments
Open

issue on a clean sails.js during sails lift #42

webmasterslava opened this issue Dec 15, 2015 · 4 comments

Comments

@webmasterslava
Copy link

SyntaxError: Invalid regular expression: /^\admin(.*)/?$/: Unmatched ')'

@konstantinzolotarev
Copy link
Owner

@webmasterslava what version of node.js and sails do you use ?

@zabaat
Copy link

zabaat commented Mar 20, 2016

I was having this problem on windows 10, sails 0.12.1, node 5.9.0
I tracked it down to
bindResView.js

// Bind to /admin/*
    sails.router.bind(path.join(sails.config.adminpanel.routePrefix, '*'), bindResFunctions);

in the sails.router.bind function the path gets passed as \admin* while the path before that gets passed as /admin/
I fixed by adding an

if(options.defaultVerb.path === "\\admin\\*") options.defaultVerb.path = "/admin/*"

this of course is not a fix, but should shed some light on what we were experiencing

@SrgGroot
Copy link

SrgGroot commented Jun 8, 2016

@zabaat I'm having this same issue. How exactly did you apply that last line of code to fix your issue? I have been having a lot of trouble opening this sails project for some reason @.@

To be clear this is the line that i'm confused about. How and where did you add it exactly?

if(options.defaultVerb.path === "\\admin\\*") options.defaultVerb.path = "/admin/*"

@heitara
Copy link

heitara commented May 24, 2019

@zabaat the problem is related to the way path works on windows. It uses different separator \ instead /.
The correct fix is to replace the path function with something suitable for URLs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants