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

config base : '' produce different results depending on the platform #9771

Closed
7 tasks done
JiPaix opened this issue Aug 21, 2022 · 1 comment · Fixed by #9793
Closed
7 tasks done

config base : '' produce different results depending on the platform #9771

JiPaix opened this issue Aug 21, 2022 · 1 comment · Fixed by #9793
Labels
p2-edge-case Bug, but has workaround or limited in scope (priority) windows only

Comments

@JiPaix
Copy link

JiPaix commented Aug 21, 2022

Describe the bug

index.html

Linux:

  <script type="module" crossorigin src="./index.b50828a7.js"></script>
  <link rel="modulepreload" crossorigin href="./[email protected]">

Windows:

  <script type="module" crossorigin src="../Users/jipaix/Repos/fukayo/packages/render/index.b50828a7.js"></script>
  <link rel="modulepreload" crossorigin href="../Users/jipaix/Repos/fukayo/packages/render/[email protected]">

setting base to ./ produce the same results, and / doesn't meet my needs, the page is loaded with Electron so:

  • /somefile = file://C:/somefile,
  • ../Users/jipaix/Repos/fukayo/packages/render/somefile = C:/Users/jipaix/Repos/fukayo/Users/jipaix/Repos/fukayo/packages/render/somefile

Reproduction

run npm run build:renderer on both plateforms and see the results in packages/renderer/dist/index.html: https://github.com/JiPaix/Fukayo/tree/183069a81a17b9b651261d374a253641edf59a73

System Info

Linux:


  System:
    OS: Linux 5.19 Manjaro Linux
    CPU: (24) x64 AMD Ryzen 9 3900X 12-Core Processor
    Memory: 4.06 GB / 31.26 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.14.0/bin/yarn
    npm: 8.7.0 - ~/.nvm/versions/node/v16.14.0/bin/npm
  Browsers:
    Chromium: 104.0.5112.79
    Firefox: 103.0.2
  npmPackages:
    @vitejs/plugin-vue: 3.0.3 => 3.0.3 
    vite: ^3.0.7 => 3.0.7 


Windows:

  System:
    OS: Windows 10 10.0.19044
    CPU: (2) x64 AMD Ryzen 9 3900X 12-Core Processor
    Memory: 1.65 GB / 4.00 GB
  Binaries:
    Node: 18.7.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.10.0 - ~\AppData\Roaming\npm\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (104.0.1293.54)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    @vitejs/plugin-vue: 3.0.3 => 3.0.3
    vite: ^3.0.9 => 3.0.9

Used Package Manager

npm

Logs

No response

Validations

@JiPaix JiPaix changed the title config base : '' is allowed and produce different results depending on the platform config base : '' produce different results depending on the platform Aug 21, 2022
@sapphi-red
Copy link
Member

It was because you were using relative path here.
https://github.com/JiPaix/Fukayo/blob/183069a81a17b9b651261d374a253641edf59a73/packages/renderer/vite.config.js#L50
Change 'index.html' to path.resolve('index.html') for workaround.

@sapphi-red sapphi-red added p2-edge-case Bug, but has workaround or limited in scope (priority) windows only labels Aug 21, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Sep 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p2-edge-case Bug, but has workaround or limited in scope (priority) windows only
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants