Skip to content
Snippets Groups Projects

Migrate from Create React App to Vite

Merged Dillon Scott Fitzgerald requested to merge dillon-CRA-to-vite into alpha
All threads resolved!

This closes #51 (closed).

I am opening in draft status as there is still an issue I need to fix with the dev server.

Currently, npm start or npm run start do not properly launch the app on the dev server. Instead, it launches a blank page with the following error reported to the console:

Uncaught ReferenceError: global is not defined
    js rng-browser.js:4
    __require2 chunk-BQWMX7FD.js:15
    js uuid.js:9
    __require2 chunk-BQWMX7FD.js:15
    js index.js:29
    __require2 chunk-BQWMX7FD.js:15
    <anonymous> react-graph-vis.js:29391

The following workflow does work for previewing the build (after running npm install if using this branch for the first time):

npm run build
npm run preview

but this is not ideal for local devs. Likely need to adjust the vite.config.js file to solve this issue. It looks like similar issues with Vite have been reported in the past.

Edited by Dillon Scott Fitzgerald

Merge request reports

Pipeline #7422699 passed

Pipeline passed for e4ddba17 on dillon-CRA-to-vite

Merged by Dillon Scott FitzgeraldDillon Scott Fitzgerald 9 months ago (May 21, 2024 9:52pm UTC)

Loading

Pipeline #7422703 passed

Pipeline passed for caff79fd on alpha

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • With the most recent commits, the dev server is working fine and all vulnerabilities are resolved as seen by running npm audit (after npm install).

    I will do a little bit more testing before merging but this definitely seems like the way to go.

  • added 1 commit

    • e4ddba17 - update package-lock.json with vite dependencies

    Compare with previous version

  • resolved all threads

  • mentioned in commit caff79fd

  • Dillon Scott Fitzgerald changed the description

    changed the description

  • Please register or sign in to reply
    Loading