You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently made a migration to CSS modules on my site, everything was working locally with gatsby develop but after running gatsby build and gatsby serve and checking the site to deploy to production it turns out styles are breaking.
After trying multiple things and reading issues I came across this PR from @KyleAMathews that could potentially help to solve the css modules issues by removing code splitting which would work in my case because my site is small and simple.
I tried to update my packages to see if it would help but local environment won't work after upgrading, basically gatsby develop throws errors saying that I should npm install modules that are local to the blog and are implemented by me (not npm packages). I read an issue about using @next version on packages to potentially solve updating issues, but did not work.
Steps to reproduce
CSS modules issue:
Upgrade to css modules approach
gatsby build && gatsby serve
Site behaves totally different from gatsby develop
Upgrading issue
Upgrade gatsby and gatsby plugins to use @next version (fails as well if you use the latest versions directly)
try to run gatsby develop
the following errors happen:
Expected result
Styles should be consistent between gatsby develop and gatsby build && gatsby serve
Upgrading packages to new versions should not break gatsby for development
Actual result
CSS is broken on the site (homepage)
Not possible to start gatsby after upgrading
Environment
Environment where packages are outdated but css is broken due to modules:
Is there anything else I can do to help? how can I be useful or give you a hand?
The text was updated successfully, but these errors were encountered:
enmanuelduran
changed the title
Gatsby always breaking after updating packages and CSS building incorrectly
Gatsby always breaking after updating packages and CSS modules are built incorrectly
Jun 30, 2019
enmanuelduran
changed the title
Gatsby always breaking after updating packages and CSS modules are built incorrectly
CSS modules break production build and upgrading gatsby packages wont work
Jun 30, 2019
After spending some more time digging a little deeper into the errors I have managed to make my local environment work with the latest packages versions by removing aliases (absolute paths) from my modules imports. After making multiple tests Kyle's code splitting solution seems to have fixed my CSS problems.
I am not a fan of having to stop using aliases, but since that is not critical I will take this issue as solved.
Description
I recently made a migration to CSS modules on my site, everything was working locally with
gatsby develop
but after runninggatsby build
andgatsby serve
and checking the site to deploy to production it turns out styles are breaking.After trying multiple things and reading issues I came across this PR from @KyleAMathews that could potentially help to solve the css modules issues by removing code splitting which would work in my case because my site is small and simple.
I tried to update my packages to see if it would help but local environment won't work after upgrading, basically
gatsby develop
throws errors saying that I should npm install modules that are local to the blog and are implemented by me (not npm packages). I read an issue about using@next
version on packages to potentially solve updating issues, but did not work.Steps to reproduce
CSS modules issue:
Upgrade to css modules approach
gatsby build && gatsby serve
Site behaves totally different from
gatsby develop
Upgrading issue
Upgrade gatsby and gatsby plugins to use
@next
version (fails as well if you use the latest versions directly)try to run
gatsby develop
the following errors happen:
Expected result
gatsby develop
andgatsby build && gatsby serve
Actual result
Environment
Things I have tried:
node_modules
,.cache
,yarn.lock
,package-lock.json
@next
on packagesNote: my site is open source, this the PR that introduces the modular css migration and the code of the site is online on https://github.com/enmanuelduran/enmascript
Is there anything else I can do to help? how can I be useful or give you a hand?
The text was updated successfully, but these errors were encountered: