pixelfed
pixelfed copied to clipboard
Can't compile assets
Hi! After setting up a new installation using Homestead 13.2 everything looks good, but it results impossible to me to compile assets (I would like to make changes to Vue code of my testing installation).
The following is the walkthrough of all the issues (in case you could help me understand the real problem) I encounter after running npm install && npm run production
(same for npm run development
):
-
I get:
ERROR in ./resources/assets/js/components/presenter/VideoPresenter.vue 1:0 Module parse failed: Unexpected token (1:0) You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders > <template> | <div v-if="status.sensitive == true" class="content-label-wrapper"> | <div class="text-light content-label">
This error is repeated for many Vue files. I solve this by adding
.vue()
towebpack.mix.js
. -
npm run production
now works. I navigate tohttps://pixelfed.test/i/web
and get the same error as in #3247. Mix can't loadspa.js
andspa.css
because they are not inwebpack.mix.js
. I solve this (probably erroneously) by usingasset('js/spa.js')
andasset('css/spa.css')
inlayouts/spa.blade.php
. After that, the problem is solved but the entire screen ofhttps://pixelfed.test/i/web
is black. -
If I use the classic UI (
https://pixelfed.test/
) this is what I get:The console prints out:
After changing the first line of
resources/assets/js/components.js
fromwindow.Vue = require('vue');
towindow.Vue = require('vue').default;
and re-runningnpm run production
, I get:(No console error but still no icons). Tried Chrome and Firefox. I got this problem with v. 0.11.3 and v. 0.11.2. I can compile in v. 0.11.1.
These are all the things I tried but I wasn't able to understand the problem. I'm sorry if I'm missing something obvious. I can provide additional information if required. Thank you so much!
Hello, sorry about that! We're in the middle of a huge refactor, and hope to resolve our asset pipeline issues soon.
您好,对此感到抱歉!我们正在进行大规模的重构,并希望尽快解决我们的资产管道问题。 大概需要多久这个问题可以解决呀
大概需要多久这个问题可以解决呀
Dang! I was about to make a small PR out of nowhere but had a hard time testing my changes. Thanks for the issue.
Hey there! Love the project. Are there any news on this issue or any tips on how to proceed when trying to edit the Vue code? Thanks in advance!
Hi! Just an update concerning the icons... If you recompile assets and lose them change the fontawesome classes of the icons in the corresponding files from fal
(I don't remember very well but I think it was fal
), to fas
.
I think that fontawesome light icons are only available for Pro users.
Hey!
Thanks for the quick response!
I think my only option is to somehow rollback to a state (as you stated 0.11.1 doesn't have that problem) where I can still make changes.
I can confirm however that changing fal
to fas
brings back the icons.
Have good start into the week y'all!
I would be very thankful for a hint on how the public/spa.js
is generated. It is updated regularly for newer versions, but it seems some code for that is not yet checked in. Could it be described/posted here in the meantime as a workaround?
I've been looking for the sources of the processed javascript code as well.
I got
Module not found: Error: Can't resolve './partials/RegisterForm.vue' in '/home/www/projects/other/pixelfed/resources/assets/components/remote-auth'
Did you miss the leading dot in 'resolve.extensions'? Did you mean '[".*",".wasm",".mjs",".js",".jsx",".json",".vue"]' instead of '["*",".wasm",".mjs",".js",".jsx",".json",".vue"]'?
webpack compiled with 1 error
I got
Module not found: Error: Can't resolve './partials/RegisterForm.vue' in '/home/www/projects/other/pixelfed/resources/assets/components/remote-auth' Did you miss the leading dot in 'resolve.extensions'? Did you mean '[".*",".wasm",".mjs",".js",".jsx",".json",".vue"]' instead of '["*",".wasm",".mjs",".js",".jsx",".json",".vue"]'? webpack compiled with 1 error
Known issue. @dansup will fix it soon.
@mitexleo Hi! Is it fixed yet? Can you recommend a way to fix it on my local machine? I want to try to learn developing for pixelfed, and hopefully contribute some bug fixes, but this prevents me from moving forward.
Yup, has been fixed. See #4464 and #4465 for details.