Code Monkey home page Code Monkey logo

storybook-addon-jira's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

storybook-addon-jira's Issues

[BUG] Uncaught (in promise) ReferenceError: process is not defined

Explanation

I tried to install and use the addon but the issue is loading eternally. When I click on the reload button I get the next error:

image

I checked the path /api and it works properly, it's getting the info of the issues if I use it with a ?ticketId query param

image

But the storybook is never receiving the issue properly

image

Technical details

Framework: Next.js 13.0.7
NodeJS version: 18.12.1
Webpack Version used for storybook: builder-webpack5

Main configuration
    module.exports = {
  "stories": [
    "../src/**/*.stories.mdx",
    "../src/**/*.stories.@(js|jsx|ts|tsx)"
  ],
  "addons": [
    "@storybook/addon-links",
    "@storybook/addon-essentials",
    "@storybook/addon-interactions",
    "storybook-addon-sass-postcss",
    "@storybook/addon-a11y",
    "storybook-jira-addon"
  ],
  "framework": "@storybook/react",
  "core": {
    "builder": "@storybook/builder-webpack5"
  }
}
Middleware file
const fetch = require("node-fetch");
module.exports = function expressMiddleware (router) {
  router.get('/api', (req, res) => {
      const myHeaders = new fetch.Headers();
      const authHeader = `Basic ${Buffer.from(`${process.env?.STORYBOOK_JIRA_USERNAME}:${process.env?.STORYBOOK_JIRA_API_KEY}`).toString('base64')}`
      myHeaders.append("Authorization", authHeader);
  const requestOptions = {
    method: 'GET',
    headers: myHeaders,
    redirect: 'follow'
  };

  fetch(`${process.env.STORYBOOK_JIRA_API_ENDPOINT}/${req.query?.ticketId}`, requestOptions)
    .then(response => response.json())
    .then(result => {
      res.send(result)
    })
    .catch(error => console.log('error', error));

})
}

SB v7 Support

Hi! Just wondering if there's any plan to enable compatibility for Storybook v7. Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.