sentry-wizard icon indicating copy to clipboard operation
sentry-wizard copied to clipboard

Vite plugin isn't inserted correctly when config is declared as variable and `satisfies` is used

Open Lms24 opened this issue 2 years ago • 3 comments

Environment

Latest source maps or sveltekit wizard. Note version is irrelevant.

Steps to Reproduce

  1. Create this config file:
// vite.config.ts
import { somePlugin1, somePlugin2 } from 'some-module'

import type { UserConfig } from 'vite';

const myConfig = defineConfig({
  plugins: [somePlugin1(), somePlugin2()]
}) satisfies UserConfig;

export default myConfig;
  1. npx @sentry/wizard -i sourcemaps

Expected Result

Plugin is inserted

Actual Result

Plugin isn't inserted

Solution

We're (still) using magicast to take care of plugin insertion. I'm contemplating switching to recast entirely but for now I opened a PR in magicast to fix this: https://github.com/unjs/magicast/pull/82

Lms24 avatar Sep 12 '23 12:09 Lms24

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Oct 04 '23 00:10 github-actions[bot]

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Nov 07 '23 00:11 github-actions[bot]