Error: Can't resolve '~rc-collapse/assets/index.css' in '.../node_modules/ #17667
Replies: 5 comments 5 replies
-
Is the
|
Beta Was this translation helpful? Give feedback.
-
But for the same configuration, I don't have any problem with tailwindcss v3, but with v4, I get this error, even if I use other third-party libraries in my project by importing '~external.style.css' deps. Even if I use other third-party libraries in my project that also import '~external.style.css' via deps, it will also report this error, how can I fix the import css of these other deps in node-modules? |
Beta Was this translation helpful? Give feedback.
-
Yes, this is because v4 handles |
Beta Was this translation helpful? Give feedback.
-
So I guess that's a conflict? Can't I configure v4 to skip the @import '~external.style.css' code? Because I have a lot of files in my project that use @import '~external.style.css' to bring in the style files of deps in node modules, and @import '~external.style.css' to bring in the style files of third-party deps in other deps used in node modules, so I don't know what to do. I can't change the style of third-party deps. |
Beta Was this translation helpful? Give feedback.
-
@AmelloAster Hey! Hard to say what's going on here without a reproduction that we can run locally. If you use any import aliasing feature I recommend using the full import path instead. Happy to take a look at your setup if you provide a reproduction! We use enhanced-resolve (same as webpack) for import resolution if that's of any help 😅 |
Beta Was this translation helpful? Give feedback.
-
What version of Tailwind CSS are you using?
v4.1.3
What build tool (or framework if it abstracts the build tool) are you using?
webpack: 5.94.0
What version of Node.js are you using?
v20.0.0
What browser are you using?
Chrome
What operating system are you using?
macOS
Describe your issue
Describe the problem you're seeing, any important steps to reproduce and what behavior you expect instead.
when I use the @import '~external.style.css' and '@tailwindcss/postcss' build with webpack I got this error
this is my postcss-loader options:
[
'@tailwindcss/postcss',
'postcss-flexbugs-fixes',
[
'postcss-preset-env',
{
autoprefixer: {
flexbox: 'no-2009',
},
stage: 3,
},
],
'postcss-normalize',
],
Beta Was this translation helpful? Give feedback.
All reactions