Conditional Dynamic CSS Import Issue in Next.js #69300
Labels
bug
Issue was opened via the bug report template.
create-next-app
Related to our CLI tool for quickly starting a new Next.js application.
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/sparkling-water-g3ns6c?file=%2Fapp%2Flayout.tsx%3A2%2C19
To Reproduce
When I load CSS using import "./app.css", it works fine. However, if I try to load it dynamically using const css = "./app.css" and then import(css), it doesn't work.
Current vs. Expected behavior
CSS is not loading when I try like this css = "./app.css" and then import(css).
but when I try like this
import "./app.css"
style work properly.Provide environment information
Operating System: Platform: win32 Arch: x64 Version: Windows 10 Home Available memory (MB): 12200 Available CPU cores: 4 Binaries: Node: 18.20.4 npm: N/A Yarn: N/A pnpm: 8.15.4 Relevant Packages: next: 14.2.5 // There is a newer version (14.2.6) available, upgrade recommended! eslint-config-next: 14.2.5 react: 18.3.1 react-dom: 18.3.1 typescript: 5.5.4 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
create-next-app
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I tested on 15.0.0-canary.130
The text was updated successfully, but these errors were encountered: