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

[cli] stripUnit(...).replace is not a function #1385

Open
0xR opened this issue Aug 23, 2020 · 4 comments
Open

[cli] stripUnit(...).replace is not a function #1385

0xR opened this issue Aug 23, 2020 · 4 comments
Labels
bug It went crazy and killed everyone. help wanted

Comments

@0xR
Copy link
Contributor

0xR commented Aug 23, 2020

I'm running npx jss-cli convert myfile.css -e es6 and I get this error:

stripUnit(...).replace is not a function

Is anyone else having this issue?

I'm doing some further investigation now.

@0xR
Copy link
Contributor Author

0xR commented Aug 23, 2020

It can be solved by having different css input. This is the minimal reproduceable example:

.myclass {
  margin: 10px;
}

@0xR
Copy link
Contributor Author

0xR commented Aug 23, 2020

It occurs for both Node 12 and 14

@0xR
Copy link
Contributor Author

0xR commented Aug 23, 2020

Installing globally without using npx gives more debug info:

/home/user/.fnm/node-versions/v12.18.2/installation/lib/node_modules/jss-cli/lib/cssToJss.js:56
      style[property] = stripUnit(decl.value).replace(/\\/g, '\\\\')
                                              ^

TypeError: stripUnit(...).replace is not a function
    at /home/user/.fnm/node-versions/v12.18.2/installation/lib/node_modules/jss-cli/lib/cssToJss.js:56:47
    at Array.forEach (<anonymous>)
    at addRule (/home/user/.fnm/node-versions/v12.18.2/installation/lib/node_modules/jss-cli/lib/cssToJss.js:49:23)
    at /home/user/.fnm/node-versions/v12.18.2/installation/lib/node_modules/jss-cli/lib/cssToJss.js:73:9
    at Array.forEach (<anonymous>)
    at toJssRules (/home/user/.fnm/node-versions/v12.18.2/installation/lib/node_modules/jss-cli/lib/cssToJss.js:69:12)
    at module.exports (/home/user/.fnm/node-versions/v12.18.2/installation/lib/node_modules/jss-cli/lib/cssToJss.js:15:14)
    at convert (/home/user/.fnm/node-versions/v12.18.2/installation/lib/node_modules/jss-cli/bin/jss.js:40:19)
    at Command.onConvert (/home/user/.fnm/node-versions/v12.18.2/installation/lib/node_modules/jss-cli/bin/jss.js:82:26)
    at Command.listener (/home/user/.fnm/node-versions/v12.18.2/installation/lib/node_modules/jss-cli/node_modules/commander/index.js:315:8)

@nkpz
Copy link

nkpz commented Aug 27, 2020

I also had this issue and worked around it by installing the prior version - sudo npm i -g jss-cli@5.0.2

@kof kof added bug It went crazy and killed everyone. help wanted labels Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It went crazy and killed everyone. help wanted
Projects
None yet
Development

No branches or pull requests

3 participants