-
Notifications
You must be signed in to change notification settings - Fork 47
Using path-is-absolute for windows compatibility #117
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
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Does not work on Windows with the following setup:
└───css-modulesify-test
├───border.css
├───gulpfile.js
├───index.js
├───package.json
└───style.css
package.json
{ "name": "css-modulesify-test", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "devDependencies": { "browserify": "^13.3.0", "css-modulesify": "css-modules/css-modulesify#fix-windows-abs-path", "gulp": "^3.9.1" } }
gulpfile.js
const browserify = require('browserify'); const cssModules = require('css-modulesify'); const gulp = require('gulp'); gulp.task('default', () => { browserify({ entries: './index.js', debug: true, }) .plugin(cssModules, { output: './modules.css', }) .bundle() .pipe(gulp.dest('./bundle.js')); });
index.js
const styles = require('./style.css'); console.log(styles.normal);
style.css
.normal { composes: greyBottom from './border.css'; }
border.css
.greyBottom { border-bottom: 1px solid #C8C8C8; }
Error message:
C:\dev\js\css-modulesify-test>gulp
[09:13:44] Using gulpfile C:\dev\js\css-modulesify-test\gulpfile.js
[09:13:44] Starting 'default'...
[09:13:44] Finished 'default' after 14 ms
NO NODE C:\dev\js\css-modulesify-test\C:\C:\style.css C:\dev\js\css-modulesify-test\C:\C:\border.css
Error: Node does not exist: C:\dev\js\css-modulesify-test\C:\C:\style.css
at Object.DepGraph.addDependency (C:\dev\js\css-modulesify-test\node_modules\dependency-graph\lib\dep_graph.js:87:13)
at C:\dev\js\css-modulesify-test\node_modules\css-modulesify\file-system-loader.js:102:22
at FileSystemLoader.fetch (C:\dev\js\css-modulesify-test\node_modules\css-modulesify\file-system-loader.js:65:14)
at Parser.fetchImport (C:\dev\js\css-modulesify-test\node_modules\css-modules-loader-core\lib\parser.js:90:19)
at C:\dev\js\css-modulesify-test\node_modules\css-modules-loader-core\lib\parser.js:49:31
at Root.each (C:\dev\js\css-modulesify-test\node_modules\postcss\lib\container.js:110:22)
at Parser.fetchAllImports (C:\dev\js\css-modulesify-test\node_modules\css-modules-loader-core\lib\parser.js:47:11)
at Parser.plugin (C:\dev\js\css-modulesify-test\node_modules\css-modules-loader-core\lib\parser.js:35:31)
at LazyResult.run (C:\dev\js\css-modulesify-test\node_modules\postcss\lib\lazy-result.js:270:20)
at LazyResult.asyncTick (C:\dev\js\css-modulesify-test\node_modules\postcss\lib\lazy-result.js:185:32)
path.js:7
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.resolve (path.js:184:7)
at DestroyableTransform.saveFile [as _transform] (C:\dev\js\css-modulesify-test\node_modules\vinyl-fs\lib\dest\index.js:36:26)
at DestroyableTransform.Transform._read (C:\dev\js\css-modulesify-test\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_transform.js:184:10)
at DestroyableTransform.Transform._write (C:\dev\js\css-modulesify-test\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_transform.js:172:12)
at doWrite (C:\dev\js\css-modulesify-test\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_writable.js:237:10)
at writeOrBuffer (C:\dev\js\css-modulesify-test\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_writable.js:227:5)
at DestroyableTransform.Writable.write (C:\dev\js\css-modulesify-test\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_writable.js:194:11)
at Readable.ondata (C:\dev\js\css-modulesify-test\node_modules\readable-stream\lib\_stream_readable.js:612:20)
at emitOne (events.js:96:13)
Note that the paths in the error message still contain "C:\C:\
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #74 (hopefully)