Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Vite build fails (error processing js file) #1

Open
ghost opened this issue Aug 11, 2021 · 3 comments
Open

Vite build fails (error processing js file) #1

ghost opened this issue Aug 11, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Aug 11, 2021

Hi

Sorry to bother you (I realise this is just a demo repository) but I'm hoping you can help. When I clone this repository and run pnpm build, Vite fails. It appears that swc is asked to transpile index.html and, of course, it fails.

I've tried adding a test: ".*\.ts$" line to the swc configuration, but that didn't help

Any ideas?

Thanks

@zojize
Copy link
Owner

zojize commented Aug 12, 2021

Hi @sdc395biosite

First, thanks for your feedback. However, since I recently got rid of my old MacBook, I haven't found much success in configuring node/npm on my windows laptop. So before I receive my new MacBook I can't really test this for you. But just want to know, did running pnpm dev also fail, or is it just pnpm build? I never planned on deploying this demo so I actually never tested pnpm build. But this problem you ran into may be because of the discrepancy between Vite's dev server and the built package.

@ghost
Copy link
Author

ghost commented Aug 12, 2021

pnpm dev runs without complaint, so it would seem to be down to some difference between the development and build processes. I'm a complete Vite, SWC, Rollup newbie, but I'll report back if I figure it out before your new MacBook arrives. :-)

Thanks for responding.

@zojize
Copy link
Owner

zojize commented Aug 26, 2021

@sdc395biosite
I made a change to the swc plugin and hacked its transform function to ignore files ending in ".html". It should work as expected now. Try running pnpm start to see if there are any other issues. Hope this is still relevant for you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant