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

Static files don't load if source directory is repointed #106

Closed
ryanechternacht opened this issue Aug 24, 2020 · 2 comments · Fixed by #108
Closed

Static files don't load if source directory is repointed #106

ryanechternacht opened this issue Aug 24, 2020 · 2 comments · Fixed by #108
Labels
type: bug Something isn't working

Comments

@ryanechternacht
Copy link

ryanechternacht commented Aug 24, 2020

Version

@nuxtjs/storybook: ^2.1.0
nuxt: ^2.14.0

Reproduction Link

https://github.com/ryanechternacht/nuxt-storybook-static-issue

Steps to reproduce

The repo above demonstrates the issue.

To create it I did the following

  1. npx create-nuxt-app nuxt-storybook-static-issue
  2. yarn add --dev @nuxtjs/storybook
  3. Added the TestComponent.vue, image in static/img/, and used it in pages/index.vue. Added TestComponent.stories.js
  4. Checked that everything worked correctly via yarn nuxt and yarn nuxt storybook (it did).
  5. Moved the source directory to src. 1) Added srcDir: 'src' to nuxt.config.js, 2) moved the assets, components, layouts, middleware, pages, plugins, static, and store directories under a src folder
  6. reran yarn nuxt and yarn nuxt storybook. the site is fine, but storybook fails to load the image from the static directory.

What is Expected?

The image should load in storybook

What is actually happening?

The image isn't loading in storybook (but works fine on the main site)

@ryanechternacht ryanechternacht added the type: bug Something isn't working label Aug 24, 2020
@ryanechternacht
Copy link
Author

By the way, THIS REPO IS AMAZING

I tried doing this like a month ago (and didn't know this repo existed) and EVERYTHING SUCKED. It was clear that nuxt/storybook should be sharing webpack setup, but making them do was painful. THANK YOU SO MUCH FOR DOING THIS

@farnabaz
Copy link
Collaborator

Hey @ryanechternacht,
Thanks for the issue and your king words :)
The fix will publish in v2.2.0 within two days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants