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] Building by vite several times cause the same output with different inputs #772

Closed
MicrowaveDev opened this issue Mar 22, 2022 · 13 comments
Labels
bug Something isn't working

Comments

@MicrowaveDev
Copy link

Bug report

Description

I have an application, where i need to build several static sites from one runtime in series: build after build. But i got a strange behavior. After first build i got second with same output as first, while i have different inputs. I made a simple repo to reproduce error.

Steps to reproduce

git clone https://github.com/MicrowaveDev/vuepress-test.git
cd vuepress-test
npm start

Expected behavior

  1. After first build: includes "Test 1" in .vuepress/dist/index.html content with output includes 1: true in console log
  2. After second build: includes "Test 2" in .vuepress/dist/index.html content with output includes 2: true in console log

Logs

START
initialize and prepare
build
⠦ Compiling with vite@vuepress/client doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.
✔ Compiling with vite - done
⠋ Rendering pages⠋ Rendering pages /404.html[Vue warn]: App already provides property with key "Symbol(ssrContext)". It will be overwritten with the new value.
[Vue warn]: App already provides property with key "Symbol(ssrContext)". It will be overwritten with the new value.
✔ Rendering pages - done
process onGenerated hook
DONE


includes 1: true


not exists: true


START
initialize and prepare
build
@vuepress/client doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix. (x2)
✔ Compiling with vite - done
⠋ Rendering pages⠋ Rendering pages /404.html[Vue warn]: App already provides property with key "Symbol(ssrContext)". It will be overwritten with the new value.
[Vue warn]: App already provides property with key "Symbol(ssrContext)". It will be overwritten with the new value.
✔ Rendering pages - done
process onGenerated hook
DONE


includes 2: false

Environment info

  • Browser: Without browser, only cli
  • Output of vuepress info:
Environment Info:

  System:
    OS: Linux 5.13 Ubuntu 20.04.4 LTS (Focal Fossa)
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
  Binaries:
    Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.2/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
  Browsers:
    Chrome: 98.0.4758.102
    Firefox: 98.0.1
  npmPackages:
    @vuepress/core: 2.0.0-beta.36 => 2.0.0-beta.36 
    @vuepress/theme-default: Not Found
    vuepress: Not Found
  npmGlobalPackages:
    vuepress: Not Found
@Mister-Hope
Copy link
Member

Mister-Hope commented Mar 22, 2022

1C0B8570-1B3C-4FCD-B348-A1746DCD2D44

@Mister-Hope
Copy link
Member

do not mix different versions

@Mister-Hope
Copy link
Member

Mister-Hope commented Mar 22, 2022

Also, you are expected to clean page temp files when having advanced usage with api to create your page.

if you make sure that problem exists after using same version and cleaning the changed page temp files under temp/pages, welcome to upgrade your repo and have some feedback here.

Also, adding a workflow would be nice.

@MicrowaveDev
Copy link
Author

MicrowaveDev commented Mar 22, 2022

Ok, i downgraded to 35, but dont understand your versioning. Some packages have 36 and some still have 35. I though i should to use the last versions of all packages.

Also added whole .vuepress directory cleaning. I tried to clean it before, but it did not work, and i saw that temp file had the actual data of second build.

Repo updated: MicrowaveDev/vuepress-test@7005f30

What do you mean about adding the workflow? I made a repo with script that reproduced the error

@Mister-Hope
Copy link
Member

I though i should to use the last versions of all packages.
Emm, just realize that

I will have a look later

@MicrowaveDev
Copy link
Author

Hello, any news about this issue?

@github-actions
Copy link

github-actions bot commented Apr 5, 2022

This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 3 days.

@github-actions github-actions bot added the stale label Apr 5, 2022
@Mister-Hope Mister-Hope removed the stale label Apr 5, 2022
@Mister-Hope
Copy link
Member

#602 (comment)

@github-actions github-actions bot added the stale label Apr 14, 2022
@github-actions
Copy link

This issue is marked as stale because it has not had recent activity. Issues marked with stale will be closed if they have no activity within 3 days.

@Mister-Hope Mister-Hope removed the stale label Apr 14, 2022
@Mister-Hope
Copy link
Member

Not a bug at all. Try not share the same vuepress instance. See https://github.com/Mister-Hope/vuepress-test

call.js works, but exec.js does not work.

@Mister-Hope Mister-Hope added the question Asking question label Apr 16, 2022
@MicrowaveDev
Copy link
Author

Thank you for sample with using child process, but i know about this workaround and hoped not to use it because i have many data to pass to site generator. I think it's a bug, that library in one process makes the same output with different inputs, and hope that one day it will be solved and can be used without child processes

@Mister-Hope
Copy link
Member

This is every hard to check, and I am not interest in it becuz you already have a workaround and this is not a normal usage.

Maybe you can see if @meteorlxy can find some time investigate it. (But I am afraid he cannot in the comming few months)

@Mister-Hope Mister-Hope reopened this Apr 16, 2022
@Mister-Hope Mister-Hope added bug Something isn't working and removed question Asking question labels Apr 16, 2022
@meteorlxy
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants