Skip to content

Since 3.0.0 version get "Error: Cannot find module" when using file paths with '~' #47

Open

Description

@g1un

Hie!
This is my project https://github.com/g1un/path-resolve-issue
I added "src/fonts" to my resolve.modules in webpack.config.js (https://github.com/g1un/path-resolve-issue/blob/test/webpack.config.js#L33) and tried to use fonts with path with '~' (https://github.com/g1un/path-resolve-issue/blob/test/src/scss/components/_fonts.scss#L4).
It works with [email protected], but do not with [email protected], giving:

ERROR in ./src/scss/style.scss
Module build failed (from ./node_modules/extract-loader/lib/extractLoader.js):
/Users/ilyasmal/work/bogdanovka/node_modules/resolve/lib/sync.js:45
    throw err;
    ^

Error: Cannot find module 'roboto-light.woff2' from '/Users/ilyasmal/work/bogdanovka/src/scss'
    at Function.module.exports [as sync] (/Users/ilyasmal/work/bogdanovka/node_modules/resolve/lib/sync.js:43:15)
    at /Users/ilyasmal/work/bogdanovka/node_modules/extract-loader/lib/extractLoader.js:100:60
    at require (/Users/ilyasmal/work/bogdanovka/node_modules/extract-loader/lib/extractLoader.js:93:86)
    at /Users/ilyasmal/work/bogdanovka/src/scss/style.scss:7:8341
    at ContextifyScript.Script.runInContext (vm.js:59:29)
    at ContextifyScript.Script.runInNewContext (vm.js:65:15)
    at /Users/ilyasmal/work/bogdanovka/node_modules/extract-loader/lib/extractLoader.js:132:20
    at Generator.next (<anonymous>)
    at step (/Users/ilyasmal/work/bogdanovka/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /Users/ilyasmal/work/bogdanovka/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
    at new Promise (<anonymous>)
    at new F (/Users/ilyasmal/work/bogdanovka/node_modules/core-js/library/modules/_export.js:36:28)
    at /Users/ilyasmal/work/bogdanovka/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12
    at evalModule (/Users/ilyasmal/work/bogdanovka/node_modules/extract-loader/lib/extractLoader.js:150:63)
    at evalDependencyGraph (/Users/ilyasmal/work/bogdanovka/node_modules/extract-loader/lib/extractLoader.js:152:12)
    at Object.<anonymous> (/Users/ilyasmal/work/bogdanovka/node_modules/extract-loader/lib/extractLoader.js:32:31)
 @ ./src/js/app.js 3:0-30
 @ ./src/js/dev.app.js
 @ multi (webpack)-dev-server/client?http://0.0.0.0:8080 ./src/js/dev.app.js

Activity

  1. philostler commented on Oct 3, 2018

    @philostler

    Also hitting this ATM.

  2. gombosg commented on Oct 6, 2018

    @gombosg

    I'm not sure if this error is similar to #48. It seems to be. I submitted a repro example over there.

  3. bdwain commented on Dec 14, 2018

    @bdwain

    I am seeing this issue too, and it's with an HTML file so the mins-css-extract-plugin doesn't work :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions