Skip to content

Conversation

lizlooney
Copy link
Collaborator

Fixed vite according to https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated

When doing npm run start, I was getting the following error:

$ npm run start

> SystemCore [email protected] start
> vite

The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
failed to load config from /Users/lizlooney/wpilib/1/systemcore-blocks-interface/vite.config.ts
error when starting dev server:
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/lizlooney/wpilib/1/systemcore-blocks-interface/node_modules/vite-plugin-static-copy/dist/index.js from /Users/lizlooney/wpilib/1/systemcore-blocks-interface/vite.config.ts not supported.
Instead change the require of index.js in /Users/lizlooney/wpilib/1/systemcore-blocks-interface/vite.config.ts to a dynamic import() which is available in all CommonJS modules.
    at _require.extensions.<computed> [as .js] (file:///Users/lizlooney/wpilib/1/systemcore-blocks-interface/node_modules/vite/dist/node/chunks/dep-DBxKXgDP.js:49430:9)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at Object.<anonymous> (/Users/lizlooney/wpilib/1/systemcore-blocks-interface/vite.config.ts:36:38)

@lizlooney lizlooney requested a review from alan412 June 21, 2025 06:19
Copy link
Collaborator

@alan412 alan412 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alan412 alan412 merged commit c4dc25b into wpilibsuite:main Jun 21, 2025
1 check passed
@lizlooney lizlooney deleted the pr_fix_vite branch June 28, 2025 04:37
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

Successfully merging this pull request may close these issues.

2 participants