Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Merge requests
  • !3686

Fix path regex match bug

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/Norris1z/master into master Jan 04, 2018
  • Overview 7
  • Commits 4
  • Pipelines 0
  • Changes 1

Created by: Norris1z

This change prevents Regex expression errors from being thrown when the paths passed to the function has a ++ in them.

Taking a path like some/dummy/path/with++/ the function transforms it to some\/dummy\/path\/with++\/ the second + is not ignored by the regex engine and hence throws an Invalid Regular Expression Error

This pull request changes the path to some\/dummy\/path\/with\+\+\/ with all + escaped.

I noticed the bug when i tried to run npm start in a directory containing a + in it's name. npm version 5.5.1 node version 8.9.3

$ npm start

> demoreact@0.1.0 start C:\Users\Norris\Desktop\C_C++\JS\NodeJs\demoreact
> react-scripts start

Invalid regular expression: /^(?!C:\\Users\\Norris\\Desktop\\C_C++\\JS\\NodeJs\\demoreact\\src\\).+[\\/]node_modules[\\/]/: Nothing to repeat
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! demoreact@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the demoreact@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Changing the path for the project solved the problem.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/Norris1z/master