Dynamic page not loading all styles modules
Unanswered
Skipjack tuna posted this in #help-forum
Skipjack tunaOP
This is something weird is happening when trying to load a dynamic route page.
If I navigate from another page using
But if I reload the page using
Am I doing something wrong or missing something for everything to work correctly?
Versions I'm using:
- Next.js: 14.2.1
- Sass: 1.75.0
If I navigate from another page using
next/link, the page do not load sass module, as you can see in the first picture.But if I reload the page using
Ctrl + R or F5, the sass modules DO load, as in the second picture. Am I doing something wrong or missing something for everything to work correctly?
Versions I'm using:
- Next.js: 14.2.1
- Sass: 1.75.0
14 Replies
Don't you have any common styles or anything on the page you're coming from?
There's probably something covering your sass on the page you're trying to navigate from
There's probably something covering your sass on the page you're trying to navigate from
@Николя Don't you have any common styles or anything on the page you're coming from?
There's probably something covering your sass on the page you're trying to navigate from
Skipjack tunaOP
Common styles? What do you mean?
Doing some new tests, I've noticed that if I import my styles module before a specific component, the page styles DO load, but the component styles don't
Doing some new tests, I've noticed that if I import my styles module before a specific component, the page styles DO load, but the component styles don't
How do you import the style module? Style modules should be located in their components or pages, depending on what the module is intended for
@Николя How do you import the style module? Style modules should be located in their components or pages, depending on what the module is intended for
Skipjack tunaOP
I'm importing it like it should (I guess):
import styles from "./styles.module.scss"; then, using it as an object in className propsshow how you import styles into className on this page
@Николя show how you import styles into className on this page
Skipjack tunaOP
Here is the page.tsx code:
Is this your page where styles disappear?
Do styles disappear when you navigate from any page?
Do styles disappear when you navigate from any page?
@Николя Is this your page where styles disappear?
Do styles disappear when you navigate from any page?
Skipjack tunaOP
Yes, it is
Actually I can only access to this page only from one page
This website is something about "local restaurants", so first I load all restaurants and then, when I click one, that restaurant card redirects to this page where styles are not being loaded/imported/called.
But if I just put URL directly in browser, everything works correctly
Actually I can only access to this page only from one page
This website is something about "local restaurants", so first I load all restaurants and then, when I click one, that restaurant card redirects to this page where styles are not being loaded/imported/called.
But if I just put URL directly in browser, everything works correctly
Skipjack tunaOP
@Николя I just create another page where I can navigate to restaurant details (where styles dissapear) and from it also styles are not being loaded.
@Николя Do you use only modules everywhere?
Skipjack tunaOP
Yes
@Skipjack tuna <@945059810351665154> I just create another page where I can navigate to restaurant details (where styles dissapear) and from it also styles are not being loaded.
Sorry bro, can't think of what could be causing this problem.
Please tell me how you solve this problem, I'm very interested
Please tell me how you solve this problem, I'm very interested
@Николя Sorry bro, can't think of what could be causing this problem.
Please tell me how you solve this problem, I'm very interested
Skipjack tunaOP
I promise I'll do it if I'm able to find the solution or someone who know the solution
If you know someone in this server that can help me, please tag him/her here
If you know someone in this server that can help me, please tag him/her here
@Skipjack tuna I promise I'll do it if I'm able to find the solution or someone who know the solution
If you know someone in this server that can help me, please tag him/her here
Unfortunately I don't know anyone on this server bro