-
Notifications
You must be signed in to change notification settings - Fork 9
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
Error with npx rsbuild dev
and npx rsbuild build
when using CSR
#41
Comments
Do you have a reproduction repo? Have you tried installing the missing package? |
Sorry I can't provide a reproduction repo. But after installing @swc/core it's seems working but I still have some sass @import. |
I have the same sass import issues trying CSR builds with scss like @bah99 |
@bah99 try adding pluginSass to plugins array in import { createConfig } from '@ng-rsbuild/plugin-angular';
import { pluginSass } from '@rsbuild/plugin-sass';
export default createConfig(
{
browser: './src/main.ts',
inlineStylesExtension: 'scss',
styles: ['./src/styles.scss', './src/vendors.scss'],
assets: ['./src/favicon.ico', './src/assets' ],
},
{
plugins: [pluginSass()],
}
); |
I'll try thank you @faileon |
@faileon Thanks for your solution, but I'm still facing the same issue. Here’s my configuration for reference: import { createConfig } from '@ng-rsbuild/plugin-angular';
import { pluginSass } from '@rsbuild/plugin-sass';
export default createConfig(
{
browser: './src/main.ts',
inlineStylesExtension: 'scss',
styles: [
'./src/styles.scss',
'./src/assets/sass/theme.scss',
'./src/assets/sass/style.scss',
'./node_modules/handsontable/dist/handsontable.full.min.css',
],
assets: ['./src/assets'],
},
{
plugins: [pluginSass()],
}
); Let me know if you notice anything off or if additional details would help diagnose the issue. Thank you! |
Are you using tailwind? If so, try to create
|
Is your path here correct: import { createConfig } from '@ng-rsbuild/plugin-angular';
import { pluginSass } from '@rsbuild/plugin-sass';
export default createConfig(
{
browser: './src/main.ts',
inlineStylesExtension: 'scss',
styles: [
'./src/styles.scss',
'./src/assets/sass/theme.scss',
'./src/assets/sass/style.scss',
'./node_modules/handsontable/dist/handsontable.full.min.css', // THIS ONE
],
assets: ['./src/assets'],
},
{
plugins: [pluginSass()],
}
); The path should be from project root. Do you have a node_modules folder at your project root? Or is it up a level or few levels? i.e. should it be |
@faileon No, I’m not using TailwindCSS. @Coly010 Yes, the path is correct; it matches what I have in the "styles": [
"node_modules/handsontable/dist/handsontable.full.min.css",
"src/assets/sass/theme.scss",
"src/styles.scss"
] Here are the compilation errors I’m encountering: Regarding the SASS "stylePreprocessorOptions": {
"includePaths": ["src/"],
"sass": {
"silenceDeprecations": [
"mixed-decls",
"color-functions",
"global-builtin",
"import"
]
}
} Let me know if there’s anything else I should double-check. Thanks |
@bah99 The Angular Builder in
|
Sorry, it's still not working, even after commenting out the Handsontable style. The paths look correct to me, and I’ve tried multiple configurations. Here’s the latest one: import { createConfig } from '@ng-rsbuild/plugin-angular';
import { pluginSass } from '@rsbuild/plugin-sass';
import path from 'path';
const handsontableCssPath = path.resolve(
__dirname,
'node_modules/handsontable/dist/handsontable.full.min.css',
);
const stylesPath = path.resolve(__dirname, 'src/styles.scss');
const stylePath = path.resolve(__dirname, 'src/assets/sass/style.scss');
const themePath = path.resolve(__dirname, 'src/assets/sass/theme.scss');
console.log('handsontableCssPath:', handsontableCssPath);
console.log('stylesPath:', stylesPath);
console.log('stylePath:', stylePath);
console.log('themePath:', themePath);
export default createConfig(
{
root: __dirname,
browser: './src/main.ts',
inlineStylesExtension: 'scss',
styles: [
stylesPath,
stylePath,
themePath,
handsontableCssPath,
],
assets: ['./src/assets'],
tsconfigPath: './tsconfig.json',
},
{
output: {
cleanDistPath: true,
},
plugins: [
pluginSass({
sassLoaderOptions: {
sassOptions: {
silenceDeprecations: ['import'],
includePaths: ['./src/assets/sass'],
},
},
}),
],
},
); Despite this configuration, I’m still encountering the same issue. PS: It’s worth mentioning that this is a very large project, which might contribute to the challenges in debugging. Let me know if there’s anything else I can provide to help troubleshoot this further. |
@bah99 if you could provide any form of reproduction, it would certainly be helpful for me to reproduce and debug. Otherwise, it may be a short while before I can investigate this further. |
reproduction: run:
will yield:
|
Hello,
I'm encountering an error when running the commands
npx rsbuild dev
andnpx rsbuild build
. I'm trying to use this setup with Client-Side Rendering (CSR), but it doesn't seem to work.Here is the error message:
Could you please help me troubleshoot and resolve this issue?
Thank you in advance!
The text was updated successfully, but these errors were encountered: