Skip to content
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

add highlight.js style toggle #112

Merged
merged 21 commits into from
Dec 3, 2021
Merged

add highlight.js style toggle #112

merged 21 commits into from
Dec 3, 2021

Conversation

miaogaolin
Copy link
Contributor

No description provided.

@github-actions
Copy link

github-actions bot commented Dec 3, 2021

🎊 PR Preview has been successfully built and deployed to https://doocs-md-preview-pr-112.surge.sh

@yanglbme
Copy link
Member

yanglbme commented Dec 3, 2021

build 失败了 @miaogaolin

image

@miaogaolin
Copy link
Contributor Author

build 失败了 @miaogaolin

image

请教个问题,我本地是遇到了一些问题才加的 Webpack,现在有点疑惑,是不是不需要加

@wll8
Copy link
Collaborator

wll8 commented Dec 3, 2021

我们本地开发的时候是没有加的,然后之前线上自动部署也是成功的,不加的。所以感觉可以不用。应该是 vue-cli-service 包含了的。

@miaogaolin
Copy link
Contributor Author

我们本地开发的时候是没有加的,然后之前线上自动部署也是成功的,不加的。所以感觉可以不用。应该是 vue-cli-service 包含了的。

帮忙再看看为啥 webpack 删除之后,build 中还有 webpack 的错误。

@wll8
Copy link
Collaborator

wll8 commented Dec 3, 2021

你先在新目录直接使用 https://github.com/doocs/md install/build 看看有没有问题

@miaogaolin
Copy link
Contributor Author

你先在新目录直接使用 https://github.com/doocs/md install/build 看看有没有问题

image

这是拉取的 doocs/md 出现的问题。我本地的项目 miaogaoling/md 也是遇到这个问题,我才加的 webpack,下面是我加 webpack 的出处。
image
image

@wll8
Copy link
Collaborator

wll8 commented Dec 3, 2021

收到,我研究研究

@yanglbme
Copy link
Member

yanglbme commented Dec 3, 2021

@miaogaolin 会不会跟 node 版本有关?你本地 node 是哪个版本?

@wll8
Copy link
Collaborator

wll8 commented Dec 3, 2021

我刚刚拉了 commit 是可以成功的:

D:\git2\md>node -v
v14.15.5

D:\git2\md>npm -v
6.14.11

D:\git2\md>git pull gitee main
From https://gitee.com/doocs/md
 * branch            main       -> FETCH_HEAD
Updating 8cb566f..3880073

D:\git2\md>rd /s /q node_modules

D:\git2\md>cnpm i

D:\git2\md>npm run build

D:\git2\md>git log
commit 38800737fadb2aa19fb4f671d4954320c03c56a6 (HEAD -> main, gitee/main)
Author: yanglbme <szuyanglb@outlook.com>
Date:   Fri Dec 3 09:31:12 2021 +0800

    docs: update readme guideline

@miaogaolin

image

@miaogaolin
Copy link
Contributor Author

miaogaolin commented Dec 3, 2021

@miaogaolin 会不会跟 node 版本有关?你本地 node 是哪个版本?

image

@miaogaolin
Copy link
Contributor Author

我刚刚拉了 commit 是可以成功的:

D:\git2\md>node -v
v14.15.5

D:\git2\md>npm -v
6.14.11

D:\git2\md>git pull gitee main
From https://gitee.com/doocs/md
 * branch            main       -> FETCH_HEAD
Updating 8cb566f..3880073

D:\git2\md>rd /s /q node_modules

D:\git2\md>cnpm i

D:\git2\md>npm run build

D:\git2\md>git log
commit 38800737fadb2aa19fb4f671d4954320c03c56a6 (HEAD -> main, gitee/main)
Author: yanglbme <szuyanglb@outlook.com>
Date:   Fri Dec 3 09:31:12 2021 +0800

    docs: update readme guideline

@miaogaolin

image

那就奇怪了,那我 pr 的代码把 webpack都删了,build 错误怎么还提及到 webpack

@wll8
Copy link
Collaborator

wll8 commented Dec 3, 2021

你这个就是 node 版本问题,你切下就行了。

added 2057 packages in 8m

25 packages are looking for funding
  run `npm fund` for details
npm notice
npm notice New minor version of npm available! 8.1.0 -> 8.2.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.2.0
npm notice Run npm install -g npm@8.2.0 to update!
npm notice

> md@1.5.6 build
> vue-cli-service build


✔  Building for production...
 ERROR  Error: Rule can only have one resource source (provided resource and test + include + exclude) in {
  "type": "javascript/auto",
  "include": [
    {}
  ],
  "use": []
}
Error: Rule can only have one resource source (provided resource and test + include + exclude) in {
  "type": "javascript/auto",
  "include": [
    {}
  ],
  "use": []
}

@miaogaolin
Copy link
Contributor Author

你这个就是 node 版本问题,你切下就行了。

added 2057 packages in 8m

25 packages are looking for funding
  run `npm fund` for details
npm notice
npm notice New minor version of npm available! 8.1.0 -> 8.2.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.2.0
npm notice Run npm install -g npm@8.2.0 to update!
npm notice

> md@1.5.6 build
> vue-cli-service build


✔  Building for production...
 ERROR  Error: Rule can only have one resource source (provided resource and test + include + exclude) in {
  "type": "javascript/auto",
  "include": [
    {}
  ],
  "use": []
}
Error: Rule can only have one resource source (provided resource and test + include + exclude) in {
  "type": "javascript/auto",
  "include": [
    {}
  ],
  "use": []
}

那我应该使用哪个版本,我换成了 v14.18.1,但还是有问题。
image

@wll8
Copy link
Collaborator

wll8 commented Dec 3, 2021

我目前上面用的 v14.15.5,上面有 log,切了之后一般需要删了 node_modules 重新安装试试。我现在正在看看是不是依赖更新的问题。

@miaogaolin
Copy link
Contributor Author

我目前上面用的 v14.15.5,上面有 log,切了之后一般需要删了 node_modules 重新安装试试。我现在正在看看是不是依赖更新的问题。

我把 node_modules 和 package-lock.json 都删过了,还是有问题,那我试试你的版本吧

@wll8
Copy link
Collaborator

wll8 commented Dec 3, 2021

D:\git2\md>npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: md@1.5.6
npm ERR! Found: webpack@4.46.0
npm ERR! node_modules/webpack
npm ERR!   webpack@"^4.0.0" from @vue/cli-plugin-babel@4.5.15
npm ERR!   node_modules/@vue/cli-plugin-babel
npm ERR!     dev @vue/cli-plugin-babel@"~4.5.12" from the root project
npm ERR!   webpack@"^4.0.0" from @vue/cli-service@4.5.15
npm ERR!   node_modules/@vue/cli-service
npm ERR!     dev @vue/cli-service@"~4.5.12" from the root project
npm ERR!     peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/cli-plugin-babel@4.5.15
npm ERR!     node_modules/@vue/cli-plugin-babel
npm ERR!       dev @vue/cli-plugin-babel@"~4.5.12" from the root project
npm ERR!   2 more (less-loader, raw-loader)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev sass-loader@"^11.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack@5.64.4
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^5.0.0" from sass-loader@11.1.1
npm ERR!   node_modules/sass-loader
npm ERR!     dev sass-loader@"^11.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\xiaowenhua\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xiaowenhua\AppData\Local\npm-cache\_logs\2021-12-03T06_01_27_478Z-debug.log
- "sass-loader": "^11.0.1",

尝试降级 sass-loader 版本,或者直接删除(反正目前项目中的 style 中我没有看到使用 scss),我删除后 build 成功,删除前报错 sass-loader 依赖的 webpack 版本冲突 。

看起来:

  • sass-loader@11+ 依赖 webpack5+
  • vue-cli 依赖 webpack4+

不知道理解对不。那么问题来了,sass-loader@11+ 是几个月前就添加的,为什么现在才暴露这个问题?vue-cli也换了快2-3周了,神奇~

可以参考相关问题:

@miaogaolin
Copy link
Contributor Author

D:\git2\md>npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: md@1.5.6
npm ERR! Found: webpack@4.46.0
npm ERR! node_modules/webpack
npm ERR!   webpack@"^4.0.0" from @vue/cli-plugin-babel@4.5.15
npm ERR!   node_modules/@vue/cli-plugin-babel
npm ERR!     dev @vue/cli-plugin-babel@"~4.5.12" from the root project
npm ERR!   webpack@"^4.0.0" from @vue/cli-service@4.5.15
npm ERR!   node_modules/@vue/cli-service
npm ERR!     dev @vue/cli-service@"~4.5.12" from the root project
npm ERR!     peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/cli-plugin-babel@4.5.15
npm ERR!     node_modules/@vue/cli-plugin-babel
npm ERR!       dev @vue/cli-plugin-babel@"~4.5.12" from the root project
npm ERR!   2 more (less-loader, raw-loader)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev sass-loader@"^11.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack@5.64.4
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^5.0.0" from sass-loader@11.1.1
npm ERR!   node_modules/sass-loader
npm ERR!     dev sass-loader@"^11.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\xiaowenhua\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xiaowenhua\AppData\Local\npm-cache\_logs\2021-12-03T06_01_27_478Z-debug.log
- "sass-loader": "^11.0.1",

尝试降级 sass-loader 版本,或者直接删除(反正目前项目中的 style 中我没有看到使用 scss)。

换成你的版本就好了,我看了下我用过的 node 两个版本 14.18.1 和 16.13.0,他们对应的 npm 版本都是 8.1.4,而你的提供的版本对应的 npm 是 6.14.11

@wll8
Copy link
Collaborator

wll8 commented Dec 3, 2021

npm 版本是可以升级的。

@miaogaolin
Copy link
Contributor Author

D:\git2\md>npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: md@1.5.6
npm ERR! Found: webpack@4.46.0
npm ERR! node_modules/webpack
npm ERR!   webpack@"^4.0.0" from @vue/cli-plugin-babel@4.5.15
npm ERR!   node_modules/@vue/cli-plugin-babel
npm ERR!     dev @vue/cli-plugin-babel@"~4.5.12" from the root project
npm ERR!   webpack@"^4.0.0" from @vue/cli-service@4.5.15
npm ERR!   node_modules/@vue/cli-service
npm ERR!     dev @vue/cli-service@"~4.5.12" from the root project
npm ERR!     peer @vue/cli-service@"^3.0.0 || ^4.0.0-0" from @vue/cli-plugin-babel@4.5.15
npm ERR!     node_modules/@vue/cli-plugin-babel
npm ERR!       dev @vue/cli-plugin-babel@"~4.5.12" from the root project
npm ERR!   2 more (less-loader, raw-loader)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev sass-loader@"^11.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: webpack@5.64.4
npm ERR! node_modules/webpack
npm ERR!   peer webpack@"^5.0.0" from sass-loader@11.1.1
npm ERR!   node_modules/sass-loader
npm ERR!     dev sass-loader@"^11.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\xiaowenhua\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xiaowenhua\AppData\Local\npm-cache\_logs\2021-12-03T06_01_27_478Z-debug.log
- "sass-loader": "^11.0.1",

尝试降级 sass-loader 版本,或者直接删除(反正目前项目中的 style 中我没有看到使用 scss),我删除后 build 成功,删除前报错 sass-loader 依赖的 webpack 版本冲突 。

看起来:

  • sass-loader@11+ 依赖 webpack5+
  • vue-cli 依赖 webpack4+

不知道理解对不。那么问题来了,sass-loader@11+ 是几个月前就添加的,为什么现在才暴露这个问题?vue-cli也换了快2-3周了,神奇~

可以参考相关问题:

那我就先删了,等用到了再加

@wll8
Copy link
Collaborator

wll8 commented Dec 3, 2021

你删后先看看项目正常不。我这边也看看。建议不要总是引用原评论,消息看起来好长……

@miaogaolin
Copy link
Contributor Author

删除后就好了

@wll8
Copy link
Collaborator

wll8 commented Dec 3, 2021

现在我使用了你原来的 node 版本,也可以了。
image

wll8 added a commit to wll8/md that referenced this pull request Dec 3, 2021
- sass 在目前项目中没有使用到,目前项目中使用的是 less
- sass 导致了 [doocs#112](doocs#112 (comment)) 中的问题
wll8 added a commit to wll8/md that referenced this pull request Dec 3, 2021
- sass 在目前项目中没有使用到,目前项目中使用的是 less
- sass 导致了 [doocs#112](doocs#112 (comment)) 中的问题
@wll8 wll8 mentioned this pull request Dec 3, 2021
wll8 added a commit that referenced this pull request Dec 3, 2021
- sass 在目前项目中没有使用到,目前项目中使用的是 less
- sass 导致了 [#112](#112 (comment)) 中的问题
@yanglbme yanglbme merged commit fe4d6b0 into doocs:main Dec 3, 2021
yanglbme added a commit that referenced this pull request Jan 17, 2022
- 移除 HBuilderX 相关依赖 #86
- 支持导入 markdown 文档 #89
- 支持自定义上传逻辑 #91
- 支持 unicloud 私有服务 #99
- 支持选择代码块主题 #112
- 支持自定义代码块样式 #117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants