-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
SCSS doesn't work out of the box on Windows #4940
Comments
The code in question: https://github.com/storybooks/storybook/blob/next/app/react/src/server/cra-config.js This smells like it could be some kind of cross-platform issue with Googling issues related to methods called + "windows problem" led me to the following open (or unresolvable) issues: nodejs/node#8897 Do any of them pertain to your situation? Additionally, can you tell us which version of node and windows you are using? It would also be lovely if you could share the explicit file path to your node_modules. |
Also, ping @igor-dv |
I'm using node 10.13.0 and Windows 10.0.17134.407 (but tried on 3 different windows computers and two linux + macbook). Not sure what do you mean about "explicit path to node_modules", but for example Also I tried to run such code in node (taken from storybook sources) to understand what is wrong const fs = require('fs');
const path = require('path');
let reactScriptsPath;
function getReactScriptsPath({ noCache } = {}) {
if (reactScriptsPath && !noCache) return reactScriptsPath;
const appDirectory = fs.realpathSync(process.cwd());
const reactScriptsScriptPath = fs.realpathSync(path.join(appDirectory, '/node_modules/.bin/react-scripts'));
reactScriptsPath = path.join(reactScriptsScriptPath, '../..');
const scriptsPkgJson = path.join(reactScriptsPath, 'package.json');
if (!fs.existsSync(scriptsPkgJson)) {
reactScriptsPath = 'react-scripts';
}
return reactScriptsPath;
}
console.log(getReactScriptsPath()); And it just responds with P.S. edited comment. In prev. version I picked the wrong console without scripts. |
I met a similar problem today. So I inspected the code in @storybook/react. Windows 10, Node 10.14.1, Storybook 4.0.11 In "app/react/src/server/cra_config.js" on "v4.0.12" tag, I just thought reactScriptsPath = path.join(reactScriptsScriptPath, '../..'); is wrong and it should be reactScriptsPath = path.join(reactScriptsScriptPath, '../../react-scripts'); Modifying locally-installed dist js, now storybook seemed to load CRA's config. On "next" branch (default; and you'd saw), this code is resolved like that by #4836 only for v4.1 alpha version. I don't know it depends on Windows. |
Not 100% certain because I’m on mobile but that PR seems to resolve both the SVG loader and Sass loader |
@occar421, the reason it isn't Are you working in WSL, or in PowerShell/Command Prompt? And can you share the value of I have a team working on Windows, MacOS, and Linux - and this works for all - but none of the Windows users work outside of WSL. |
@igor-dv Sorry for the late reply. Tested and it works on 4.1.0-alpha! |
Describe the bug
scss is still not working under windows out of the box. We tested it on Linux and it works OK, but with the same config(just initialized) on windows it fails with error
You may need an appropriate loader to handle this file type.
Tested in the combination of storybook 4.0.12 and CRA 2.1.1
To Reproduce
Steps to reproduce the behavior:
You may need an appropriate loader to handle this file type.
about scss files and svg importExpected behavior
Working SCCS and SVG import out of the box
Screenshots
Code snippets
If applicable, add code samples to help explain your problem.
System:
Additional context
Seems like #4405 doesn't support it properly.
The text was updated successfully, but these errors were encountered: