-
Notifications
You must be signed in to change notification settings - Fork 81
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
webpack error occurs on css files #28
Comments
Do you have svg file loader config in loaders?
|
Sorry for late reply... webpack config file:
and my dependencies in package.json:
and my .babelrc file:
|
@farminf Ah thanks for reply.next problems,I use it as component in container, when i setState int container, react-pannellum will get render.The next are code. |
@MrSandManSy I didn't understand well the issue. Is that when you change the state in the component the image gets re-render? can you screenshot the whole component code? |
@farminf It seems like re-render. When i click 'Hotspot',the component show 'Loading'. When i click button 'Company abstract',the component show 'Loading'. Below is code:
analyse:I guess when use 'this.setState({ ... })', pannellum will get re-render,even if the state is not belong to pannellum.This situation is not good in full view navigation.Is there any way to remove 're-render'? |
@MrSandManSy Thanks for explanation. I got the point and yes that is the issue. I need to refactor some code on the component update since - not only the states that are not related to pannellum component - ,but also by updating some of the pannellum props it shouldn't re-render the whole component. |
@farminf Ok,Thanks for reply in time.Your are welcome. |
I'm closing this and opened #35 for the issue |
I have configured my webpack config. And after adding pannellium-react I get the error:
ERROR in ./node_modules/pannellum-react/es/pannellum/css/pannellum.css (./node_modules/css-loader??ref--5-1!./node_modules/pannellum-react/es/pannellum/css/pannellum.css) Module not found: Error: Can't resolve 'img/sprites.svg' in '/node_modules/pannellum-react/es/pannellum/css' @ ./node_modules/pannellum-react/es/pannellum/css/pannellum.css (./node_modules/css-loader??ref--5-1!./node_modules/pannellum-react/es/pannellum/css/pannellum.css) 7:1130-1156 @ ./node_modules/pannellum-react/es/pannellum/css/pannellum.css @ ./node_modules/pannellum-react/es/elements/Pannellum.js @ ./node_modules/pannellum-react/es/index.js
Is something wrong with my config file here is a part of code:
rules: [ { test: /\.(js)$/, exclude: /node_modules/, use: ['babel-loader'] }, { test: /\.css$/, use: [ { loader: 'style-loader' }, { loader: 'css-loader', options: { modules: true, camelCase: true, sourceMap: true } } ] }, { test: /\.scss$/, use: [ "style-loader", // creates style nodes from JS strings "css-loader", // translates CSS into CommonJS "sass-loader" // compiles Sass to CSS, using Node Sass by default ] },
The text was updated successfully, but these errors were encountered: