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

Css not added to head when running develop #15

Open
mRamzii opened this issue Nov 1, 2020 · 6 comments
Open

Css not added to head when running develop #15

mRamzii opened this issue Nov 1, 2020 · 6 comments

Comments

@mRamzii
Copy link

mRamzii commented Nov 1, 2020

Hello,

First of all thank you for this great template, I have never used Gridsome, and I have to admit, it's nice !

I have a problem where when i run "npm run build", and get my files inside the "dist" folder, the scripts and css are not added in the index.html and the page doesnt look as its supposed to..

I have confirmed that this is the issue since it works when I manually place the <script> and tags on the production "dist/index.html"

Is there any additionnal step I have missed to "tell gridsome to use css ? "

Thank you

@YannAries
Copy link

Hi,

What the console output returns when running npm run build ?

@mRamzii
Copy link
Author

mRamzii commented Nov 9, 2020

Hello,

Thank you for your response, here is the console output :

$ npm run build

> resume@ build C:\Users\Me\Documents\Developer profile\vue-developer-profile\vue-developer-profile
> gridsome build

Gridsome v0.7.0

Initializing plugins...
Load sources - 0.12s
Create GraphQL schema - 0.05s
Create pages and templates - 0.02s
Generate temporary code - 0.02s
Bootstrap finish - 1.88s
Compile assets - 14.77s
Execute GraphQL (2 queries) - 0s
Write out page data (2 files) - 0s
Render HTML (2 files) - 0.45s
Process files (0 files) - 0s
Process images (14 images) - 1.48s


  Done in 19.25s

The "head" tag in the dist folder doesn't contain any links to css/js..

@YannAries
Copy link

I had a similar issue with the portfolio images.
I fixed it by clearing the cache npm cache clean --force and updating npm to the latest version. npm install -g npm@latest .

Backup your project first and give it a try. Furthermore, make sure to have global css in src/main.js and that the path is well defined.

@mRamzii
Copy link
Author

mRamzii commented Nov 12, 2020

Still nothing, for reference, here is how it looks on my browser once I build the project :
image

As you can see there are no styles... the <head> tag inside of the index.html is empty..

@YannAries
Copy link

Something must be missing.
Would be good to have further details about your environnement config and how you set up Gridsome and npm for local development.

@mRamzii
Copy link
Author

mRamzii commented Nov 15, 2020

npm - 6.14.8
node - v12.18.2

I didnt touch the settings, used it like it was out of the box from the git repo

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

2 participants