-
Notifications
You must be signed in to change notification settings - Fork 96
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
Client UI cannot be built on Windows #495
Comments
This should be relatively easy to fix by using cross-env as a |
Thanks @altwohill it's good to know the environment variable business in the script alias is an easy fix :) Or are you also reporting that you do not hit fatal errors mid-build (in font files) on windows at the current |
I had a go at fixing this and I think I found the problem. Our webpack rule for handling font file looks like this: {
test: /fonts\/([\w_-]+)\.(woff|eot|ttf|svg)$/,
loader: 'file-loader',
options: { name: 'fonts/[name].[ext]' }
} If you tweak the test regex to expect a Windows directory separator ( |
Neat, I'll give it a go. |
@NightJar To debug this, I hacked away into the const myTweakedconfig = (process.env.WEBPACK_CHILD)
? config.find((entry) => entry.name === process.env.WEBPACK_CHILD)
: module.exports = config;
myTweakedconfig[2].module.rules[3].test = /fonts[\///]([\w_-]+)\.(woff|eot|ttf|svg)$/;
console.dir(myTweakedconfig[2].module.rules[3])
module.exports = myTweakedconfig Obviously this is some pretty dodgy stuff. I'll have a look at a better way of fixing this. |
Thanks @maxime-rainville. So what you're saying here is that this should actually be patched in the webpack config directly? |
@NightJar Yes that looks like the best place to put it. Feel free to do a PR for it if you want. Otherwise, I'll do it when I've got a spare 5 min somewhere. |
Hi team, thanks for the work on this! I've tested and silverstripe-admin/package.json Line 89 in 1e4bd77
|
Looks like the change was released in 0.8.1 - that constraint will allow you to install that - are you having problems with it? |
Yes it was released in |
Have opened a more relevant issue at silverstripe/webpack-config#21 |
What would you like the package.json updated to? I don't see anything wrong with it, but I'm happy to reopen the issue for you until it's resolved |
@altwohill 's suggestion would also be nice - but perhaps that warrants wider discussion about whether or not it belongs here or further up in webpack config also - would it work like that? Yeah, trusty ol' |
I'm not sure there's anything actionable, here. The latest webpack-config release fixes the issue. The version constraints in the Does that make sense, @NightJar or have I misrepresented your concern? |
How did you test this @unclecheese ? |
hahahaha, I can't believe I didn't pick up the slashes added in the fix PR were the wrong way around xD 😓 |
@NightJar Awesome! Are you OK if I close this one? |
Is it OK if I test first? :> |
@NightJar Sure go for it. |
While this doesn't matter for many folks, I feel it instantly precludes any community member from contributing, which is a reasonably troubling concern.
The majority of the UI builds just fine, but the webpack pipeline does not complete and ends up rendering errors to the output. This happens at the font stage.
I am using Windows 10, and the shell seems inconsequential (first attempted with git-bash, then with the 'windows default' of
cmd
).In CMD there is no concept of inlining environment variables:
This is not an issue in git-bash, if one does not attempt to run
yarn dev
(and friends) as it jumps to this cmd environment internally it seems. Runningnode_modules/.bin/webpack --progress
does successfully run (but not complete). This work around is OK, and not what this issue is about. I am simply being thorough in my report as so people don't confuse the issue (or maybe it's pertinent to debugging).Since webpack config contains
(ENV !== 'production') ? 'source-map' : '',
we'll just omit the env var, and make the call adjustment as above:node_modules\.bin\webpack --progress
(in CMD, note backslash not forward slash).Which results in:
(edited for brevity - but there are also a number of these).
This same error is what pops up in the bash shell, so appears more environmental than command syntax issues.
If one pushes through this results in:
Which is clearly invalid CSS, and leaves the CMS looking like assets weren't exposed by composer.
This also affects the pattern library (storybook): #465
Although I could get that running, the interface in the browser was non-functional and also littered with the same error as above (unknown char in font, etc.)
Related PR
The text was updated successfully, but these errors were encountered: