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

Bump @vitejs/plugin-vue to 1.10.2 #199

Merged
merged 1 commit into from
Jan 20, 2022

Conversation

joshwooding
Copy link
Member

@joshwooding joshwooding commented Jan 7, 2022

This should fix the error reported in #188 (comment)

Since I could run yarn workspace example-react storybook fine the issue looked to be with vite and vue. Bumping the vue plugin fixes it so I assume it's an compatibility issue with the version of the plugin and vite.

cc @IanVS @mrauhu

@joshwooding
Copy link
Member Author

I'm still experiencing the issue #50 with our vue and svelte examples :(

@mrauhu
Copy link
Contributor

mrauhu commented Jan 7, 2022

@joshwooding

The @vitejs/plugin-vue has a second version:

https://github.com/vitejs/vite/blob/main/packages/plugin-vue/CHANGELOG.md

Can we also update Vue and Vite dependencies to latest versions?

Also, maybe we need update the Storybook dependencies?

@mrauhu
Copy link
Contributor

mrauhu commented Jan 7, 2022

@joshwooding maybe this setup can help you:

#186 (comment)

    // Needed only for development mode: `npm run storybook`
    config.optimizeDeps = configType === 'PRODUCTION' ? config.optimizeDeps : {
      ...(config.optimizeDeps || {}),
      include: [
        ...(config?.optimizeDeps?.include || []),
        
        // Optional, but prevents error flashing in the Storybook component preview iframe:
        // Fix: failed to fetch dynamically import module, avoid cache miss for dependencies on the first load 
        '@storybook/components',
        '@storybook/store',
        
        // Add all addons that imported in the `preview.js` or `preview.ts` file and used in exported constants
        '@storybook/addon-links'
        '@storybook/theming',
      ],
    }; 

I'm tested it with @vitejs/plugin-vue@2 and latest versions of Vue and Vite.

@joshwooding
Copy link
Member Author

@joshwooding

The @vitejs/plugin-vue has a second version:

https://github.com/vitejs/vite/blob/main/packages/plugin-vue/CHANGELOG.md

Can we also update Vue and Vite dependencies to latest versions?

I saw that, I didn't want to bump a major version but there's not really any harm since it's only example code.

As for bumping vue and vite. I'm not sure if I see it as necessary since they are on their current major versions but it doesn't hurt to keep them up to date so I'm indifferent. I have the same thoughts on the Storybook dependencies.

After saying that I think we should tackle those in a separate PR though since this once is primarily to fix the current issue we're facing.

@joshwooding
Copy link
Member Author

joshwooding commented Jan 7, 2022

@joshwooding maybe this setup can help you:

#186 (comment)

    // Needed only for development mode: `npm run storybook`
    config.optimizeDeps = configType === 'PRODUCTION' ? config.optimizeDeps : {
      ...(config.optimizeDeps || {}),
      include: [
        ...(config?.optimizeDeps?.include || []),
        
        // Optional, but prevents error flashing in the Storybook component preview iframe:
        // Fix: failed to fetch dynamically import module, avoid cache miss for dependencies on the first load 
        '@storybook/components',
        '@storybook/store',
        
        // Add all addons that imported in the `preview.js` or `preview.ts` file and used in exported constants
        '@storybook/addon-links'
        '@storybook/theming',
      ],
    }; 

Thanks, to get the vue/svelte examples locally is pretty easy you can add:

config.resolve.dedupe = ['@storybook/client-api', 'react']

but I'm not sure if this is the approach we want to take. There was some work in #160 to solve this but it caused other issues.

Edit: It's also worth adding this issue doesn't occur when using storyStoreV7

@joshwooding joshwooding merged commit 2275bcf into storybookjs:main Jan 20, 2022
@joshwooding joshwooding deleted the bump-vitejs-plugin-vue branch January 20, 2022 22:10
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