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

[Bug report] Markdown with component imported randomesly failed during built #1147

Closed
Mister-Hope opened this issue Oct 28, 2022 · 3 comments
Assignees

Comments

@Mister-Hope
Copy link
Member

Mister-Hope commented Oct 28, 2022

Description

When uses import componts in markdown files, e.g.:

<MyComponent>

<script setup>
import MyComponent from '@MyComponent'
</script>

They may failed with the following issue randomly.

Logs:

docs/theme docs:vite-build: ✔ Initializing and preparing data - done in 35.96s
docs/theme docs:vite-build: - Compiling with vite
docs/theme docs:vite-build: [vite:esbuild] Transform failed with 1 error:
docs/theme docs:vite-build: /home/runner/work/vuepress-theme-hope/vuepress-theme-hope/docs/theme/src/.vuepress/.temp/pages/guide/interface/darkmode.html.vue?vue&type=script&setup=true&lang.ts:1:21: ERROR: Expected ";" but found "dark"
docs/theme docs:vite-build: file: /home/runner/work/vuepress-theme-hope/vuepress-theme-hope/docs/theme/src/.vuepress/.temp/pages/guide/interface/darkmode.html.vue?vue&type=script&setup=true&lang.ts:1:21
docs/theme docs:vite-build: 
docs/theme docs:vite-build: Expected ";" but found "dark"
docs/theme docs:vite-build: 1  |  <template><div><p>In dark mode, the page uses a dark background to make you comfortable.</p>
docs/theme docs:vite-build:    |                       ^
docs/theme docs:vite-build: 2  |  <!-- more -->
docs/theme docs:vite-build: 3  |  <h2 id="try-it" tabindex="-1"><a class="header-anchor" href="#try-it" aria-hidden="true">#</a> Try it</h2>
docs/theme docs:vite-build: 
docs/theme docs:vite-build: ✖ Compiling with vite - failed in 21.55s
docs/theme docs:vite-build: Error: Transform failed with 1 error:
docs/theme docs:vite-build: /home/runner/work/vuepress-theme-hope/vuepress-theme-hope/docs/theme/src/.vuepress/.temp/pages/guide/interface/darkmode.html.vue?vue&type=script&setup=true&lang.ts:1:21: ERROR: Expected ";" but found "dark"
docs/theme docs:vite-build:     at failureErrorWithLog (/home/runner/work/vuepress-theme-hope/vuepress-theme-hope/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:1566:15)
docs/theme docs:vite-build:     at /home/runner/work/vuepress-theme-hope/vuepress-theme-hope/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:805:29
docs/theme docs:vite-build:     at responseCallbacks.<computed> (/home/runner/work/vuepress-theme-hope/vuepress-theme-hope/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:671:9)
docs/theme docs:vite-build:     at handleIncomingPacket (/home/runner/work/vuepress-theme-hope/vuepress-theme-hope/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:726:9)
docs/theme docs:vite-build:     at Socket.readFromStdout (/home/runner/work/vuepress-theme-hope/vuepress-theme-hope/node_modules/.pnpm/[email protected]/node_modules/esbuild/lib/main.js:647:7)
docs/theme docs:vite-build:     at Socket.emit (node:events:513:28)
docs/theme docs:vite-build:     at addChunk (node:internal/streams/readable:324:12)
docs/theme docs:vite-build:     at readableAddChunk (node:internal/streams/readable:297:9)
docs/theme docs:vite-build:     at Readable.push (node:internal/streams/readable:234:10)
docs/theme docs:vite-build:     at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)
docs/theme docs:vite-build: Failed

All problems logs are with same issue stack (the only difference is the first one comming from vue component converting from markdown, saying:

Expected ";" but found "<A word in markdown>"

@meteorlxy This happens after migrating to ESM.

Posible reasons

I think we might need to double check if we have async task here that may excute in unexpected squence during build.

I already met this issue more that 30 times, with a probability around 10% - 20%.

@meteorlxy
Copy link
Member

Be professional, boy. Report things "Mysteriously" is bad.

@Mister-Hope Mister-Hope changed the title [Bug report] CI failed mysteriously [Bug report] Markdown with component imported randomesly failed during built Dec 9, 2022
@Mister-Hope Mister-Hope reopened this Dec 9, 2022
@Mister-Hope
Copy link
Member Author

A exmaple :

https://github.com/vuepress-theme-hope/vuepress-theme-hope/actions/runs/3650362766/jobs/6174680253

image

Neify and gitee workflow only differs 2 env process.env.base and process.env.hostname

I ensure this problem is not in my code and all the failed pages are not the same but all import vue component with <script setup>

@Mister-Hope
Copy link
Member Author

I am not seeing this issue for quite a long time, closing it.

Guess the issue is from tool chain.

@Mister-Hope Mister-Hope closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants