question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to specify path where all files from static directories will be outputted

See original GitHub issue

Right now I have nextjs project, with images in /static/images folder, and Im using it in components like this

<img src="/static/images/logo.png" alt="logo" /> Problem is when I starting storybook with "storybook": "start-storybook -p 6006 -c app/.storybook -s static", the logo cant be found, for storybook proper path to image is now "/images/logo.png"

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
jonespencommented, Oct 16, 2017

Had the exact same issue, added the file middleware.js to ./storybook with this content:

const express = require('express')
const path = require('path')

module.exports = router => {
  router.use('/static', express.static(path.join(__dirname, '..', 'static')))
}

Hope it helps!

Inspired by https://github.com/storybooks/storybook/issues/714

2reactions
aviramgacommented, Feb 9, 2018

@ndelangen @jonespen Im having the exact same issue but with build-storybook. Im also using nextjs. How can I solve this?

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change output directory for a target - xcode
8 Answers 8 · Go to File -> Project settings · Click the Advanced button · Click Done , then Done once more....
Read more >
Keeping the path for the static directory in building #714
jonespen mentioned this issue on Oct 16, 2017. Add option to specify path where all files from static directories will be outputted #1685....
Read more >
The staticfiles app
Files are searched by using the enabled finders . The default is to look in all locations defined in STATICFILES_DIRS and in the...
Read more >
Serving Static Content | NGINX Plus
Configure NGINX and NGINX Plus to serve static content, with type-specific root directories, checks for file existence, and performance optimizations.
Read more >
Flask-Assets — Flask-Assets 0.12 documentation
All paths are relative to your app's static directory, or the static ... Flask-Assets will automatically merge and compress your bundle's source files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found