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

Module build failed: SyntaxError: Unexpected token h #33

Closed
MoOx opened this issue Jan 10, 2015 · 6 comments
Closed

Module build failed: SyntaxError: Unexpected token h #33

MoOx opened this issue Jan 10, 2015 · 6 comments

Comments

@MoOx
Copy link

MoOx commented Jan 10, 2015

The following CSS ia breaking my build

.class {
  filter: drop-shadow(0 1px 0 var(--vr-Color-white));
}

It's totally valid CSS. It seems related to the parser. Maybe you should consider using a better parser like postcss ?

@sokra
Copy link
Member

sokra commented Jan 10, 2015

Could you paste the complete error?

@MoOx
Copy link
Author

MoOx commented Jan 11, 2015

ERROR in ./~/css-loader!./~/cssnext-loader!./src/index.css
Module build failed: SyntaxError: Unexpected token h
    at Object.parse (native)
    at Object.parseString (/.../node_modules/css-loader/node_modules/loader-utils/index.js:152:14)
    at(/.../node_modules/css-loader/index.js:47:25
    at String.replace (native)
    at Object.module.exports (/.../node_modules/css-loader/index.js:45:12)
 @ ./src/index.css 4:14-293 12:19-298

@sokra
Copy link
Member

sokra commented Jan 11, 2015

Oh you are using the cssnext-loader... So the real css code is different:

This:

:root {
  --vr-Color-white: white;
}

.class {
  filter: drop-shadow(0 1px 0 var(--vr-Color-white));
}

transpiles to this:

.class {
  filter: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="filter"><feGaussianBlur in="SourceAlpha" stdDeviation="0" /><feOffset dx="1" dy="2" result="offsetblur" /><feFlood flood-color="rgba(255,255,255,1)" /><feComposite in2="offsetblur" operator="in" /><feMerge><feMergeNode /><feMergeNode in="SourceGraphic" /></feMerge></filter></svg>#filter');
  -webkit-filter: drop-shadow(0 1px 0 white);
          filter: drop-shadow(0 1px 0 white);
}

@sokra sokra closed this as completed in 5461b91 Jan 11, 2015
@MoOx
Copy link
Author

MoOx commented Jan 12, 2015

cssnext-loader is use after so not sure why it bring a problem :/
Thanks anyway if you fixed that :)

@sokra
Copy link
Member

sokra commented Jan 12, 2015

This was a bug in css-loader: It didn't like url('...') with a single '.

@jhnns
Copy link
Member

jhnns commented Jan 12, 2015

👍

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

3 participants