This article is a mirror article of machine translation, please click here to jump to the original article.

View: 31|Reply: 0

[Other] Front-end project compilation Cannot set properties of undefined (setting 'parent')

[Copy link]
Posted onThe day before yesterday at 09:18 | | | |
When using npm and yarn to compile the front-end project, the error is as follows:
error  in ./src/components/NumberInfo/NumberInfo.vue?vue&type=style&index=0&id=4370c5af&lang=less&scoped=true

Syntax Error: TypeError: Cannot set properties of undefined (setting 'parent')

@ ./node_modules/vue-style-loader?? ref--10-oneOf-1-0!. /node_modules/css-loader?? ref--10-oneOf-1-1!. /node_modules/vue-loader/lib/loaders/stylePostLoader.js!. /node_modules/postcss-loader/src?? ref--10-oneOf-1-2!. /node_modules/less-loader/dist/cjs.js?? ref--10-oneOf-1-3!. /node_modules/cache-loader/dist/cjs.js??
ref--0-0!. /node_modules/vue-loader/lib?? vue-loader-options!. /src/components/NumberInfo/NumberInfo.vue?vue&type=style&index=0&id=4370c5af&lang=less&scoped=true 4:14-482 15:3-20:5 16:22-490
@ ./src/components/NumberInfo/NumberInfo.vue?vue&type=style&index=0&id=4370c5af&lang=less&scoped=true
@ ./src/components/NumberInfo/NumberInfo.vue
@ ./src/components/NumberInfo/index.js
@ ./node_modules/cache-loader/dist/cjs.js?? ref--12-0!. /node_modules/babel-loader/lib!. /node_modules/cache-loader/dist/cjs.js?? ref--0-0!. /node_modules/vue-loader/lib?? vue-loader-options!. /src/views/Home.vue?vue&type=script&lang=js
@ ./src/views/Home.vue?vue&type=script&lang=js
@ ./src/views/Home.vue
@ ./src/config/router.config.js
@ ./src/router/index.js
@ ./src/utils/request.js
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://192.168.232.246:3000/sockjs-node(webpack)/hot/dev-server.js ./src/main.js

solution



It would be normal to remove the scoped on top.

Because the CSS variable of antdv is used, it cannot be obtained by adding scoped.

Simple, brutal, effective. Risk: The style becomes global and may affect other places.




Previous:ASP.NET Core (34) Trace Context
Next:Linux uses ProxyChains4 to proxy access to the specified program network
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com