前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >styled-jsx: plugins is not a function

styled-jsx: plugins is not a function

作者头像
用户6256742
发布2022-07-06 14:21:39
2870
发布2022-07-06 14:21:39
举报
文章被收录于专栏:网络日志

在使用使用Next.js做开发时很多开发者会选择styled-jsx作为CSS方案,同时会使用styled-jsx-plugin-sass插件使styled-jsx支持Sass预处理,但是某一次使用时发现出现了如下错误:

代码语言:javascript
复制
event - build page: /
wait  - compiling...
info  - Using external babel configuration from /home/m1ck0/Desktop/projects/test-next-style/with-styled-jsx-scss-app/.babelrc
error - ./pages/index.js
TypeError: /home/m1ck0/Desktop/projects/test-next-style/with-styled-jsx-scss-app/pages/index.js: plugins is not a function
event - build page: /next/dist/pages/_error
wait  - compiling...
error - ./pages/index.js 
TypeError: /home/m1ck0/Desktop/projects/test-next-style/with-styled-jsx-scss-app/pages/index.js: plugins is not a function 
Error: Cannot find module '/home/m1ck0/Desktop/projects/test-next-style/with-styled-jsx-scss-app/.next/server/pages-manifest.json'

主要报错内容:plugins is not a function,在查阅相关的issues后找到解决方案,我发布了一篇styled-jsx中使用Sass的文章(这个GitHub issues中也有写到),文章地址,主要内容就是旧的插件不在维护现在使用@styled-jsx/plugin-sass作为styled-jsx中的预处理插件。正向插件中所说的,该插件是对旧插件的优化,开发者直接安装无缝替换就可以。

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档