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

Upgrade to ESM build of Vite #1985

Closed
2 tasks
yurishkuro opened this issue Nov 20, 2023 · 3 comments · Fixed by #1992
Closed
2 tasks

Upgrade to ESM build of Vite #1985

yurishkuro opened this issue Nov 20, 2023 · 3 comments · Fixed by #1992

Comments

@yurishkuro
Copy link
Member

When running yarn start the following warning is printed:

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

According to the wiki, the CJS build will be removed in Vite v6.

  • investigate & document what needs to change and what the implications are
  • open PR with the required changes
@MeenuyD
Copy link
Contributor

MeenuyD commented Nov 21, 2023

Hello @yurishkuro should we run the npm install vite@latest --save-dev

@yurishkuro
Copy link
Member Author

why?

@ShivamMadlani
Copy link
Contributor

hey @yurishkuro... in order to get rid of the warning we need to rename the vite.config.ts to vite.config.mts.

The closest package.json file has "type": "module", or use the .mjs/.mts extension, e.g. vite.config.mjs or vite.config.mts.

however, on doing this it throws an error on line 60 in vite.config.ts which states:

TypeError: visualizer is not a function

i fixed this by reffering to https://www.npmjs.com/package/rollup-plugin-visualizer.

The warning is fixed now :). Should i open a PR?

ShivamMadlani added a commit to ShivamMadlani/jaeger-ui that referenced this issue Nov 21, 2023
This commit fixes the CJS deprication warning.

Signed-off-by: shivam <[email protected]>
ShivamMadlani added a commit to ShivamMadlani/jaeger-ui that referenced this issue Nov 22, 2023
This commit fixes the CJS deprication warning

Signed-off-by: shivam <[email protected]>
ShivamMadlani added a commit to ShivamMadlani/jaeger-ui that referenced this issue Nov 22, 2023
This commit fixes the CJS deprication warning

Signed-off-by: shivam <[email protected]>
ShivamMadlani added a commit to ShivamMadlani/jaeger-ui that referenced this issue Nov 23, 2023
The previous commit changed the config from CJS to ESM which caused
2 tests to fail.
This commit fixes the above issue by replacing 'require' with 'import'
throughout the project

Signed-off-by: shivam <[email protected]>
ShivamMadlani added a commit to ShivamMadlani/jaeger-ui that referenced this issue Nov 25, 2023
This commit fixes the CJS deprication warning by renaming vite.config.ts
to vite.config.mts.

Signed-off-by: shivam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants