in

Error deploying vite + react application to Heroku


I’m trying to deploy my app to Heroku.
When I run npm build on my machine, it works.
But when Heroku runs npm build, it cannot transform a module in my app.

The build log gives the following:

Build
       Running build
       
       > taleme@1.0.0 build
       > vite build
       
       vite v2.7.10 building for production...
       transforming...
       ✓ 32 modules transformed.
Could not resolve './taleme/LocalMultiplayer' from src/Game.tsx
error during build:
Error: Could not resolve './taleme/LocalMultiplayer' from src/Game.tsx
    at error (/tmp/build_fa45ef37/node_modules/vite/node_modules/rollup/dist/shared/rollup.js:158:30)
    at ModuleLoader.handleResolveId (/tmp/build_fa45ef37/node_modules/vite/node_modules/rollup/dist/shared/rollup.js:22384:24)
    at /tmp/build_fa45ef37/node_modules/vite/node_modules/rollup/dist/shared/rollup.js:22363:26
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
[!] Error: unfinished hook action(s) on exit:
(vite:css) transform "/tmp/build_fa45ef37/src/index.css"
(vite:load-fallback) load "/tmp/build_fa45ef37/src/taleme/LobbyView.tsx"

When I try to temporarily remove this import, a different module imported somewhere else pops in with this error.
I’ve got no clue as to why vite cannot perform the transform on Heroku.

Any help would be greatly appreciated!



Source: https://stackoverflow.com/questions/70631072/error-deploying-vite-react-application-to-heroku

Distributed Systems with Golang to consequently build a fully-fletched distributed service

Mid-Range Smartphone Is Your Best Bet for Long-Term, Let’s Talk