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

ssr: false routes do not render with proper CSS #21760

Closed
elishalon opened this issue Jun 25, 2023 · 5 comments · Fixed by #21763
Closed

ssr: false routes do not render with proper CSS #21760

elishalon opened this issue Jun 25, 2023 · 5 comments · Fixed by #21763

Comments

@elishalon
Copy link

Environment


  • Operating System: Windows_NT
  • Node Version: v18.16.0
  • Nuxt Version: 3.6.0
  • Nitro Version: 2.5.1
  • Package Manager: yarn@1.22.19
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Code is private

Describe the bug

After upgrading from 3.53 to 3.6 all routes that are ssr: false (the default ssr is true) broke and looks like the CSS is not used. If changed to ssr: true, it works well but we need the specific routes to not render on the server.

Additional context

No response

Logs

No response

@danielroe
Copy link
Member

Would you provide a reproduction? 🙏

@elishalon
Copy link
Author

It looks like the issue is with bootstrap 5 not being loaded. using the following plugin code:

import bootstrap from 'bootstrap/dist/js/bootstrap.bundle'

export default defineNuxtPlugin(nuxtApp => {
    nuxtApp.provide('bootstrap', bootstrap)
})

will see if I can provide a reproduction

@elishalon
Copy link
Author

OK, the issue is with the "css" prop in nuxt.config.ts - for some reason it is ignored when building the project. Here is the nuxt.config.ts from a demo project:

export default defineNuxtConfig({
  devtools: { enabled: true },
  routeRules: {    
    '/test/**': { ssr: false }
  },
  css: [
    '@/assets/css/main.scss'
  ],
  ssr: true
})

From what i'm seeing, the main.scss file is not compiled into the final dist

@Achuttarsing
Copy link

Same problem for me, local font urls of my assets/global.css no longer work. I’m deploying with npx nuxi generate on netlify.

@danielroe
Copy link
Member

@Achuttarsing That's a different issue. Do you have a reproduction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants