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

GitHub Actions failing due to vite sourcemap error; deprecated vite versions #29

Open
chunhochow opened this issue Jul 21, 2023 · 1 comment

Comments

@chunhochow
Copy link
Member

chunhochow commented Jul 21, 2023

original error

When compiling with npm ci or npm i[nstall], the following shows

Sourcemap is likely to be incorrect: a plugin (vite:worker) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
Sourcemap is likely to be incorrect: a plugin (vite-plugin-md) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help

npm ci or npm i does not crash on my local machine with that error, but GitHub Actions running npm ci fails on this.

upstream commits

We know for sure the last commit that this doesn't (always) fail on is 8df8638 (2023/5/2 fix: Embed multiple SimWrapper views on a single HTML webpage), even though the sourcemap error occurs on this commit too. (I was rebasing all my gh-pages branch onto different commits on upstream (simwrapper/simwrapper master branch) to test this.)
(Although this can be inconsistent: it DID fail at least twice on commit 8df8638. And even though it worked, the individual visualizations no longer worked...)

In the one time that I tried, this fails on the next commit 83e5824 update 404 comment, even though all that's changed is comments in 404.html.

vite deprecation

This error is produced by out of date vite versions. Besides, the current vite versions are deprecated, and e.g. vite-plugin-vue2 isn't even supported past Dec 2022, and should be replaced with @vitejs/plugin-vue[2] .

partial solution

Updating the following packages in package.json works to solve the sourcemap error.

REMOVE "vite-plugin-vue2": "^2.0.2",
REPLACE WITH "@vitejs/plugin-vue2": "^1.1.2",
INCREASE VERSION NUMBERS ON:
"vite": "2.5.10", -> "vite": "^2.9.16",
"vite-plugin-md": "^0.11.0", -> "vite-plugin-vue-markdown": "^0.23.5"

Also associated changes in vite.config.ts: replace

createVuePlugin({ include: [/\.vue$/, /\.md$/] }),
markdownPlugin(),

with

vue({ include: [/\.vue$/, /\.md$/] }),
Markdown(),

(see: aa22e0e . this was modified off of v2.4.0)

problem

This works locally, but then for some reason the GitHub Pages website sfcta.github.io/simwrapper/ is blanks and auto-redirects (without loading) to sfcta.github.io .

This may perhaps be due to the base URL issue that was mentioned in the commit from 2022/09 fix: downgrade vite to 2.5.10 until we can figure out the base_url pr… ?

things I've tried (that does nothing)

I tried creating a .env file in the root directory of the repo with

BASE_URL=/simwrapper/

but this does nothing...

@chunhochow
Copy link
Member Author

blocked on simwrapper#280

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

No branches or pull requests

1 participant