Skip to content

"Module not found" on Windows if directory name starts with "!" (exclamation mark) #3292

@today-

Description

@today-

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Yes, it's still reproducing with npm4

Environment

1, node -v
v8.7.0
2. npm -v
5.4.2
3. yarn --version
1.0.2
4. npm ls react-scripts
C:!w0rk\create-react-app-master
`-- (empty)

OS: Windows 7 x64

Steps to Reproduce

  1. Open cmd.exe or other windows terminal tool
  2. cd c:\
  3. git clone https://github.com/facebookincubator/create-react-app.git !test
  4. cd !test
  5. yarn
  6. yarn start

Expected Behavior

Succesfully compiling

Actual Behavior

Error in console:

Failed to compile.

multi ./packages/react-scripts/config/polyfills.js ./packages/react-dev-utils/webpackHotDevClient.js ./packages/react-scripts/template/src/index.js
Module not found: Can't resolve 'C:\' in 'C:\!test'

and in browser:

Html Webpack Plugin:
  Error: Child compilation failed:
  Entry module not found: Error: Can't resolve 'C:\' in 'C:\!test':
  Error: Can't resolve 'C:\' in 'C:\!test'

It seems to me that bug is in "enhanced-resolve" module, but I'm not sure.

I haven't tested it on macOS or Linux.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions